2002-10-07 05:07:13 +02:00
|
|
|
# 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
|
2002-10-19 20:19:50 +02:00
|
|
|
PORTVERSION= 0.1.${RELEASE_DATE}
|
2002-10-21 12:59:11 +02:00
|
|
|
CATEGORIES= biology net
|
2002-12-19 02:17:07 +01:00
|
|
|
MASTER_SITES= ${MASTER_SITE_LOCAL}
|
|
|
|
MASTER_SITE_SUBDIR= lioux
|
|
|
|
DISTNAME= distribfold-current-FreeBSD-${PORTVERSION}
|
2002-10-07 05:07:13 +02:00
|
|
|
|
|
|
|
MAINTAINER= lioux@FreeBSD.org
|
2003-02-23 20:58:35 +01:00
|
|
|
COMMENT= distributedfolding.org distributed protein folding project
|
2002-10-07 05:07:13 +02:00
|
|
|
|
|
|
|
ONLY_FOR_ARCHS= i386
|
2004-02-27 01:01:02 +01:00
|
|
|
USE_BZIP2= yes
|
2002-10-07 05:07:13 +02:00
|
|
|
USE_REINPLACE= yes
|
2004-02-08 02:14:05 +01:00
|
|
|
USE_SIZE= yes
|
2002-10-07 05:07:13 +02:00
|
|
|
NO_BUILD= yes
|
|
|
|
|
|
|
|
WRKSRC= ${WRKDIR}/distribfold
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2004-06-13 17:40:24 +02:00
|
|
|
RELEASE_DATE= 20040613
|
2002-10-19 20:19:50 +02:00
|
|
|
|
2002-10-07 05:07:13 +02:00
|
|
|
post-patch:
|
2002-10-19 20:19:50 +02:00
|
|
|
@${REINPLACE_CMD} -E -e 's|%%DESTINATION_DIR%%|${DESTINATION_DIR}/cpu0|' \
|
2002-10-07 05:07:13 +02:00
|
|
|
${WRKSRC}/foldit
|
|
|
|
|
|
|
|
pre-install:
|
|
|
|
# create users
|
|
|
|
@${SETENV} PKG_PREFIX=${PREFIX} ${SH} \
|
|
|
|
${PKGINSTALL} ${PKGNAME} POST-INSTALL
|
|
|
|
|
|
|
|
do-install:
|
2002-10-21 12:59:11 +02:00
|
|
|
# remove any patch scrap files
|
2002-10-07 05:07:13 +02:00
|
|
|
.for ext in bak orig
|
|
|
|
@${RM} -f ${WRKSRC}/*.${ext}
|
|
|
|
.endfor
|
|
|
|
# strip binaries
|
|
|
|
.for file in ${PROGRAM_FILES}
|
|
|
|
@${STRIP_CMD} ${WRKSRC}/${file}
|
|
|
|
.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 file in ${PROGRAM_FILES} ${SCRIPT_FILES} ; do \
|
|
|
|
${CHMOD} 0755 $${DESTINATION_DIR}/$${file} ; \
|
|
|
|
done ; \
|
|
|
|
done
|
|
|
|
# display package message
|
|
|
|
@${CAT} ${PKGMESSAGE}
|
|
|
|
|
2002-10-19 20:19:50 +02:00
|
|
|
post-install: cook-install-plist fix-startup-scripts
|
2002-10-07 05:07:13 +02:00
|
|
|
|
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
2002-12-19 02:17:07 +01:00
|
|
|
.if ${OSVERSION} >= 500000
|
|
|
|
LIB_DEPENDS+= c_r.4:${PORTSDIR}/misc/compat4x
|
|
|
|
.endif
|
|
|
|
|
2002-10-07 05:07:13 +02:00
|
|
|
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 file in plistN plist.end
|
|
|
|
@${CAT} ${WRKDIR}/${file} >> ${TMPPLIST}
|
|
|
|
.endfor
|
|
|
|
.endif
|
|
|
|
|
2002-10-19 20:19:50 +02:00
|
|
|
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
|
|
|
|
|
2002-10-07 05:07:13 +02:00
|
|
|
.include <bsd.port.post.mk>
|