- Update to 2.84

- Now libsvm-python installs only python interface bits and it should be
  buildable on Python 2.5
This commit is contained in:
Rong-En Fan 2007-04-01 12:53:02 +00:00
parent 7f82066b12
commit b3532e1dcf
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=188937
6 changed files with 51 additions and 49 deletions

View file

@ -11,6 +11,6 @@ MAINTAINER= rafan@FreeBSD.org
MASTERDIR= ${.CURDIR}/../../science/libsvm MASTERDIR= ${.CURDIR}/../../science/libsvm
WITH_PYTHON= yes PLIST= ${.CURDIR}/pkg-plist
.include "${MASTERDIR}/Makefile" .include "${MASTERDIR}/Makefile"

View file

@ -0,0 +1,6 @@
%%EXAMPLESDIR%%/cross_validation.py
%%EXAMPLESDIR%%/svm_test.py
%%EXAMPLESDIR%%/test_cross_validation.py
%%PYTHON_SITELIBDIR%%/svm.py
%%PYTHON_SITELIBDIR%%/svmc.so
@dirrm %%EXAMPLESDIR%%

View file

@ -6,8 +6,7 @@
# #
PORTNAME= libsvm PORTNAME= libsvm
PORTVERSION= 2.83 PORTVERSION= 2.84
PORTREVISION= 0
PORTEPOCH= 1 PORTEPOCH= 1
CATEGORIES= science math CATEGORIES= science math
MASTER_SITES= http://www.csie.ntu.edu.tw/~cjlin/libsvm/ \ MASTER_SITES= http://www.csie.ntu.edu.tw/~cjlin/libsvm/ \
@ -18,18 +17,24 @@ COMMENT= A library for Support Vector Machines
USE_ZIP= yes USE_ZIP= yes
.if defined(WITH_PYTHON) .if defined(PKGNAMESUFFIX) && ${PKGNAMESUFFIX} == "-python"
CATEGORIES+= python CATEGORIES+= python
USE_PYTHON= yes USE_PYTHON= yes
PLIST_SUB+= LIBSVM_PYTHON=""
MAKE_ARGS= PYTHON_INCLUDEDIR=${PYTHON_INCLUDEDIR}
PYEXAMPLES= python/cross_validation.py \ PYEXAMPLES= python/cross_validation.py \
python/svm_test.py \ python/svm_test.py \
python/test_cross_validation.py python/test_cross_validation.py
.else
PLIST_SUB+= LIBSVM_PYTHON="@comment "
.endif
TXT_DOCS= COPYRIGHT README FAQ.html README.python TXT_DOCS= README.python
BUILD_WRKSRC= ${WRKSRC}/python
.else
TXT_DOCS= COPYRIGHT README FAQ.html README.tools
.if !defined(NOPORTDOCS) .if !defined(NOPORTDOCS)
PORTDOCS= ${TXT_DOCS} PORTDOCS= ${TXT_DOCS}
.endif .endif
@ -38,50 +43,52 @@ TOOLS= tools/grid.py tools/easy.py tools/subset.py
SUB_FILES= pkg-message SUB_FILES= pkg-message
SUB_LIST= DATADIR=${DATADIR} SUB_LIST= DATADIR=${DATADIR}
.endif
.include <bsd.port.pre.mk> .include <bsd.port.pre.mk>
pre-everything::
.if defined(WITH_PYTHON)
@${ECHO_CMD} "Build with Python interface."
.else
@${ECHO_CMD} "You can enable Python interface by defining WITH_PYTHON."
.endif
post-patch: post-patch:
.if defined(WITH_PYTHON)
@${REINPLACE_CMD} -e "s,%%PYTHON_INCLUDEDIR%%,${PYTHON_INCLUDEDIR}," ${WRKSRC}/python/Makefile post-extract:
.endif .if defined(PKGNAMESUFFIX) && ${PKGNAMESUFFIX} == "-python"
@${CP} ${WRKSRC}/python/README ${WRKSRC}/README.python
post-build: .else
.if defined(WITH_PYTHON) @${CP} ${WRKSRC}/tools/README ${WRKSRC}/README.tools
cd ${WRKSRC}/python; ${MAKE}
.endif .endif
.if defined(PKGNAMESUFFIX) && ${PKGNAMESUFFIX} == "-python"
do-install: do-install:
${INSTALL_PROGRAM} ${WRKSRC}/svm-train ${TARGETDIR}/bin/
${INSTALL_PROGRAM} ${WRKSRC}/svm-predict ${TARGETDIR}/bin/
${INSTALL_PROGRAM} ${WRKSRC}/svm-scale ${TARGETDIR}/bin/
.if defined(WITH_PYTHON)
${INSTALL_SCRIPT} ${WRKSRC}/python/svm.py ${PYTHON_SITELIBDIR}/ ${INSTALL_SCRIPT} ${WRKSRC}/python/svm.py ${PYTHON_SITELIBDIR}/
${INSTALL_PROGRAM} ${WRKSRC}/python/svmc.so ${PYTHON_SITELIBDIR}/ ${INSTALL_PROGRAM} ${WRKSRC}/python/svmc.so ${PYTHON_SITELIBDIR}/
${MKDIR} ${EXAMPLESDIR} ${MKDIR} ${EXAMPLESDIR}
for f in ${PYEXAMPLES}; do \ for f in ${PYEXAMPLES}; do \
${INSTALL_DATA} ${WRKSRC}/$$f ${EXAMPLESDIR}; \ ${INSTALL_DATA} ${WRKSRC}/$$f ${EXAMPLESDIR}; \
done done
.endif
.else
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/svm-train ${TARGETDIR}/bin/
${INSTALL_PROGRAM} ${WRKSRC}/svm-predict ${TARGETDIR}/bin/
${INSTALL_PROGRAM} ${WRKSRC}/svm-scale ${TARGETDIR}/bin/
${MKDIR} ${DATADIR} ${MKDIR} ${DATADIR}
for f in ${TOOLS}; do \ for f in ${TOOLS}; do \
${INSTALL_DATA} ${WRKSRC}/$$f ${DATADIR}; \ ${INSTALL_DATA} ${WRKSRC}/$$f ${DATADIR}; \
done done
.endif
post-install:
.if !defined(NOPORTDOCS) .if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR} @${MKDIR} ${DOCSDIR}
${CP} ${WRKSRC}/python/README ${WRKSRC}/README.python
for f in ${TXT_DOCS}; do \ for f in ${TXT_DOCS}; do \
${INSTALL_DATA} ${WRKSRC}/$$f ${DOCSDIR}; \ ${INSTALL_DATA} ${WRKSRC}/$$f ${DOCSDIR}; \
done done
.endif .endif
@${ECHO_CMD} "" .if defined(PKGNAMESUFFIX) && ${PKGNAMESUFFIX} != "-python"
@${ECHO_MSG} ""
@${CAT} ${PKGMESSAGE} @${CAT} ${PKGMESSAGE}
@${ECHO_CMD} "" @${ECHO_MSG} ""
.endif
.include <bsd.port.post.mk> .include <bsd.port.post.mk>

