[arch-commits] Commit in p11-kit/trunk (PKGBUILD p11-kit.install)

Jan Steffens heftig at archlinux.org
Sat May 2 12:25:22 UTC 2020


    Date: Saturday, May 2, 2020 @ 12:25:21
  Author: heftig
Revision: 382144

0.23.20-5: FS#66276 replace use of systemctl

Modified:
  p11-kit/trunk/PKGBUILD
  p11-kit/trunk/p11-kit.install

-----------------+
 PKGBUILD        |    4 ++--
 p11-kit.install |   25 +++++++++++++++++--------
 2 files changed, 19 insertions(+), 10 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-05-02 11:20:18 UTC (rev 382143)
+++ PKGBUILD	2020-05-02 12:25:21 UTC (rev 382144)
@@ -4,7 +4,7 @@
 pkgbase=p11-kit
 pkgname=(p11-kit libp11-kit)
 pkgver=0.23.20
-pkgrel=4
+pkgrel=5
 pkgdesc="Loads and enumerates PKCS#11 modules"
 url="https://p11-glue.freedesktop.org"
 arch=(x86_64)
@@ -43,7 +43,7 @@
 }
 
 package_p11-kit() {
-  depends=("libp11-kit=$pkgver-$pkgrel" systemd libp11-kit.so libsystemd.so)
+  depends=("libp11-kit=$pkgver-$pkgrel" coreutils libp11-kit.so libsystemd.so)
   install=p11-kit.install
 
   DESTDIR="$pkgdir" meson install -C build

Modified: p11-kit.install
===================================================================
--- p11-kit.install	2020-05-02 11:20:18 UTC (rev 382143)
+++ p11-kit.install	2020-05-02 12:25:21 UTC (rev 382144)
@@ -1,14 +1,23 @@
+_global_units() {
+    local unit=p11-kit-server.socket dir=/etc/systemd/user/sockets.target.wants
+
+    case $1 in
+        enable)
+            mkdir -p $dir
+            ln -sf /usr/lib/systemd/user/$unit $dir/$unit
+            ;;
+        disable)
+            rm -f $dir/$unit
+            rmdir -p --ignore-fail-on-non-empty $dir
+            ;;
+    esac
+}
+
 post_install() {
   # Enable socket by default
-  systemctl --global enable p11-kit-server.socket
+  _global_units enable
 }
 
-post_upgrade() {
-  if (( $(vercmp $2 0.23.13-1) < 0)); then
-    systemctl --global enable p11-kit-server.socket
-  fi
-}
-
 pre_remove() {
-  systemctl --global disable p11-kit-server.socket
+  _global_units disable
 }



More information about the arch-commits mailing list