diff options
author | sem <sem@FreeBSD.org> | 2004-12-11 12:39:53 +0800 |
---|---|---|
committer | sem <sem@FreeBSD.org> | 2004-12-11 12:39:53 +0800 |
commit | aebb766ae28d58461e0f1fda25a52fa371e333ac (patch) | |
tree | 7ab0b3b331fd7c7b69338d043d6b1e130d3f9528 | |
parent | fcd3942324b3ff90122d2efdecd4022e604b8f01 (diff) | |
download | freebsd-ports-gnome-aebb766ae28d58461e0f1fda25a52fa371e333ac.tar.gz freebsd-ports-gnome-aebb766ae28d58461e0f1fda25a52fa371e333ac.tar.zst freebsd-ports-gnome-aebb766ae28d58461e0f1fda25a52fa371e333ac.zip |
- Update to 2.71
- Install tools
- Make python interface to a slave port
- Respect to CXX and CFLAGS in python/Makefile
- Pass a maintainership to the submitter
PR: ports/73981
Submitted by: Rong-En Fan <rafan(at)infor.org>
Approved by: former maintainer
-rw-r--r-- | science/libsvm/Makefile | 59 | ||||
-rw-r--r-- | science/libsvm/distinfo | 4 | ||||
-rw-r--r-- | science/libsvm/files/patch-Makefile | 17 | ||||
-rw-r--r-- | science/libsvm/files/patch-python-Makefile | 18 | ||||
-rw-r--r-- | science/libsvm/pkg-message | 5 | ||||
-rw-r--r-- | science/libsvm/pkg-plist | 5 |
6 files changed, 81 insertions, 27 deletions
diff --git a/science/libsvm/Makefile b/science/libsvm/Makefile index 15f08f6c48a7..75a5e52f6d3f 100644 --- a/science/libsvm/Makefile +++ b/science/libsvm/Makefile @@ -6,25 +6,51 @@ # PORTNAME= libsvm -PORTVERSION= 2.5 +PORTVERSION= 2.71 CATEGORIES= science math -MASTER_SITES= http://www.csie.ntu.edu.tw/~cjlin/libsvm/ +MASTER_SITES= http://www.csie.ntu.edu.tw/~cjlin/libsvm/ \ + http://www.csie.ntu.edu.tw/~cjlin/libsvm/oldfiles/ -MAINTAINER= me@davidyu.org +MAINTAINER= rafan@infor.org COMMENT= A library for Support Vector Machines +USE_ZIP= yes .if defined(WITH_PYTHON) USE_PYTHON= yes -ALL_TARGET= all py -MAKE_ARGS+= PYTHON_INCLUDEDIR=${PYTHON_INCLUDEDIR} +USE_REINPLACE= yes PLIST_SUB+= LIBSVM_PYTHON="" .else PLIST_SUB+= LIBSVM_PYTHON="@comment " +PYEXAMPLES= python/cross_validation.py \ + python/svm_test.py \ + python/test_cross_validation.py .endif +TXT_DOCS= COPYRIGHT README FAQ.html python/README.python +.if !defined(NOPORTDOCS) +PORTDOCS= ${TXT_DOCS} +.endif +TOOLS= python/grid.py python/easy.py + +MSG_FILE= ${PKGDIR}/pkg-message +PKGMESSAGE= ${WRKSRC}/pkg-message + pre-everything:: -.if !defined(WITH_PYTHON) - @${ECHO_MSG} "You can install python interface by defining WITH_PYTHON=yes" +.if defined(WITH_PYTHON) + @${ECHO_MSG} "Build with Python interface." +.else + @${ECHO_MSG} "You can enable Python interface by defining WITH_PYTHON." +.endif + +post-patch: +.if defined(WITH_PYTHON) + @${REINPLACE_CMD} -e "s,%%PYTHON_INCLUDEDIR%%,${PYTHON_INCLUDEDIR}," ${WRKSRC}/python/Makefile +.endif + @${SED} 's|%%DATADIR%%|${DATADIR}|g' ${MSG_FILE} > ${PKGMESSAGE} + +post-build: +.if defined(WITH_PYTHON) + cd ${WRKSRC}/python; ${MAKE} .endif do-install: @@ -34,11 +60,24 @@ do-install: .if defined(WITH_PYTHON) ${INSTALL_SCRIPT} ${WRKSRC}/python/svm.py ${PYTHON_SITELIBDIR}/ ${INSTALL_PROGRAM} ${WRKSRC}/python/svmc.so ${PYTHON_SITELIBDIR}/ + ${MKDIR} ${EXAMPLESDIR} + for f in ${PYEXAMPLES}; do \ + ${INSTALL_DATA} ${WRKSRC}/$$f ${EXAMPLESDIR}; \ + done .endif + ${MKDIR} ${DATADIR} + for f in ${TOOLS}; do \ + ${INSTALL_DATA} ${WRKSRC}/$$f ${DATADIR}; \ + done .if !defined(NOPORTDOCS) - @${MKDIR} ${DOCSDIR} - ${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR} - ${INSTALL_DATA} ${WRKSRC}/COPYRIGHT ${DOCSDIR} + ${MKDIR} ${DOCSDIR} + ${CP} ${WRKSRC}/python/README ${WRKSRC}/python/README.python + for f in ${TXT_DOCS}; do \ + ${INSTALL_DATA} ${WRKSRC}/$$f ${DOCSDIR}; \ + done .endif + @${ECHO} "" + @${CAT} ${PKGMESSAGE} + @${ECHO} "" .include <bsd.port.mk> diff --git a/science/libsvm/distinfo b/science/libsvm/distinfo index 596b775aee2e..c58469c16472 100644 --- a/science/libsvm/distinfo +++ b/science/libsvm/distinfo @@ -1,2 +1,2 @@ -MD5 (libsvm-2.5.tar.gz) = 5973401a9b5d9fdd65fc46bdc61a5f9e -SIZE (libsvm-2.5.tar.gz) = 320549 +MD5 (libsvm-2.71.zip) = 2c963638a0ae0f2bdcc36afe6fdc173b +SIZE (libsvm-2.71.zip) = 455940 diff --git a/science/libsvm/files/patch-Makefile b/science/libsvm/files/patch-Makefile index 800400c3b960..f45745ff642e 100644 --- a/science/libsvm/files/patch-Makefile +++ b/science/libsvm/files/patch-Makefile @@ -1,16 +1,9 @@ ---- Makefile.orig Sat Sep 22 23:04:16 2001 -+++ Makefile Fri May 10 14:40:09 2002 -@@ -1,5 +1,5 @@ +--- Makefile.orig Tue Nov 16 00:45:06 2004 ++++ Makefile Tue Nov 16 00:46:01 2004 +@@ -1,5 +1,4 @@ -CXXC = g++ --CFLAGS = -Wall -O3 -g -+CXXC = ${CXX} -+CFLAGS += -g +-CFLAGS = -Wall -O3 ++CXXC = $(CXX) all: svm-train svm-predict svm-scale -@@ -13,3 +13,5 @@ - $(CXXC) $(CFLAGS) -c svm.cpp - clean: - rm -f *~ svm.o svm-train svm-predict svm-scale -+py: -+ cd python; $(MAKE) PYTHON_INCLUDEDIR=${PYTHON_INCLUDEDIR} diff --git a/science/libsvm/files/patch-python-Makefile b/science/libsvm/files/patch-python-Makefile new file mode 100644 index 000000000000..34dee6afbd37 --- /dev/null +++ b/science/libsvm/files/patch-python-Makefile @@ -0,0 +1,18 @@ +--- python/Makefile.orig Wed Mar 24 19:33:46 2004 ++++ python/Makefile Tue Nov 16 01:14:32 2004 +@@ -1,11 +1,11 @@ +-CC = g++ ++CC = $(CXX) + SWIG ?= swig + + #Windows: see ../README ../Makefile.win +-PYTHON_INCLUDEDIR ?= /usr/include/python2.3 ++PYTHON_INCLUDEDIR ?= %%PYTHON_INCLUDEDIR%% + +-CFLAGS = -O3 -I$(PYTHON_INCLUDEDIR) -I.. +-LDFLAGS = -shared ++CFLAGS += -I$(PYTHON_INCLUDEDIR) -I.. ++LDFLAGS += -shared + + all: svmc.so + diff --git a/science/libsvm/pkg-message b/science/libsvm/pkg-message new file mode 100644 index 000000000000..e15736d7ed83 --- /dev/null +++ b/science/libsvm/pkg-message @@ -0,0 +1,5 @@ + +Some useful tools are installed to %%DATADIR%%. +Most of them are written in Python, please install +lang/python before trying them. + diff --git a/science/libsvm/pkg-plist b/science/libsvm/pkg-plist index ef9b09b323d5..f5eb10746088 100644 --- a/science/libsvm/pkg-plist +++ b/science/libsvm/pkg-plist @@ -1,8 +1,7 @@ bin/svm-predict bin/svm-scale bin/svm-train +%%DATADIR%%/grid.py +%%DATADIR%%/easy.py %%LIBSVM_PYTHON%%%%PYTHON_SITELIBDIR%%/svm.py %%LIBSVM_PYTHON%%%%PYTHON_SITELIBDIR%%/svmc.so -%%PORTDOCS%%%%DOCSDIR%%/README -%%PORTDOCS%%%%DOCSDIR%%/COPYRIGHT -%%PORTDOCS%%@dirrm %%DOCSDIR%% |