diff options
Diffstat (limited to 'abs/extra/community/foldingathome')
-rw-r--r-- | abs/extra/community/foldingathome/PKGBUILD | 26 | ||||
-rw-r--r-- | abs/extra/community/foldingathome/foldingathome.install | 47 | ||||
-rw-r--r-- | abs/extra/community/foldingathome/run | 26 |
3 files changed, 99 insertions, 0 deletions
diff --git a/abs/extra/community/foldingathome/PKGBUILD b/abs/extra/community/foldingathome/PKGBUILD new file mode 100644 index 0000000..bb93407 --- /dev/null +++ b/abs/extra/community/foldingathome/PKGBUILD @@ -0,0 +1,26 @@ +# Contributor: Jason Taylor <jftaylor21@gmail.com> +# Contributor: seratne +# Contributor: Nick B <Shirakawasuna at gmail _dot_com> + +pkgname=foldingathome +pkgver=6.02 +pkgrel=6 +pkgdesc="Folding@Home is a distributed computing project which studies protein folding, misfolding, aggregation, and related diseases." +arch=('i686') +url="http://folding.stanford.edu/" +license=('custom') +depends=('bash') +backup=('etc/conf.d/foldingathome') +install=foldingathome.install +source=(http://www.stanford.edu/group/pandegroup/folding/release/FAH$pkgver-Linux.tgz + run) +md5sums=('112b3d66909050f1bb990993a1464cb9' + '61eb4617e7363d586a05dde980ad1c14') + +build() { + cd $startdir/src/ + + # At this stage, the mpiexec is not included because it requires x86_64. + install -D -c -m755 fah6 $startdir/pkg/usr/bin/fah6 || return 1 + install -D -m755 run $startdir/pkg/etc/sv/fah/run +} diff --git a/abs/extra/community/foldingathome/foldingathome.install b/abs/extra/community/foldingathome/foldingathome.install new file mode 100644 index 0000000..20e48d1 --- /dev/null +++ b/abs/extra/community/foldingathome/foldingathome.install @@ -0,0 +1,47 @@ +post_install() { + # Check for an R5.5 fah installation. + r5_fah_dir=/myth/folding@home + r6_fah_dir=/myth/foldingathome/$(hostname) + if [ -d "$r5_fah_dir" ] ; then + if [ -d "$r6_fah_dir" ] ; then + cat << 'EOM' + --> You have an R5.5 and an R6 folding directory at the same time! + --> you should manually delete the R5.5 directory: + --> $r5_fah_dir + --> The directroy used on R6 will be: + --> $r6_fah_dir +EOM + else + mkdir -p /myth/foldingathome + mv $r5_fah_dir $r6_fah_dir + fi + else + if [ ! -d "$r6_fah_dir" ] ; then + mkdir -p $r6_fah_dir + cat > $r6_fah_dir/client.cfg << 'EOM' +[settings] +username=LinHES +team=50975 +passkey= +asknet=no +bigpackets=normal +machineid=1 + +[http] +active=no +host=localhost +port=8080 +EOM + fi + fi + rm -fr $r6_fah_dir/index.html + ln -s $r6_fah_dir/MyFolding.html $r6_fah_dir/index.html + ln -s $r6_fah_dir /data/srv/httpd/htdocs/foldingathome + /sbin/add_service.sh fah +} + +pre_remove() { + sv stop fah + /sbin/remove_service.sh fah +} + diff --git a/abs/extra/community/foldingathome/run b/abs/extra/community/foldingathome/run new file mode 100644 index 0000000..ede51f2 --- /dev/null +++ b/abs/extra/community/foldingathome/run @@ -0,0 +1,26 @@ +#!/bin/sh +export TERM=linux +. /etc/rc.conf +. /etc/rc.d/functions +stat_runit "Starting folding@home" + +FOLDING_DIR=/myth/foldingathome/$(hostname) + +if [ -d $FOLDING_DIR ] ; then + cd $FOLDING_DIR + # Ensure that the client configuration file has the same details as /etc/systemconfig + + source /etc/systemconfig + + if [ -n "$foldingusername" ] ; then + sed -i 's/username=.*$/username='$foldingusername'/g' $FOLDING_DIR/client.cfg + fi + + if [ -n "$foldingworksize" ] ; then + sed -i 's/bigpackets=.*$/bigpackets='$foldingworksize'/g' $FOLDING_DIR/client.cfg + fi + + # No need to direct output to a log file becase a log file + # will automatically be placed in $FOLDING_DIR + exec /usr/bin/fah6 -verbosity 9 &> /dev/null < /dev/null +fi |