summaryrefslogtreecommitdiffstats
path: root/abs/extra/foldingathome
diff options
context:
space:
mode:
Diffstat (limited to 'abs/extra/foldingathome')
-rw-r--r--abs/extra/foldingathome/PKGBUILD28
-rw-r--r--abs/extra/foldingathome/foldingathome.install47
-rw-r--r--abs/extra/foldingathome/run26
3 files changed, 101 insertions, 0 deletions
diff --git a/abs/extra/foldingathome/PKGBUILD b/abs/extra/foldingathome/PKGBUILD
new file mode 100644
index 0000000..c78cb93
--- /dev/null
+++ b/abs/extra/foldingathome/PKGBUILD
@@ -0,0 +1,28 @@
+# Contributor: Jason Taylor <jftaylor21@gmail.com>
+# Contributor: seratne
+# Contributor: Nick B <Shirakawasuna at gmail _dot_com>
+
+pkgname=foldingathome
+pkgver=6.02
+pkgrel=7
+pkgdesc="Folding@Home is a distributed computing project which studies protein folding, misfolding, aggregation, and related diseases."
+arch=('i686' 'x86_64')
+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)
+
+build() {
+ cd $startdir/src/
+
+ tar zxf FAH${pkgver}-Linux.tgz
+
+ # 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
+}
+md5sums=('112b3d66909050f1bb990993a1464cb9'
+ 'cefaf5ba2f3e2fe81533b5ee4795dc78')
diff --git a/abs/extra/foldingathome/foldingathome.install b/abs/extra/foldingathome/foldingathome.install
new file mode 100644
index 0000000..20e48d1
--- /dev/null
+++ b/abs/extra/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/foldingathome/run b/abs/extra/foldingathome/run
new file mode 100644
index 0000000..cd4a072
--- /dev/null
+++ b/abs/extra/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 &> /dev/null < /dev/null
+fi