blob: b9c75a229fb2ea64ac91f3d01b69440dd19ef5e5 (
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
|
# New ports collection makefile for: folding@home client
# Date created: Sun Sep 29 19:48:01 UTC 2002
# Whom: Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
#
# $FreeBSD$
#
PORTNAME= distribfold
PORTVERSION= 0.1.${RELEASE_DATE}
CATEGORIES= biology net
MASTER_SITES= ${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR= lioux
DISTNAME= distribfold-current-FreeBSD-${PORTVERSION}
MAINTAINER= ports@FreeBSD.org
COMMENT= distributedfolding.org distributed protein folding project
LIB_DEPENDS= c_r.4:${PORTSDIR}/misc/compat4x
ONLY_FOR_ARCHS= i386
USE_BZIP2= yes
NO_BUILD= yes
WRKSRC= ${WRKDIR}/distribfold
PKGMESSAGE= ${WRKDIR}/pkg-message
SUB_FILES= pkg-message
# files to install
SCRIPT_FILES= distrib-update foldit
PROGRAM_FILES= foldtrajlite
# installation dir
DESTINATION_DIR= ${PREFIX}/distribfold
# default users
DNETFOLD_USER=dnetfold
DNETFOLD_GROUP=dnetfold
# default number of processors
WITH_NCPU?= 1
RELEASE_DATE= 20040613
post-patch:
@${REINPLACE_CMD} -E -e 's|%%DESTINATION_DIR%%|${DESTINATION_DIR}/cpu0|' \
${WRKSRC}/foldit
pre-install:
# create users
@${SETENV} PKG_PREFIX=${PREFIX} ${SH} \
${PKGINSTALL} ${PKGNAME} POST-INSTALL
do-install:
# remove any patch scrap files
.for ext in bak orig
@${RM} -f ${WRKSRC}/*.${ext}
.endfor
# strip binaries
.for f in ${PROGRAM_FILES}
@${STRIP_CMD} ${WRKSRC}/${f}
.endfor
# install startup script
@${INSTALL_SCRIPT} ${WRKDIR}/distribfold.sh ${PREFIX}/etc/rc.d
# for every cpu directory
@ncpu=`${CAT} ${WRKDIR}/ncpu` ; \
for dir in `${FILESDIR}/number_of_dirs.sh $${ncpu}` ; do \
DESTINATION_DIR=${DESTINATION_DIR}/cpu$${dir} ; \
${MKDIR} $${DESTINATION_DIR} ; \
${INSTALL_DATA} ${WRKSRC}/* $${DESTINATION_DIR} ; \
${CHGRP} -R ${DNETFOLD_GROUP} $${DESTINATION_DIR} ; \
${CHMOD} g+w $${DESTINATION_DIR} ; \
${CHOWN} ${DNETFOLD_USER} $${DESTINATION_DIR}/* ; \
${CHMOD} u+w $${DESTINATION_DIR}/* ; \
for f in ${PROGRAM_FILES} ${SCRIPT_FILES} ; do \
${CHMOD} 0755 $${DESTINATION_DIR}/$${f} ; \
done ; \
done
# display package message
@${CAT} ${PKGMESSAGE}
post-install: cook-install-plist fix-startup-scripts
pre-everything::
.if ${WITH_NCPU} < 1
@${ECHO_MSG} "===> Number of processors HAS to be at least 1"
@${ECHO_MSG} "===> (${WITH_NCPU}) IS NOT"
@${FALSE}
.endif
@${ECHO_MSG} "=======> ATTENTION <======="
@${ECHO_MSG} "===> If you want to have multiple copies of this program"
@${ECHO_MSG} "===> running in order to make better use of your SMP"
@${ECHO_MSG} "===> system, set WITH_CPU to the number of cpus"
@${ECHO_MSG} "===> available in your system"
@${ECHO_MSG} "===> For example, 2 cpus. \"make WITH_CPU=2\""
@${ECHO_MSG} "===> Do not use this variable if you do not have a SMP"
@${ECHO_MSG} "===> system. There is no advantage otherwise."
do-configure:
# prepare startup script
@${SED} -e 's|%%DNETFOLD_USER%%|${DNETFOLD_USER}|' \
-e 's|%%DESTINATION_DIR%%|${DESTINATION_DIR}|' \
-e 's|%%NCPU%%|${WITH_NCPU}|' \
${FILESDIR}/distribfold.sh > ${WRKDIR}/distribfold.sh
# record number of cpus
@${ECHO} ${WITH_NCPU} > ${WRKDIR}/ncpu
cook-install-plist: generate-plist
.if ${WITH_NCPU} > 1
@${GREP} cpu0 ${TMPPLIST} > ${WRKDIR}/plist
@${TAIL} -n 2 ${TMPPLIST} > ${WRKDIR}/plist.end
@${CP} /dev/null ${WRKDIR}/plistN
# for every cpu directory
@ncpu=`${CAT} ${WRKDIR}/ncpu` ; \
for dir in `${FILESDIR}/number_of_dirs.sh $${ncpu}` ; do \
${SED} -e "s|cpu0|cpu$${dir}|" ${WRKDIR}/plist >> ${WRKDIR}/plistN ; \
done
@${CP} /dev/null ${TMPPLIST}
.for f in plistN plist.end
@${CAT} ${WRKDIR}/${f} >> ${TMPPLIST}
.endfor
.endif
fix-startup-scripts:
.if ${WITH_NCPU} > 1
# for every cpu directory
@ncpu=`${CAT} ${WRKDIR}/ncpu` ; \
for dir in `${FILESDIR}/number_of_dirs.sh $${ncpu}` ; do \
${REINPLACE_CMD} -e "s|cpu0|cpu$${dir}|" \
${DESTINATION_DIR}/cpu$${dir}/foldit ; \
${RM} -f ${DESTINATION_DIR}/cpu$${dir}/foldit.bak ; \
done
.endif
.include <bsd.port.mk>
|