From 9f3a37afca8a8a0e130bcb5137dc70a5f9e57846 Mon Sep 17 00:00:00 2001 From: Renaud Lepage Date: Fri, 13 Sep 2024 15:53:18 -0700 Subject: [PATCH] pkexec around sbctl for out-of-the-box sudo-only operation --- .github/build-nest-v3 | 2 +- debian/rules | 6 ++++++ debian/sbctl-pkexec | 3 +++ main.sh | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) create mode 100755 debian/sbctl-pkexec diff --git a/.github/build-nest-v3 b/.github/build-nest-v3 index ca7bf83..da2d398 100644 --- a/.github/build-nest-v3 +++ b/.github/build-nest-v3 @@ -1 +1 @@ -13 \ No newline at end of file +14 \ No newline at end of file diff --git a/debian/rules b/debian/rules index d410b57..46f0397 100755 --- a/debian/rules +++ b/debian/rules @@ -51,6 +51,12 @@ export PIKA_BUILD_ARCH = $(shell cat ../pika-build-arch) #override_dh_clean: # echo "disabled" +override_dh_auto_build: + dh_auto_build + mkdir -p "debian/sbctl/usr/bin" + cp -v "debian/sbctl-pkexec" "debian/sbctl/usr/bin/sbctl-pkexec" + chmod 0755 "debian/sbctl/usr/bin/sbctl-pkexec" + override_dh_usrlocal: echo "disabled" diff --git a/debian/sbctl-pkexec b/debian/sbctl-pkexec new file mode 100755 index 0000000..77adb9d --- /dev/null +++ b/debian/sbctl-pkexec @@ -0,0 +1,3 @@ +#!/bin/sh + +pkexec "/usr/sbin/sbctl" "$@" diff --git a/main.sh b/main.sh index 3e0131f..8bdd8ed 100755 --- a/main.sh +++ b/main.sh @@ -17,6 +17,7 @@ cp -rvf ./debian ./${UPSTREAM_NAME}/ # easier than figuring out the right way to override the prefix in the makefile sed -i "s/usr\/local/usr/" "${UPSTREAM_NAME}/Makefile" +sed -i "s/\$(PREFIX)\/bin/\$(PREFIX)\/sbin/" "${UPSTREAM_NAME}/Makefile" # Get in there. pushd "./${UPSTREAM_NAME}/" || exit 1