aboutsummaryrefslogtreecommitdiffstats
path: root/science/libsvm/Makefile
blob: f39caaa94e3700c12aabd6d1ae579e5d67ccab78 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# New ports collection Makefile for: libsvm
# Date created:         Oct 28 2001
# Whom:                 Chia-Hsing Yu <me@davidyu.org>
#
# $FreeBSD$
#

PORTNAME=   libsvm
PORTVERSION=    2.84
PORTEPOCH=  1
CATEGORIES= science math
MASTER_SITES=   http://www.csie.ntu.edu.tw/~cjlin/libsvm/ \
        http://www.csie.ntu.edu.tw/~cjlin/libsvm/oldfiles/

MAINTAINER= rafan@FreeBSD.org
COMMENT=    A library for Support Vector Machines

USE_ZIP=    yes

.if defined(PKGNAMESUFFIX) && ${PKGNAMESUFFIX} == "-python"
CATEGORIES+=    python

USE_PYTHON= yes

MAKE_ARGS=  PYTHON_INCLUDEDIR=${PYTHON_INCLUDEDIR}

PYEXAMPLES= python/cross_validation.py \
        python/svm_test.py \
        python/test_cross_validation.py

TXT_DOCS=   README.python

BUILD_WRKSRC=   ${WRKSRC}/python

.else
TXT_DOCS=   COPYRIGHT README FAQ.html README.tools

TOOLS=      tools/grid.py tools/easy.py tools/subset.py

SUB_FILES=  pkg-message
SUB_LIST=   DATADIR=${DATADIR}

.endif

.if !defined(NOPORTDOCS)
PORTDOCS=   ${TXT_DOCS}
.endif

.include <bsd.port.pre.mk>

post-patch:

post-extract:
.if defined(PKGNAMESUFFIX) && ${PKGNAMESUFFIX} == "-python"
    @${CP} ${WRKSRC}/python/README ${WRKSRC}/README.python
.else
    @${CP} ${WRKSRC}/tools/README ${WRKSRC}/README.tools
.endif

.if defined(PKGNAMESUFFIX) && ${PKGNAMESUFFIX} == "-python"
do-install:
    ${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

.else

do-install:
    ${INSTALL_PROGRAM} ${WRKSRC}/svm-train ${PREFIX}/bin/
    ${INSTALL_PROGRAM} ${WRKSRC}/svm-predict ${PREFIX}/bin/
    ${INSTALL_PROGRAM} ${WRKSRC}/svm-scale ${PREFIX}/bin/
    ${MKDIR} ${DATADIR}
    for f in ${TOOLS}; do \
      ${INSTALL_DATA} ${WRKSRC}/$$f ${DATADIR}; \
    done

.endif

post-install:
.if !defined(NOPORTDOCS)
    @${MKDIR} ${DOCSDIR}
    for f in ${TXT_DOCS}; do \
      ${INSTALL_DATA} ${WRKSRC}/$$f ${DOCSDIR}; \
    done
.endif
.if defined(PKGNAMESUFFIX) && ${PKGNAMESUFFIX} != "-python"
    @${ECHO_MSG} ""
    @${CAT} ${PKGMESSAGE}
    @${ECHO_MSG} ""
.endif

.include <bsd.port.post.mk>