diff options
author | Dennis Stengele | 2022-02-10 20:26:43 +0100 |
---|---|---|
committer | Dennis Stengele | 2022-02-10 20:26:43 +0100 |
commit | 0684ff243032c615cfeaad17e7a4c88d28d9291d (patch) | |
tree | de203a72b84f37252718d994e0d66967e8ccafa3 | |
parent | 0de4666920fa7d19fde23333d6c1b0ed6863ea50 (diff) | |
download | aur-0684ff243032c615cfeaad17e7a4c88d28d9291d.tar.gz |
Update to 5.1.0 and fix systemd unit logic.
This now runs as _tuptime user as it does not need root.
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 17 | ||||
-rw-r--r-- | tuptime.install | 20 |
3 files changed, 27 insertions, 16 deletions
@@ -1,13 +1,13 @@ pkgbase = tuptime pkgdesc = Report the historical and statistical running time of system - pkgver = 5.0.2 + pkgver = 5.1.0 pkgrel = 1 url = https://github.com/rfrail3/tuptime install = tuptime.install arch = any license = GPL depends = python - source = tuptime-5.0.2.tar.gz::https://github.com/rfrail3/tuptime/archive/5.0.2.tar.gz - sha256sums = b7b5a47fd0935b03d2768beaf4542c9512b389c844c0a78795bcba38978099f2 + source = tuptime-5.1.0.tar.gz::https://github.com/rfrail3/tuptime/archive/5.1.0.tar.gz + sha256sums = 8aa5adddba6ee8e1c70819b45de49637e20083bac92b608590bd71d2b7f7973c pkgname = tuptime @@ -1,6 +1,6 @@ # Maintainer: Dennis Stengele <d.stengele (at) derintendant (dot) de> pkgname=tuptime -pkgver=5.0.2 +pkgver=5.1.0 pkgrel=1 pkgdesc="Report the historical and statistical running time of system" arch=('any') @@ -11,21 +11,18 @@ depends=( ) install=tuptime.install source=("$pkgname-$pkgver.tar.gz::https://github.com/rfrail3/tuptime/archive/${pkgver}.tar.gz") -sha256sums=('b7b5a47fd0935b03d2768beaf4542c9512b389c844c0a78795bcba38978099f2') - -prepare() { - cd "$srcdir/$pkgname-${pkgver}" - sed -i '/User=tuptime/d' "src/systemd/tuptime.service" - sed -i '/User=tuptime/d' "src/systemd/tuptime-cron.service" -} +sha256sums=('8aa5adddba6ee8e1c70819b45de49637e20083bac92b608590bd71d2b7f7973c') package() { cd "$srcdir/$pkgname-${pkgver}" + install -D -m755 "src/tuptime" "$pkgdir/usr/bin/tuptime" install -D -m644 "src/systemd/tuptime.service" "$pkgdir/usr/lib/systemd/system/tuptime.service" install -D -m644 "src/systemd/tuptime-cron.service" "$pkgdir/usr/lib/systemd/system/tuptime-cron.service" install -D -m644 "src/systemd/tuptime-cron.timer" "$pkgdir/usr/lib/systemd/system/tuptime-cron.timer" install -d -m755 "$pkgdir/usr/lib/systemd/system/timers.target.wants" - ln -s "../tuptime.timer" "$pkgdir/usr/lib/systemd/system/timers.target.wants/tuptime.timer" - ln -s "../tuptime-cron.timer" "$pkgdir/usr/lib/systemd/system/timers.target.wants/tuptime-cron.timer" + install -d -m755 "$pkgdir/usr/lib/systemd/system/multi-user.target.wants" + + ln -s "$pkgdir/usr/lib/systemd/system/tuptime.service" "$pkgdir/usr/lib/systemd/system/multi-user.target.wants/tuptime.service" + ln -s "$pkgdir/usr/lib/systemd/system/tuptime-cron.timer" "$pkgdir/usr/lib/systemd/system/timers.target.wants/tuptime-cron.timer" } diff --git a/tuptime.install b/tuptime.install index 322af1692d18..0c579a27ba49 100644 --- a/tuptime.install +++ b/tuptime.install @@ -1,7 +1,21 @@ post_install() { + if [ -d /var/lib/tuptime ]; then + chown --recursive _tuptime: /var/lib/tuptime + fi + echo "" - echo "tuptime has been installed and the corresponding .timer unit" - echo "has been enabled. To start tuptime now, run" - echo " # systemctl start tuptime.timer" + echo "tuptime has been installed and the required units" + echo "have been enabled. To start tuptime now, run" + echo " # systemctl start tuptime-cron.timer" + echo " # systemctl start tuptime.service" echo "" } + +post_upgrade() { + if id tuptime > /dev/null 2>&1; then + usermod --login _tuptime tuptime + echo "" + echo "User tuptime has been renamed to _tuptime" + echo "" + fi +} |