[neon/kde/powerdevil/Neon/stable] debian: Revert "no longer uses setcap but "AmbientCapabilities in systemd unit," instead"

Carlos De Maine null at kde.org
Fri May 23 11:45:00 BST 2025


Git commit 315c68d35d0fb769da6fbff3b433fd2f152ebd6d by Carlos De Maine.
Committed on 23/05/2025 at 10:44.
Pushed by carlosdem into branch 'Neon/stable'.

Revert "no longer uses setcap but "AmbientCapabilities in systemd unit," instead"

This reverts commit 3835690acb439f0b9baaf18153288ae813cada7d

M  +1    -0    debian/control
A  +19   -0    debian/powerdevil.postinst.in
A  +5    -0    debian/setcap.yaml

https://invent.kde.org/neon/kde/powerdevil/-/commit/315c68d35d0fb769da6fbff3b433fd2f152ebd6d

diff --git a/debian/control b/debian/control
index 3c67177..e693f56 100644
--- a/debian/control
+++ b/debian/control
@@ -27,6 +27,7 @@ Build-Depends: cmake,
                kf6-krunner-dev,
                kf6-solid-dev,
                kwayland-dev,
+               libcap-dev,
                libddcutil-dev,
                libkf6screen-dev,
                liblayershellqtinterface-dev,
diff --git a/debian/powerdevil.postinst.in b/debian/powerdevil.postinst.in
new file mode 100644
index 0000000..04874b1
--- /dev/null
+++ b/debian/powerdevil.postinst.in
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = configure ]; then
+    # Set the capabilities
+    if command -v setcap > /dev/null && \
+       setcap "CAP_SYS_RESOURCE=+ep" \
+            "/usr/lib/#DEB_HOST_MULTIARCH#/libexec/org_kde_powerdevil"; then
+        echo "Sucessfully set capabilities for start_kdeinit"
+    else
+        echo "Failed to set capabilities for start_kdeinit" >&2
+    fi
+fi
+
+#DEBHELPER#
+
+exit 0
+
diff --git a/debian/setcap.yaml b/debian/setcap.yaml
new file mode 100644
index 0000000..0d6789d
--- /dev/null
+++ b/debian/setcap.yaml
@@ -0,0 +1,5 @@
+# Whitelisted arguments to setcap.
+# Being whitelisted means they will pass the build without problems.
+# A whitelisted call needs to have a corresponding setcap/setuid call in
+# postinst so it actually gets applied.
+- ["CAP_WAKE_ALARM=+ep", "*/usr/lib/*/libexec/org_kde_powerdevil"]


More information about the Neon-commits mailing list