summaryrefslogtreecommitdiff
path: root/math/libsvm/Makefile
blob: a8c0a1275b60b297c1c244feb9530dd51004e847 (plain)
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
# $NetBSD: Makefile,v 1.11 2020/12/04 20:45:29 nia Exp $

DISTNAME=	libsvm-3.24
PKGREVISION=	1
CATEGORIES=	math
MASTER_SITES=	https://www.csie.ntu.edu.tw/~cjlin/libsvm/

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	https://www.csie.ntu.edu.tw/~cjlin/libsvm/
COMMENT=	Library for Support Vector Machines
LICENSE=	modified-bsd

USE_LANGUAGES=	c c++
USE_TOOLS+=	gmake

BUILD_TARGET=	all lib
AUTO_MKDIRS=	yes

REPLACE_PYTHON=		tools/*.py

SUBST_CLASSES+=		paths
SUBST_SED.paths=	-e 's,[.][.]/svm-train,${PREFIX}/bin/svm-train,'
SUBST_SED.paths+=	-e 's,[.][.]/svm-scale,${PREFIX}/bin/svm-scale,'
SUBST_SED.paths+=	-e 's,[.][.]/svm-predict,${PREFIX}/bin/svm-predict,'
SUBST_SED.paths+=	-e 's,"[.]/grid[.]py,"${PREFIX}/bin/svm-grid,'
SUBST_SED.paths+=	-e 's,/usr/bin/gnuplot,${PREFIX}/bin/gnuplot,'
SUBST_FILES.paths=	tools/grid.py tools/easy.py
SUBST_STAGE.paths=	pre-build
SUBST_MESSAGE.paths=	Fixing hardcoded paths.

.include "../../mk/bsd.prefs.mk"

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/svm-predict ${DESTDIR}${PREFIX}/bin
	${INSTALL_PROGRAM} ${WRKSRC}/svm-scale ${DESTDIR}${PREFIX}/bin
	${INSTALL_PROGRAM} ${WRKSRC}/svm-train ${DESTDIR}${PREFIX}/bin
	${INSTALL_LIB} ${WRKSRC}/libsvm.so.2 ${DESTDIR}${PREFIX}/lib
	${LN} -s libsvm.so.2 ${DESTDIR}${PREFIX}/lib/libsvm.so
	${INSTALL_DATA} ${WRKSRC}/svm.h ${DESTDIR}${PREFIX}/include
	${INSTALL_DATA} ${WRKSRC}/FAQ.html \
		${DESTDIR}${PREFIX}/share/doc/${PKGBASE}
	${INSTALL_DATA} ${WRKSRC}/README \
		${DESTDIR}${PREFIX}/share/doc/${PKGBASE}
	${INSTALL_DATA} ${WRKSRC}/tools/README \
		${DESTDIR}${PREFIX}/share/doc/${PKGBASE}/README_tools
	${INSTALL_DATA} ${WRKSRC}/heart_scale \
		${DESTDIR}${PREFIX}/share/examples/${PKGBASE}
	${INSTALL_SCRIPT} ${WRKSRC}/tools/grid.py ${DESTDIR}${PREFIX}/bin/svm-grid
	${INSTALL_SCRIPT} ${WRKSRC}/tools/easy.py ${DESTDIR}${PREFIX}/bin/svm-easy
	${INSTALL_SCRIPT} ${WRKSRC}/tools/checkdata.py ${DESTDIR}${PREFIX}/bin/svm-checkdata
	${INSTALL_SCRIPT} ${WRKSRC}/tools/subset.py ${DESTDIR}${PREFIX}/bin/svm-subset

.if ${OPSYS} == "Darwin"
.PHONY: fix-darwin-install-name
post-install: fix-darwin-install-name
fix-darwin-install-name:
	install_name_tool -id ${PREFIX}/lib/libsvm.so.2 \
		${DESTDIR}${PREFIX}/lib/libsvm.so.2
.endif

.include "../../lang/python/application.mk"
.include "../../mk/bsd.pkg.mk"