aboutsummaryrefslogtreecommitdiff
path: root/biology/emboss/Makefile
blob: 42df7a0a65e83274437a83f7d7cfc1d23d5e4017 (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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# New ports collection makefile for:	emboss
# Date created:		31 July 2000
# Whom:	      		Johann Visagie <johann@egenetics.com>
#
# $FreeBSD$
#

PORTNAME=	emboss
PORTVERSION=	2.4.1
PORTREVISION=	2
CATEGORIES=	biology
MASTER_SITES=	ftp://ftp.uk.embnet.org/pub/EMBOSS/old/ \
		ftp://ftp.es.embnet.org/pub/software/emboss/EMBOSS/old \
		ftp://ftp.ebi.ac.uk/pub/software/unix/EMBOSS/
DISTFILES=	${PORTNAME:U}-${PORTVERSION}${EXTRACT_SUFX}
DIST_SUBDIR=	${PORTNAME}
EXTRACT_ONLY=	${PORTNAME:U}-${PORTVERSION}${EXTRACT_SUFX}

MAINTAINER=	wjv@FreeBSD.org
COMMENT=	A collection of open source tools for genetic sequence analysis

LIB_DEPENDS=	gd.4:${PORTSDIR}/graphics/gd

USE_SUBMAKE=	yes
USE_GMAKE=	yes
GNU_CONFIGURE=	yes
INSTALLS_SHLIB=	yes
USE_XLIB=	yes
USE_MOTIF=	yes
USE_PERL=	yes
PKGMESSAGE=	${WRKDIR}/pkg-message

.if exists(${WRKDIRPREFIX}${.CURDIR}/Makefile.inc)
.include "${WRKDIRPREFIX}${.CURDIR}/Makefile.inc"
.endif

CONFIGURE_ENV+=	CPPFLAGS="-I${LOCALBASE}/include" \
		LIBS="-L${LOCALBASE}/lib -L${X11BASE}/lib"
SCRIPTS_ENV+=	WRKDIRPREFIX="${WRKDIRPREFIX}" \
		MKDIR="${MKDIR}" RM="${RM}"

WRKSRC=		${WRKDIR}/${PORTNAME:U}-${PORTVERSION}
EMBASSY_WRKDIR=	${WRKSRC}/EMBASSY
EMNU_VERSION=	1.0.5
HMMER_VERSION=	2.1.1
MEME_VERSION=	2.3.1
MSE_VERSION=	0.0.4
TOPO_VERSION=	0.1
PHYLIP_VERSION=	3.573c
DOC_DIRS=	doc/manuals doc/tutorials doc/programs/text doc/programs/html
CONFIG_FILE=	${WRKSRC}/emboss/emboss.default.template

.for app in EMNU HMMER MEME MSE PHYLIP TOPO
SCRIPTS_ENV+=	${app}_VERSION="${${app}_VERSION}"
.if defined(WITH_${app})
APPLIST+=	${app}
${app}_WRKSRC=	${EMBASSY_WRKDIR}/${app}-${${app}_VERSION}
${app}_DISTFILE=${app}-${${app}_VERSION}${EXTRACT_SUFX}
DISTFILES+=	${${app}_DISTFILE}
PLIST_${app}=	""
.else
PLIST_${app}=	"@comment "
.endif
PLIST_SUB+=	PLIST_${app}=${PLIST_${app}}
.endfor

# Jemboss support is a work in progress.
#
#.if defined(WITH_JEMBOSS)
#USE_JAVA=	1.3+
#CONFIGURE_ARGS+=	--with-java=${JAVA_HOME}/include \
#			--with-javaos=${JAVA_HOME}/include/${JAVA_OS:L}
#CONFIGURE_ENV+=	PATH=${PATH}:${JAVA_HOME}/bin
#MAKE_ENV+=	PATH=${PATH}:${JAVA_HOME}/bin
#JEMBOSS_WRKSRC=	${WRKSRC}/jemboss
#.endif

pre-fetch:
	@ ${SETENV} ${SCRIPTS_ENV} ${SH} ${SCRIPTDIR}/configure.${PORTNAME}

post-extract:
.for app in ${APPLIST}
	@ ${MKDIR} ${EMBASSY_WRKDIR}
	@ cd ${EMBASSY_WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} \
	  ${_DISTDIR}/${${app}_DISTFILE} ${EXTRACT_AFTER_ARGS}
	@ if [ `id -u` = 0 ]; then \
	    ${CHMOD} -R ug-s ${${app}_WRKSRC}; \
	    ${CHOWN} -R 0:0 ${${app}_WRKSRC}; \
	  fi
.endfor

post-patch:
.for DIR in ${DOC_DIRS}
	@ ${PERL} -pi.orig -e \
	  's#\$$\(prefix\)/share/\$$\(PACKAGE\)/doc#\$$\(datadir\)/doc/\$$\(PACKAGE\)#' \
	  ${WRKSRC}/${DIR}/Makefile.in
.endfor

post-configure:
.for app in ${APPLIST}
	@ cd ${${app}_WRKSRC} && \
	  ${SETENV} CC="${CC}" CXX="${CXX}" CFLAGS="${CFLAGS}" \
	  CXXFLAGS="${CXXFLAGS}" \
	  INSTALL="/usr/bin/install -c -o ${BINOWN} -g ${BINGRP}" \
	  INSTALL_DATA="${INSTALL_DATA}" \
	  INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
	  INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
	  ${CONFIGURE_ENV} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS}
.endfor

post-build:
.for app in ${APPLIST}
	@ cd ${${app}_WRKSRC} && \
	  ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} \
	  ${MAKE_ARGS}
.endfor
#.if defined(WITH_JEMBOSS)
#	@ cd ${JEMBOSS_WRKSRC} && \
#	  ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} \
#	  ${MAKE_ARGS}
#.endif

post-install:
.for app in ${APPLIST}
	@ cd ${${app}_WRKSRC} && \
	  ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} \
	  ${MAKE_ARGS} ${INSTALL_TARGET}
.endfor
	@ ${PERL} -pe 's#%%PREFIX%%#${PREFIX}#' \
	  ${CONFIG_FILE} > ${PREFIX}/etc/emboss.default.sample && \
	  ${CHOWN} ${SHAREOWN}:${SHAREGRP} \
	  ${PREFIX}/etc/emboss.default.sample
	@ ${PERL} -pe 's#%%PREFIX%%#${PREFIX}#' \
	  pkg-message > ${PKGMESSAGE}
.if !defined(BATCH)
	@ ${CAT} ${PKGMESSAGE}
.endif

post-clean:
	@ ${RM} -f ${WRKDIRPREFIX}${.CURDIR}/Makefile.inc

.include <bsd.port.mk>