diff options
author | Patrick Kursawe <phosphan@gentoo.org> | 2006-06-16 08:44:04 +0000 |
---|---|---|
committer | Patrick Kursawe <phosphan@gentoo.org> | 2006-06-16 08:44:04 +0000 |
commit | 74a663d6de1c84c9622eab02c7cec8a8eb8823d0 (patch) | |
tree | 2356418461f981c1a6fe83540c74d11fc2110010 /sci-biology/foldingathome | |
parent | New version that works for glibc-2.4 users who haven't emerged glibc against ... (diff) | |
download | gentoo-2-74a663d6de1c84c9622eab02c7cec8a8eb8823d0.tar.gz gentoo-2-74a663d6de1c84c9622eab02c7cec8a8eb8823d0.tar.bz2 gentoo-2-74a663d6de1c84c9622eab02c7cec8a8eb8823d0.zip |
Adding --chdir to start-stop-daemon because of bug #109707
(Portage version: 2.1)
Diffstat (limited to 'sci-biology/foldingathome')
6 files changed, 153 insertions, 2 deletions
diff --git a/sci-biology/foldingathome/ChangeLog b/sci-biology/foldingathome/ChangeLog index e01b6217a70b..6d944875e16a 100644 --- a/sci-biology/foldingathome/ChangeLog +++ b/sci-biology/foldingathome/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sci-biology/foldingathome -# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sci-biology/foldingathome/ChangeLog,v 1.10 2005/08/14 02:31:39 ribosome Exp $ +# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sci-biology/foldingathome/ChangeLog,v 1.11 2006/06/16 08:44:04 phosphan Exp $ + +*foldingathome-5.0.2-r5 (16 Jun 2006) + + 16 Jun 2006; Patrick Kursawe <phosphan@gentoo.org> +files/init-5.0.2-r5, + +foldingathome-5.0.2-r5.ebuild: + Adding --chdir to start-stop-daemon because of bug #109707 *foldingathome-5.0.2-r4 (14 Aug 2005) diff --git a/sci-biology/foldingathome/files/digest-foldingathome-5.0.2-r3 b/sci-biology/foldingathome/files/digest-foldingathome-5.0.2-r3 index 44de62a3f7fd..f8fd9750603a 100644 --- a/sci-biology/foldingathome/files/digest-foldingathome-5.0.2-r3 +++ b/sci-biology/foldingathome/files/digest-foldingathome-5.0.2-r3 @@ -1 +1,3 @@ MD5 4855e808fb94e6d2c5fde345aea0cdc3 FAH502-Linux.exe 249236 +RMD160 e63be66c70447095eb7054d855316f42e0364971 FAH502-Linux.exe 249236 +SHA256 02e2d3665a6e8f8fc89c7751b8faadff6885d34860643bdd4107d92825754d33 FAH502-Linux.exe 249236 diff --git a/sci-biology/foldingathome/files/digest-foldingathome-5.0.2-r4 b/sci-biology/foldingathome/files/digest-foldingathome-5.0.2-r4 index 44de62a3f7fd..f8fd9750603a 100644 --- a/sci-biology/foldingathome/files/digest-foldingathome-5.0.2-r4 +++ b/sci-biology/foldingathome/files/digest-foldingathome-5.0.2-r4 @@ -1 +1,3 @@ MD5 4855e808fb94e6d2c5fde345aea0cdc3 FAH502-Linux.exe 249236 +RMD160 e63be66c70447095eb7054d855316f42e0364971 FAH502-Linux.exe 249236 +SHA256 02e2d3665a6e8f8fc89c7751b8faadff6885d34860643bdd4107d92825754d33 FAH502-Linux.exe 249236 diff --git a/sci-biology/foldingathome/files/digest-foldingathome-5.0.2-r5 b/sci-biology/foldingathome/files/digest-foldingathome-5.0.2-r5 new file mode 100644 index 000000000000..f8fd9750603a --- /dev/null +++ b/sci-biology/foldingathome/files/digest-foldingathome-5.0.2-r5 @@ -0,0 +1,3 @@ +MD5 4855e808fb94e6d2c5fde345aea0cdc3 FAH502-Linux.exe 249236 +RMD160 e63be66c70447095eb7054d855316f42e0364971 FAH502-Linux.exe 249236 +SHA256 02e2d3665a6e8f8fc89c7751b8faadff6885d34860643bdd4107d92825754d33 FAH502-Linux.exe 249236 diff --git a/sci-biology/foldingathome/files/init-5.0.2-r5 b/sci-biology/foldingathome/files/init-5.0.2-r5 new file mode 100644 index 000000000000..87fe45d8279e --- /dev/null +++ b/sci-biology/foldingathome/files/init-5.0.2-r5 @@ -0,0 +1,59 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sci-biology/foldingathome/files/init-5.0.2-r5,v 1.1 2006/06/16 08:44:04 phosphan Exp $ + +opts="${opts} unitinfo" + +do_config() { + if [ -z "${CPU}" ] || [ "${CPU}" == "0" ]; then + if [ -r /proc/cpuinfo ]; then + CPU=`grep "^processor[[:space:]]*:" /proc/cpuinfo | wc -l` + if (( $CPU > 8 )); then + CPU=8 + fi + else + CPU=1 + fi + fi +} + +unitinfo() { + do_config + for (($CPU; CPU > 0; CPU--)); do + einfo "CPU ${CPU} $(head -n1 /opt/foldingathome/client${CPU}/unitinfo.txt):" + sed -e '1,2d' /opt/foldingathome/client${CPU}/unitinfo.txt + done +} + +start() { + do_config + su foldingathome -c /opt/foldingathome/copy_client_config + for (($CPU; CPU > 0; CPU--)); do + ebegin "Starting Folding@Home on CPU ${CPU}" + cd /opt/foldingathome/client${CPU}/ + start-stop-daemon --chdir ${PWD} --chuid foldingathome --nicelevel 19 --start --background --exec ./foldingathome -- ${FOLD_OPTS} + eend $? + done +} + +stop() { + do_config + for (($CPU; CPU > 0; CPU--)); do + ebegin "Stopping Folding@Home on CPU ${CPU}" + start-stop-daemon --stop --user foldingathome --exec /opt/foldingathome/client${CPU}/foldingathome + cd /opt/foldingathome/client${CPU}/ + for I in FahCore*.exe; do + if ps ax|grep $I > /dev/null 2>&1; then + killall -q $I > /dev/null 2>&1 + fi + done + sleep 1 + if ps ax|grep '[/]opt[/]foldingathome/client${CPU}/' > /dev/null 2>&1; then + eend 1 + else + eend 0 + fi + done +} + diff --git a/sci-biology/foldingathome/foldingathome-5.0.2-r5.ebuild b/sci-biology/foldingathome/foldingathome-5.0.2-r5.ebuild new file mode 100644 index 000000000000..b58c10821dee --- /dev/null +++ b/sci-biology/foldingathome/foldingathome-5.0.2-r5.ebuild @@ -0,0 +1,79 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sci-biology/foldingathome/foldingathome-5.0.2-r5.ebuild,v 1.1 2006/06/16 08:44:04 phosphan Exp $ + +# no version number on this install dir since upgrades will be using same dir +# (data will be stored here too) +I="/opt/foldingathome" + +inherit eutils + +DESCRIPTION="Help simulate protein folding at home" +HOMEPAGE="http://folding.stanford.edu/" +SRC_URI="http://www.stanford.edu/group/pandegroup/release/FAH502-Linux.exe" +RESTRICT="nomirror nostrip" + +SLOT="0" +IUSE="" +LICENSE="folding-at-home" +KEYWORDS="~x86 ~amd64" + +DEPEND=">=sys-apps/baselayout-1.8.0 + >=sys-libs/glibc-2.3.0 + amd64? ( app-emulation/emul-linux-x86-baselibs )" + +S="${WORKDIR}" + +src_unpack() { + cp "${DISTDIR}/${A}" ${PN} +} + +src_install() { + exeinto ${I} + newexe ${FILESDIR}/initfolding-r2 initfolding + newexe ${FILESDIR}/copy_client_config-${PV}-r1 copy_client_config + + # Clients + exeinto ${I}/client1 + doexe foldingathome + exeinto ${I}/client2 + doexe foldingathome + exeinto ${I}/client3 + doexe foldingathome + exeinto ${I}/client4 + doexe foldingathome + exeinto ${I}/client5 + doexe foldingathome + exeinto ${I}/client6 + doexe foldingathome + exeinto ${I}/client7 + doexe foldingathome + exeinto ${I}/client8 + doexe foldingathome + exeinto /etc/init.d + newexe ${FILESDIR}/init-${PVR} foldingathome + + insinto /etc/conf.d + newins ${FILESDIR}/folding-conf.d-r1 foldingathome +} + +pkg_preinst() { + # the bash shell is important for "su -c" in init script + enewuser foldingathome -1 /bin/bash /opt/foldingathome +} + +pkg_postinst() { + chown -R foldingathome:nogroup /opt/foldingathome + einfo "To run Folding@home in the background at boot:" + einfo " rc-update add foldingathome default" + einfo "" + einfo "Please run ${I}/initfolding to configure your client" + einfo "and edit /etc/conf.d/foldingathome for options" + einfo "" +} + +pkg_postrm() { + einfo "Folding@home data files were not removed." + einfo " Remove them manually from ${I}" + einfo "" +} |