diff options
author | Jonathan Kotta | 2018-09-21 16:41:29 -0500 |
---|---|---|
committer | Jonathan Kotta | 2018-09-21 16:41:29 -0500 |
commit | f020baf8faad46f4d0e09b1a94ead058457d6226 (patch) | |
tree | 62ae4e6628ad7fde07513f9cc073d091d03a5d1c | |
parent | 8503f39fc26b1dd9d40ec5212a2465db1910afcd (diff) | |
download | aur-f020baf8faad46f4d0e09b1a94ead058457d6226.tar.gz |
update to 7.5, use DynamicUser
DynamicUser systemd option creates a user on the fly
Should be backwards compatible with older versions where the fah user
is in /etc/passwd, though the fah-config script may need to be rerun.
-rw-r--r-- | .SRCINFO | 20 | ||||
-rw-r--r-- | PKGBUILD | 77 | ||||
-rwxr-xr-x | fah-config | 9 | ||||
-rw-r--r-- | foldingathome.install | 24 | ||||
-rw-r--r-- | foldingathome.service | 9 |
5 files changed, 55 insertions, 84 deletions
@@ -1,14 +1,12 @@ pkgbase = foldingathome-noroot pkgdesc = Folding@Home client that does not run as the root user. - pkgver = 7.4.4 - pkgrel = 3 - url = http://folding.stanford.edu/ + pkgver = 7.5.1 + pkgrel = 1 + url = http://foldingathome.org install = foldingathome.install - arch = i686 arch = x86_64 license = CUSTOM depends = zlib - depends = bzip2 depends = bash optdepends = opencl-nvidia: for folding with an nVidia GPU optdepends = cuda: for folding with an nVidia GPU @@ -21,13 +19,11 @@ pkgbase = foldingathome-noroot source = foldingathome.service source = fah-config source = foldingathome.install - md5sums = 40530df579e406fa29e6535adf2c0c22 - md5sums = bb0bca34f6f32c8bd46dfcdcd6abe1f6 - md5sums = 12accb9cd18aaa13d8b2f1ce6fa169d0 - source_i686 = https://fah.stanford.edu/file-releases/public/release/fahclient/debian-testing-32bit/v7.4/fahclient_7.4.4_i386.deb - md5sums_i686 = 4aedf35b0adaaa5c8f5e1ce48d591744 - source_x86_64 = https://fah.stanford.edu/file-releases/public/release/fahclient/debian-testing-64bit/v7.4/fahclient_7.4.4_amd64.deb - md5sums_x86_64 = 10ece2d4a6a4c6a82321683284837b28 + source = https://download.foldingathome.org/releases/public/release/fahclient/debian-stable-64bit/v7.5/fahclient_7.5.1-64bit-release.tar.bz2 + md5sums = b508338299defffcbf7d46a02e1e763a + md5sums = 0fd798148583d0840c664862116bd366 + md5sums = 22b156cdf21ccade658836193703b196 + md5sums = 5353688a1c5cb0a226ce8e24b8ecb771 pkgname = foldingathome-noroot @@ -2,62 +2,43 @@ # Contributor: jpkotta [at] gmail dot com pkgname=foldingathome-noroot -pkgver=7.4.4 -pkgrel=3 +pkgver=7.5.1 +pkgrel=1 pkgdesc="Folding@Home client that does not run as the root user." -arch=('i686' 'x86_64') -url="http://folding.stanford.edu/" +arch=('x86_64') +url="http://foldingathome.org" license=('CUSTOM') -depends=('zlib' 'bzip2' 'bash') +depends=('zlib' 'bash') optdepends=('opencl-nvidia: for folding with an nVidia GPU' - 'cuda: for folding with an nVidia GPU' - 'opencl-mesa: for folding with an older AMD GPU' - 'opencl-amd: for folding with a newer AMD GPU') + 'cuda: for folding with an nVidia GPU' + 'opencl-mesa: for folding with an older AMD GPU' + 'opencl-amd: for folding with a newer AMD GPU') replaces=('foldingathome-v7' 'foldingathome') conflicts=('foldingathome-v7' 'foldingathome') install=foldingathome.install -source=(foldingathome.service fah-config foldingathome.install) -source_i686=("https://fah.stanford.edu/file-releases/public/release/fahclient/debian-testing-32bit/v7.4/fahclient_7.4.4_i386.deb") -source_x86_64=("https://fah.stanford.edu/file-releases/public/release/fahclient/debian-testing-64bit/v7.4/fahclient_7.4.4_amd64.deb") -md5sums=('40530df579e406fa29e6535adf2c0c22' - 'bb0bca34f6f32c8bd46dfcdcd6abe1f6' - '12accb9cd18aaa13d8b2f1ce6fa169d0') -md5sums_i686=('4aedf35b0adaaa5c8f5e1ce48d591744') -md5sums_x86_64=('10ece2d4a6a4c6a82321683284837b28') - -prepare() { - cd ${srcdir} - tar xf data.tar.gz -} +_coarse_pkgver="${pkgver:0:3}" # 7.5.1 -> 7.5 +_tarball_name="fahclient_${pkgver}-64bit-release" +_url="https://download.foldingathome.org/releases/public/release/fahclient/debian-stable-64bit/v${_coarse_pkgver}/${_tarball_name}.tar.bz2" +source=(foldingathome.service fah-config foldingathome.install "${_url}") +md5sums=('b508338299defffcbf7d46a02e1e763a' + '0fd798148583d0840c664862116bd366' + '22b156cdf21ccade658836193703b196' + '5353688a1c5cb0a226ce8e24b8ecb771') package() { - cd ${srcdir} - installdir=${pkgdir}/opt/fah/ + cd "${srcdir}/${_tarball_name}" + installdir="${pkgdir}/opt/fah/" - install -D -m755 \ - fah-config \ - ${installdir}/fah-config - install -D -m755 \ - usr/bin/FAHClient \ - ${installdir}/FAHClient - install -D -m755 \ - usr/bin/FAHCoreWrapper \ - ${installdir}/FAHCoreWrapper - install -D -m755 \ - usr/share/doc/fahclient/sample-config.xml \ - ${installdir}/sample-config.xml - install -D -m644 \ - usr/share/doc/fahclient/copyright \ - ${pkgdir}/usr/share/licenses/${pkgname}/copyright - install -D -m644 \ - usr/share/doc/fahclient/README \ - ${installdir}/README - install -D -m644 \ - usr/share/doc/fahclient/changelog.gz \ - ${installdir}/changelog.gz - install -D -m644 \ - foldingathome.service \ - ${pkgdir}/usr/lib/systemd/system/foldingathome.service -} + install -D -m755 FAHClient "${installdir}"/FAHClient + install -D -m755 FAHCoreWrapper "${installdir}"/FAHCoreWrapper + install -D -m644 sample-config.xml "${installdir}"/sample-config.xml + install -D -m644 copyright "${pkgdir}"/usr/share/licenses/${pkgname}/copyright + install -D -m644 README.md "${installdir}"/README.md + install -D -m644 CHANGELOG.md "${installdir}"/CHANGELOG.md + cd "${srcdir}" + install -D -m755 fah-config "${installdir}"/fah-config + install -D -m644 foldingathome.service \ + "${pkgdir}"/usr/lib/systemd/system/foldingathome.service +} diff --git a/fah-config b/fah-config index e6275c6a2af6..de1cd167f6af 100755 --- a/fah-config +++ b/fah-config @@ -1,4 +1,9 @@ #!/bin/sh -cd /var/opt/fah/ -su fah -s /bin/sh -c "/opt/fah/FAHClient --configure" +exec systemd-run \ + --pty \ + --property=DynamicUser=yes \ + --property=User=fah \ + --property=StateDirectory=fah \ + --property=WorkingDirectory=/var/lib/fah \ + /opt/fah/FAHClient --configure diff --git a/foldingathome.install b/foldingathome.install index 24caba22c08f..20190ea972bc 100644 --- a/foldingathome.install +++ b/foldingathome.install @@ -1,24 +1,12 @@ post_install() { - getent group fah &>/dev/null \ - || groupadd -r fah >/dev/null - getent passwd fah &>/dev/null \ - || useradd -r -g fah -d /var/opt/fah --create-home -s /bin/false fah >/dev/null - chmod 755 /var/opt/fah - cat << 'EOM' - --> Please run /opt/fah/fah-config as root to configure your - --> settings. If you are using systemd, then run "systemctl enable - --> foldingathome.service" to enable the folding service. If you would - --> like join the Arch Linux team, use team number 45032. + --> Please run + --> /opt/fah/fah-config + --> as root to configure your settings. Then run + --> systemctl enable --now foldingathome.service + --> to enable the folding service. If you would like + --> to join the Arch Linux team, use team number 45032. EOM true } - -post_remove() { - getent passwd fah &>/dev/null \ - && userdel fah >/dev/null - getent group fah &>/dev/null \ - && groupdel fah >/dev/null - true -} diff --git a/foldingathome.service b/foldingathome.service index cac585399bc3..b814cef45c78 100644 --- a/foldingathome.service +++ b/foldingathome.service @@ -3,11 +3,12 @@ Description=Folding@home distributed computing client After=network.target [Service] -User=fah +DynamicUser=yes Type=simple -WorkingDirectory=/var/opt/fah -ExecStart=/opt/fah/FAHClient --config /var/opt/fah/config.xml --exec-directory=/opt/fah --data-directory=/var/opt/fah +User=fah +StateDirectory=fah +WorkingDirectory=/var/lib/fah +ExecStart=/opt/fah/FAHClient [Install] WantedBy=multi-user.target - |