View file

@ -1,3 +1,3 @@
MD5 (libsvm-2.83.zip) = fcd7a994906706f669e36ecf5e7c1ef1 MD5 (libsvm-2.84.zip) = 2ab586f7acc170ee8d215973f4f98297
SHA256 (libsvm-2.83.zip) = 4ff5690224a2f1f511c91f222585af5873bef41645bb5b287c0a340e6d88cb73 SHA256 (libsvm-2.84.zip) = 0651fd0fb6aef5b68945dad7b717579b18220c77e304f9317018fb19cef71cd9
SIZE (libsvm-2.83.zip) = 434438 SIZE (libsvm-2.84.zip) = 434514

View file

@ -1,13 +1,8 @@
--- python/Makefile.orig Tue Jul 12 01:11:46 2005 --- python/Makefile.orig Fri May 5 22:00:19 2006
+++ python/Makefile Tue Jul 12 01:11:50 2005 +++ python/Makefile Sun Apr 1 20:50:00 2007
@@ -1,8 +1,8 @@ @@ -1,4 +1,4 @@
-CC = g++ -CC = g++
+CC = ${CXX} +CC = ${CXX}
SWIG ?= swig SWIG ?= swig
#Windows: see ../README ../Makefile.win #Windows: see ../README ../Makefile.win
-PYTHON_INCLUDEDIR ?= /usr/include/python2.4
+PYTHON_INCLUDEDIR ?= %%PYTHON_INCLUDEDIR%%
CFLAGS = -O3 -I$(PYTHON_INCLUDEDIR) -I..
LDFLAGS = -shared

View file

@ -4,10 +4,4 @@ bin/svm-train
%%DATADIR%%/grid.py %%DATADIR%%/grid.py
%%DATADIR%%/easy.py %%DATADIR%%/easy.py
%%DATADIR%%/subset.py %%DATADIR%%/subset.py
%%LIBSVM_PYTHON%%%%EXAMPLESDIR%%/cross_validation.py
%%LIBSVM_PYTHON%%%%EXAMPLESDIR%%/svm_test.py
%%LIBSVM_PYTHON%%%%EXAMPLESDIR%%/test_cross_validation.py
%%LIBSVM_PYTHON%%%%PYTHON_SITELIBDIR%%/svm.py
%%LIBSVM_PYTHON%%%%PYTHON_SITELIBDIR%%/svmc.so
%%LIBSVM_PYTHON%%@dirrm %%EXAMPLESDIR%%
@dirrm %%DATADIR%% @dirrm %%DATADIR%%