aboutsummaryrefslogtreecommitdiff
path: root/math/jags/Makefile
blob: d990de6941b78473ac82a2f97bf0e315d2fa5bcc (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
# vim: tabstop=8 softtabstop=0 noexpandtab
# Ports collection Makefile for:	jags
# Date created:		21 April 2004
# Whom:			Eric van Gyzen <vangyzen@stat.duke.edu>
#
# $FreeBSD$
#

PORTNAME=	mcmc-jags
PORTVERSION=	2.1.0
CATEGORIES=	math
MASTER_SITES=	SF:1,2,3
MASTER_SITE_SUBDIR=	${PORTNAME}/JAGS/2.x/Source/:1 \
		${PORTNAME}/Examples/2.0/:2 \
		${PORTNAME}/Manuals/2.0/:3
DISTFILES=	${DISTNAME:S/mcmc-//:U}${EXTRACT_SUFX}:1
.if !defined(NOPORTDOCS)
DISTFILES+=	classic-bugs.tar.gz:2 jags_developer_manual.pdf:3 \
		jags_installation_manual.pdf:3 jags_user_manual.pdf:3
EXTRACT_ONLY=	${DISTNAME:S/mcmc-//:U}${EXTRACT_SUFX}
.endif

MAINTAINER=	bf@FreeBSD.org
COMMENT=	Just Another Gibbs Sampler

OPTIONS=	ATLAS "use ATLAS libraries instead of BLAS and LAPACK" off

DIST_SUBDIR=	${PORTNAME}
WRKSRC=		${WRKDIR}/${PKGNAME:S/mcmc-//:U}

GNU_CONFIGURE=	yes
CPPFLAGS+=	-I${LOCALBASE}/include
LDFLAGS+=	-L${LOCALBASE}/lib
CONFIGURE_ENV=	CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
USE_FORTRAN=	yes
USE_LDCONFIG=	yes
USE_BISON=	build
PLIST_SUB=	PORTVERSION=${PORTVERSION}

.include <bsd.port.options.mk>

.if defined(WITH_ATLAS)
LIB_DEPENDS+=	atlas.2:${PORTSDIR}/math/atlas
CONFIGURE_ARGS=	--with-lapack=-lalapack --with-blas=-lf77blas
.else
LIB_DEPENDS+=	blas.2:${PORTSDIR}/math/blas
LIB_DEPENDS+=	lapack.4:${PORTSDIR}/math/lapack
CONFIGURE_ARGS=	--with-lapack=-llapack --with-blas=-lblas
.endif

post-patch:
	${REINPLACE_CMD} -e 's|[(]libdir[)]/pkgconfig|(prefix)/libdata/pkgconfig|g' \
		${WRKSRC}/etc/Makefile.in
	${REINPLACE_CMD} \
		-e '/@WINDOWS_FALSE@bin_SCRIPTS =/s/jags/mcmc-&/' \
		-e '/CLEANFILES =/s/jags/mcmc-&/' \
		-e '/@WINDOWS_FALSE@jags:/s/jags/mcmc-&/' \
		-e '/@WINDOWS_FALSE@.*rm -f jags/s/jags/mcmc-&/' \
		-e '/@WINDOWS_FALSE@.*mv jags.tmp jags/s/jags/mcmc-&/2' \
		${WRKSRC}/src/terminal/Makefile.in

post-install:
.if !defined(NOPORTDOCS)
	${MKDIR} ${DOCSDIR}
.for _M in developer installation user
	${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/jags_${_M}_manual.pdf \
		${DOCSDIR}
.endfor
.endif
.if !defined(NOPORTEXAMPLES)
	${MKDIR} ${EXAMPLESDIR}
	( cd ${EXAMPLESDIR}; \
	  ${PAX} -rzf ${DISTDIR}/${DIST_SUBDIR}/classic-bugs.tar.gz \
	    -s ':^classic-bugs/*::' )
	${SED} -i '' \
		-e '\|JAGS ?=|{s|/usr/local|${PREFIX}|;s|jags|mcmc-&|;}' \
		${EXAMPLESDIR}/vol[12]/Makefile
	@${ECHO_MSG} ""
	@${CAT} ${PKGMESSAGE}
	@${ECHO_MSG} ""

.endif

.include <bsd.port.mk>