diff options
Diffstat (limited to 'academic/boinc')
-rw-r--r-- | academic/boinc/README | 14 | ||||
-rw-r--r-- | academic/boinc/README.Slackware | 34 | ||||
-rw-r--r-- | academic/boinc/boinc.SlackBuild | 32 | ||||
-rw-r--r-- | academic/boinc/boinc.info | 8 | ||||
-rw-r--r-- | academic/boinc/boincgui.sh | 2 | ||||
-rw-r--r-- | academic/boinc/doinst.sh | 26 | ||||
-rw-r--r-- | academic/boinc/rc.boinc.txt | 105 |
7 files changed, 197 insertions, 24 deletions
diff --git a/academic/boinc/README b/academic/boinc/README index 35ab04a75a..f63d0e2e4c 100644 --- a/academic/boinc/README +++ b/academic/boinc/README @@ -14,21 +14,19 @@ types of scientific research. It's safe, secure, and easy. Building -(1) BOINC needs a static library for wxGTK3, compile with - - STATIC=yes ./wxGTK3.SlackBuild - -(2) Edit DATADIR in the script or run +(1) Edit DATADIR in the script or run DATADIR="/home/<user>/.boinc_data" ./boinc.SlackBuild -to set the data directory in your user's home and build the package. +to set the data directory in your user's home, or prefered data path, +and build the package. The default data path is /var/lib/boinc_data. -(3) If you do not wish to build the boincmgr GUI, +(2) If you do not wish to build the boincmgr GUI, BOINCMGR=no ./boinc.SlackBuild -then you do not need to install the dependencies (wxGTK3). +then you do not need to install the dependencies (wxWidgets). See +README.Slackware for details on headless configuration. After installation you need to join a BOINC project: http://boinc.berkeley.edu/projects.php diff --git a/academic/boinc/README.Slackware b/academic/boinc/README.Slackware new file mode 100644 index 0000000000..c0f1ceb4e3 --- /dev/null +++ b/academic/boinc/README.Slackware @@ -0,0 +1,34 @@ +For headless operation, a start up script is included. The script will +execute as root with the data directory as '/var/lib/boinc_data'. +Modify as needed: + +BOINC_DIR=/var/lib/boinc_data # directory of boinc data files +BOINC_USER=root # user that will run boinc process +BOINC_OPTIONS="--dir $BOINC_DIR --redirectio" + +Refer to the boinc manpage for parameters you can add to +BOINC_OPTIONS. + +To run boinc on boot, add the following code to /etc/rc.d/rc.local: + +if [ -x /etc/rc.d/rc.boinc ]; then + /etc/rc.d/rc.boinc start +fi + +and to /etc/rc.d/rc.local_shutdown + +if [ -x /etc/rc.d/rc.boinc ]; then + /etc/rc.d/rc.boinc stop +fi + +Note 1: +The default configuration enables boinc control on the running +host via boinccmg or boincmgr on the same running host. To truly run +headless, you will need to configure boinc to allow RPC access from +another host. + +Note 2: +If you use the default data path of /var/lib/boinc_data as a non-root +user, before first use, you will need to create that path and set the +appropriate user permissions. + diff --git a/academic/boinc/boinc.SlackBuild b/academic/boinc/boinc.SlackBuild index 83ffac3f80..8f8330ac87 100644 --- a/academic/boinc/boinc.SlackBuild +++ b/academic/boinc/boinc.SlackBuild @@ -2,7 +2,7 @@ # Slackware build script for boinc -# Copyright 2013-2018 Edward Koenig, Vancouver, WA, USA <kingbeowulf@gmail.com> +# Copyright 2013-2022 Edward Koenig, Vancouver, WA, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -22,17 +22,19 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -# TODO: add rc.boinc. +# 08DEC2022: +# Version update +# switched to wxWidgets-3.2 +# Bypass wxconfig symlink for compatibility. cd $(dirname $0) ; CWD=$(pwd) PRGNAM=boinc -VERSION=${VERSION:-7.16.16} -BRANCH=${BRANCH:-7.16} +VERSION=${VERSION:-7.24.1} +BRANCH=${BRANCH:-7.24} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} -NUMJOBS=${NUMJOBS:-1} if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -42,9 +44,6 @@ if [ -z "$ARCH" ]; then esac fi -# If the variable PRINT_PACKAGE_NAME is set, then this script will report what -# the name of the created package would be, and then exit. This information -# could be useful to other scripts. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -71,7 +70,7 @@ fi set -e # Your default working directory location. Pass with DATADIR=<dir> Boinc.SlackBuild -DATADIR=${DATADIR:-'$HOME/.boinc_data'} +DATADIR=${DATADIR:-'/var/lib/boinc_data'} BOINCMGR=${BOINCMGR:-yes} if [ "$BOINCMGR" = "yes" ]; then @@ -108,9 +107,10 @@ CXXFLAGS="$SLKCFLAGS" \ --disable-shared \ $do_mgr \ --with-x \ + --with-wx-config=/usr/lib$LIBDIRSUFFIX/wx/config/gtk3-unicode-3.2 \ --build=$ARCH-slackware-linux -make -j${NUMJOBS} +make make install DESTDIR=$PKG find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ @@ -122,15 +122,25 @@ for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; r cat $CWD/boincgui.sh > $PKG/usr/bin/boincgui.sh sed -i "s|WORKDIR|$DATADIR|g" $PKG/usr/bin/boincgui.sh chmod +x $PKG/usr/bin/boincgui.sh +mkdir -p $PKG/etc/rc.d +cat $CWD/rc.boinc.txt > $PKG/etc/rc.d/rc.boinc.new mkdir -p $PKG/usr/share/{applications,pixmaps} cp $CWD/boinc.desktop $PKG/usr/share/applications cp $CWD/boinc.png $PKG/usr/share/pixmaps mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a COPYING COPYING.LESSER COPYRIGHT INSTALL todo notes $PKG/usr/doc/$PRGNAM-$VERSION +cp -a COPYING COPYING.LESSER COPYRIGHT INSTALL notes $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +rm -f $PKG/usr/lib*/*.la + +# remove unneeded init script, systemd service +rm -rf $PKG/etc/default +rm -rf $PKG/etc/init.d +rm -rf $PKG/usr/lib +rm -f $PKG/usr/bin/boinc_client + mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh diff --git a/academic/boinc/boinc.info b/academic/boinc/boinc.info index f8f8fc215e..4d1bb74cdd 100644 --- a/academic/boinc/boinc.info +++ b/academic/boinc/boinc.info @@ -1,10 +1,10 @@ PRGNAM="boinc" -VERSION="7.16.16" +VERSION="7.24.1" HOMEPAGE="https://boinc.berkeley.edu/" -DOWNLOAD="https://github.com/BOINC/boinc/archive/client_release/7.16/7.16.16/boinc-client_release-7.16-7.16.16.tar.gz" -MD5SUM="debf658ed8748c1c434c12f8a8a932a1" +DOWNLOAD="https://github.com/BOINC/boinc/archive/client_release/7.24/7.24.1/boinc-client_release-7.24-7.24.1.tar.gz" +MD5SUM="1844352e5b2ef9c9cf2325e1f991a5cc" DOWNLOAD_x86_64="" MD5SUM_x86_64="" -REQUIRES="wxGTK3" +REQUIRES="wxWidgets" MAINTAINER="Edward W. Koenig" EMAIL="kingbeowulf@linuxgalaxy.org" diff --git a/academic/boinc/boincgui.sh b/academic/boinc/boincgui.sh index 435bb29e63..5251e68d78 100644 --- a/academic/boinc/boincgui.sh +++ b/academic/boinc/boincgui.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright 2013-2014 Edward Koenig, Vancouver, WA, USA <kingbeowulf@gmail.com> +# Copyright 2013-2014 Edward W. Koenig, Vancouver, WA, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is diff --git a/academic/boinc/doinst.sh b/academic/boinc/doinst.sh index 5fb28930db..9634ecf6f7 100644 --- a/academic/boinc/doinst.sh +++ b/academic/boinc/doinst.sh @@ -1,3 +1,29 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +preserve_perms() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ -e $OLD ]; then + cp -a $OLD ${NEW}.incoming + cat $NEW > ${NEW}.incoming + mv ${NEW}.incoming $NEW + fi + config $NEW +} + +preserve_perms etc/rc.d/rc.boinc.new + if [ -x /usr/bin/update-desktop-database ]; then /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 fi diff --git a/academic/boinc/rc.boinc.txt b/academic/boinc/rc.boinc.txt new file mode 100644 index 0000000000..e84583ed0b --- /dev/null +++ b/academic/boinc/rc.boinc.txt @@ -0,0 +1,105 @@ +#!/bin/bash + +# rc.boinc - BOINC startup/control script for Slackware Linux +# +# Copyright 2022 Edward Koenig, Vancouver, WA, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +BOINC_DIR=//var/lib/boinc_data # directory of boinc files +BOINC_BIN=/usr/bin/boinc # name of the boinc binary +BOINC_USER=root # user that will run boinc process +BOINC_OPTIONS="--dir $BOINC_DIR --redirectio" +# "--dir $BOINC_DIR --daemon" will send logs syslog instead of +# stdoutdae.txt and stderrdae.txt + +boinc_status() { + if ( ps -ef | grep "$BOINC_BIN$" > /dev/null 2>&1 ); then + return 0 + else + return 3 +fi +} + +boinc_start() { + boinc_status + if [ $? = 0 ]; then + echo "BOINC is already running" + exit 1 + fi + + if [ ! -d $BOINC_DIR ]; then + echo "ERROR: $BOINC_DIR does not exist" + exit 1 + elif [ ! -x $BOINC_BIN ]; then + echo "ERROR: $BOINC_BIN does not exist or not executable" + exit 1 + fi + + echo "Starting BOINC client" + su - $BOINC_USER -c "cd $BOINC_DIR; exec $BOINC_BIN $BOINC_OPTIONS" & + +} + +boinc_stop() { + echo "Stopping BOINC client" + killall $BOINC_BIN +} + +boinc_restart() { + echo "Restarting BOINC client" + + boinc_status + if [ $? = 0 ]; then + boinc_stop + sleep 3 + boinc_start + else + boinc_start +fi +} + + +case "$1" in + start) + boinc_start + exit 0 + ;; + stop) + boinc_stop + exit 0 + ;; + restart) + boinc_restart + exit 0 + ;; + status) + boinc_status + if [ $? = 0 ]; then + echo "BOINC is running" + else + echo "BOINC is not running" + fi + ;; + *) + echo "Usage: $0 start|stop|restart|status" + exit 1 + ;; + +esac |