From a56552217f33d3ce4d72d65ca19056d45858a4ee Mon Sep 17 00:00:00 2001 From: Greg Frost Date: Sun, 30 Aug 2009 10:29:53 +0900 Subject: LinHES-config mythinstall foldingathome: initial inclusion of Folding@home --- abs/core-testing/LinHES-config/PKGBUILD | 2 +- abs/core-testing/LinHES-config/mv_software.py | 6 +- abs/core-testing/mythinstall/PKGBUILD | 3 +- abs/core-testing/mythinstall/installsettings.cpp | 72 +++++++++++++- abs/core-testing/mythinstall/installsettings.h | 3 + abs/core-testing/mythinstall/xorgsettings.h | 3 +- abs/extra-testing/community/foldingathome/PKGBUILD | 16 ++- .../foldingathome/archpatch_foldingathome.diff | 110 --------------------- .../community/foldingathome/foldingathome.install | 56 +++++++---- 9 files changed, 119 insertions(+), 152 deletions(-) delete mode 100644 abs/extra-testing/community/foldingathome/archpatch_foldingathome.diff mode change 100755 => 100644 abs/extra-testing/community/foldingathome/foldingathome.install diff --git a/abs/core-testing/LinHES-config/PKGBUILD b/abs/core-testing/LinHES-config/PKGBUILD index cbe41ab..de4e94b 100644 --- a/abs/core-testing/LinHES-config/PKGBUILD +++ b/abs/core-testing/LinHES-config/PKGBUILD @@ -1,6 +1,6 @@ pkgname=LinHES-config pkgver=2.0 -pkgrel=89 +pkgrel=90 conflicts=(MythVantage-config MythVantage-config-dev LinHES-config-dev ) pkgdesc="Install and configure your system" depends=(bc libstatgrab mysql-python expect curl dnsutils parted diff --git a/abs/core-testing/LinHES-config/mv_software.py b/abs/core-testing/LinHES-config/mv_software.py index 7421e08..0a96bb3 100755 --- a/abs/core-testing/LinHES-config/mv_software.py +++ b/abs/core-testing/LinHES-config/mv_software.py @@ -19,7 +19,7 @@ def setup_software(systemconfig, data_config): default_installed=("mythcontrols", "mythgallery", "mythmovies", "mythmusic", "mythsmolt", "mythvideo") - other_pkg=("miro", "xe", "romdb", "xine", "dvdcss", "webmin" , "fuppes", "mythappletrailers", "mythstream", "mythvodka") + other_pkg=("miro", "xe", "romdb", "xine", "dvdcss", "webmin" , "fuppes", "foldingathome", "mythappletrailers", "mythstream", "mythvodka") else: default_disabled = ("mythphone", "mytharchive", "mythbrowser", "mythnews", "mythgame", "mythflix", "mythweather", @@ -27,7 +27,7 @@ def setup_software(systemconfig, data_config): default_installed=("mythcontrols", "mythgallery", "mythmovies", "mythmusic", "mythsmolt", "mythvideo") - other_pkg=("miro", "xe", "romdb", "xine", "dvdcss", "webmin" , "fuppes") + other_pkg=("miro", "xe", "romdb", "xine", "dvdcss", "webmin" , "fuppes", "foldingathome") for pkg in default_disabled: pkgname=pkg+postfix @@ -56,4 +56,4 @@ def setup_software(systemconfig, data_config): mv_common.pacremove(pkg) except: logging.debug(" ERROR-- %s is not defined", pkg) - logging.info("__End Software\n ") \ No newline at end of file + logging.info("__End Software\n ") diff --git a/abs/core-testing/mythinstall/PKGBUILD b/abs/core-testing/mythinstall/PKGBUILD index 75654f1..c614fac 100644 --- a/abs/core-testing/mythinstall/PKGBUILD +++ b/abs/core-testing/mythinstall/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Jams pkgname=mythinstall pkgver=1 -pkgrel=9 +pkgrel=10 pkgdesc="LinHES installer/systemconfig GUI." arch=i686 depends=() @@ -47,4 +47,3 @@ build() { ln -s MythVantage mythinstall cd - } - diff --git a/abs/core-testing/mythinstall/installsettings.cpp b/abs/core-testing/mythinstall/installsettings.cpp index 7315464..3942460 100755 --- a/abs/core-testing/mythinstall/installsettings.cpp +++ b/abs/core-testing/mythinstall/installsettings.cpp @@ -1277,6 +1277,62 @@ static HostCheckBox *Hostfuppes() return gc; }; +static HostCheckBox *Hostfoldingathome() +{ + HostCheckBox *gc = new HostCheckBox("Hostfoldingathome"); + gc->setLabel(QObject::tr("Folding@home")); + gc->setValue(false); + gc->setHelpText(QObject::tr("A distributed computing project which studies protein folding, misfolding, aggregation, and related diseases.")); + return gc; +}; + +static HostComboBox *Hostfoldingusername() +{ + // If there is an old R5.5 style folding directory /myth/folding@home, attempt + // to retrieve the old username. + + FILE *username_pipe; + username_pipe = + popen ( + "grep username= /myth/folding@home/client.cfg 2> /dev/null | " + "sed 's/username=//g'", "r"); + + if (username_pipe) + { + char username[200]; + if (fgets (username, sizeof (username), username_pipe)) + { + char *new_line; + username[sizeof(username)-1]=0; + if ((new_line = strchr (username, '\n'))) + new_line[0] = 0; + + cout << "found old username " << username << endl; + + gContext->SetSetting("Hostfoldingusername", username); + gContext->SaveSetting("Hostfoldingusername", username); + } + pclose (username_pipe); + } + + HostComboBox *gc = new HostComboBox("Hostfoldingusername",true); + gc->setLabel(QObject::tr("Folding Username")); + gc->setValue(""); + + gc->setHelpText(QObject::tr("The username associated to the work-units you return.")); + return gc; +}; + +static HostComboBox *Hostfoldingworksize() +{ + HostComboBox *gc = new HostComboBox("Hostfoldingworksize"); + gc->setLabel(QObject::tr("Work Packet Size")); + gc->addSelection("Big", "big"); + gc->addSelection("Normal", "normal"); + gc->addSelection("Small", "small"); + gc->setHelpText(QObject::tr("Acceptable size of work assignment and work result packets (bigger units may have large memory demands).")); + return gc; +}; static HostCheckBox *HostXscreensaver() { @@ -3880,6 +3936,9 @@ void writesettings () hostparm.ThisHostXine = gContext->GetSetting("HostXine"); hostparm.ThisHostwebmin = gContext->GetSetting("Hostwebmin"); hostparm.ThisHostfuppes = gContext->GetSetting("Hostfuppes"); + hostparm.ThisHostfoldingathome = gContext->GetSetting("Hostfoldingathome"); + hostparm.ThisHostfoldingusername = gContext->GetSetting("Hostfoldingusername"); + hostparm.ThisHostfoldingworksize = gContext->GetSetting("Hostfoldingworksize"); hostparm.ThisHostDDnslogin = gContext->GetSetting("HostDDnslogin"); hostparm.ThisHostDDnspassword = gContext->GetSetting("HostDDnspassword"); hostparm.ThisHostDDnshostname = gContext->GetSetting("HostDDnshostname"); @@ -4124,7 +4183,9 @@ void writesettings () myfile << "xine=\"" + hostparm.ThisHostXine + "\"\n"; myfile << "webmin=\"" + hostparm.ThisHostwebmin + "\"\n"; myfile << "fuppes=\"" + hostparm.ThisHostfuppes + "\"\n"; - + myfile << "foldingathome=\"" + hostparm.ThisHostfoldingathome + "\"\n"; + myfile << "foldingusername=\"" + hostparm.ThisHostfoldingusername + "\"\n"; + myfile << "foldingworksize=\"" + hostparm.ThisHostfoldingworksize + "\"\n"; @@ -4378,6 +4439,10 @@ MythInstallSettings::MythInstallSettings() ConfigurationGroup *GridShowPlugin5 = new GridConfigurationGroup(2); GridShowPlugin5->addChild(Hostfuppes()); + ConfigurationGroup *GridShowPlugin6 = new VerticalConfigurationGroup(true,true); + GridShowPlugin6->addChild(Hostfoldingathome()); + GridShowPlugin6->addChild(Hostfoldingusername()); + GridShowPlugin6->addChild(Hostfoldingworksize()); ConfigurationGroup *Mythvideoplugin = new HorizontalConfigurationGroup(); Mythvideoplugin->addChild(Hostpluginmythvideo()); @@ -4395,6 +4460,7 @@ MythInstallSettings::MythInstallSettings() addChild(GridShowPlugin3); addChild(GridShowPlugin4); addChild(GridShowPlugin5); + addChild(GridShowPlugin6); } } if ( displayuser ) @@ -4475,7 +4541,3 @@ MythInstallSettings::MythInstallSettings() }; - - - - diff --git a/abs/core-testing/mythinstall/installsettings.h b/abs/core-testing/mythinstall/installsettings.h index 55203f0..c140f3d 100755 --- a/abs/core-testing/mythinstall/installsettings.h +++ b/abs/core-testing/mythinstall/installsettings.h @@ -455,6 +455,9 @@ struct HostParms QString ThisHostXine; QString ThisHostwebmin; QString ThisHostfuppes; + QString ThisHostfoldingathome; + QString ThisHostfoldingusername; + QString ThisHostfoldingworksize; QString ThisHostDDnslogin; QString ThisHostDDnspassword; diff --git a/abs/core-testing/mythinstall/xorgsettings.h b/abs/core-testing/mythinstall/xorgsettings.h index 4a4ed34..46c4952 100755 --- a/abs/core-testing/mythinstall/xorgsettings.h +++ b/abs/core-testing/mythinstall/xorgsettings.h @@ -152,7 +152,7 @@ static HostComboBox *HostXres() if (strcmp (previous_mode, separator) == 0) continue; - strncpy (previous_mode, separator, 200); + strncpy (previous_mode, separator, sizeof(previous_mode)); gc->addSelection(separator, line_in); found_modes_in_xorg_log = TRUE; @@ -161,6 +161,7 @@ static HostComboBox *HostXres() defaults_added[def]=1; } } + pclose (modelines); } } diff --git a/abs/extra-testing/community/foldingathome/PKGBUILD b/abs/extra-testing/community/foldingathome/PKGBUILD index 411702c..ffd256e 100644 --- a/abs/extra-testing/community/foldingathome/PKGBUILD +++ b/abs/extra-testing/community/foldingathome/PKGBUILD @@ -4,7 +4,7 @@ pkgname=foldingathome pkgver=6.02 -pkgrel=1 +pkgrel=2 pkgdesc="Folding@Home is a distributed computing project which studies protein folding, misfolding, aggregation, and related diseases." arch=('i686') url="http://folding.stanford.edu/" @@ -13,16 +13,14 @@ depends=('bash') backup=('etc/conf.d/foldingathome') install=foldingathome.install source=(http://www.stanford.edu/group/pandegroup/folding/release/FAH$pkgver-Linux.tgz - archpatch_foldingathome.diff) + run) md5sums=('112b3d66909050f1bb990993a1464cb9' - '02f4ca64d552b442d484c51fa5f4228a') + '7e1b3f2a6768b4fbeb415922a1a9c2e6') build() { cd $startdir/src/ - patch -p1 /opt/fah/$FAH_USER/myfah.log" & -+ else -+ cd /opt/fah -+ nice --adjustment 19 /opt/fah/fah6 -verbosity 9 > /opt/fah/myfah.log & -+ fi -+ fi -+ if [ ! -z "$PID" -o $? -gt 0 ]; then -+ stat_fail -+ else -+ add_daemon foldingathome -+ stat_done -+ fi -+ ;; -+ -+ stop) -+ stat_busy "Stopping Folding@Home" -+ [ ! -z "$PID" ]&& kill $PID &> /dev/null -+ if [ $? -gt 0 ]; then -+ stat_fail -+ else -+ rm_daemon foldingathome -+ stat_done -+ fi -+ ;; -+ -+ restart) -+ $0 stop -+ sleep 1 -+ $0 start -+ ;; -+ -+ *) -+ echo $"Usage: $0 {start|stop|restart}" -+esac -+ diff --git a/abs/extra-testing/community/foldingathome/foldingathome.install b/abs/extra-testing/community/foldingathome/foldingathome.install old mode 100755 new mode 100644 index 8eedb6c..3ecc7c9 --- a/abs/extra-testing/community/foldingathome/foldingathome.install +++ b/abs/extra-testing/community/foldingathome/foldingathome.install @@ -1,30 +1,44 @@ -# arg 1: the new package version post_install() { - cat << 'EOM' - --> Please cd to /opt/fah/ and execute ./fah6 -smp -configonly - --> to configure your settings. Then add "foldingathome" to the list - --> of daemons in /etc/rc.conf. If you would like to join the Arch - --> Linux team, use team number 45032. To check current progress, - --> point your browser to file://opt/fah/MyFolding.html + # Check for an R5.5 fah installation. + r5_fah_dir=/myth/folding@home + r6_fah_dir=/myth/folding_$(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 +EOM + else + mv $r5_fah_dir $r6_fah_dir + fi + else + if [ ! -d "$r6_fah_dir" ] ; then + mkdir $r6_fah_dir + cat > $r6_fah_dir/client.cfg << 'EOM' +[settings] +username=LinHES +team=50975 +passkey= +asknet=no +bigpackets=normal +machineid=1 - --> It is strongly recommended that you run foldingathome as a user other - --> than root. You can identify a user in /etc/conf.d/foldingathome. - --> A directory called /opt/fah/$FAH_USER will be created." +[http] +active=no +host=localhost +port=8080 EOM -} + fi + fi -# arg 1: the new package version -# arg 2: the old package version -post_upgrade() { - post_install $1 + /sbin/add_service.sh fah + sleep 5 + /sbin/sv -v start fah } -# arg 1: the old package version pre_remove() { - /bin/true + /sbin/sv stop fah + /sbin/remove_service.sh fah } -op=$1 -shift - -$op $* -- cgit v0.12