From 8bbc9a3b3cf50094144747023713f50dddaaed7a 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 +- .github/workflows/build-nestv3.yml | 9 +++++---- debian/rules | 4 ++++ debian/sbctl-pkexec | 3 +++ main.sh | 1 + 5 files changed, 14 insertions(+), 5 deletions(-) create mode 100755 debian/sbctl-pkexec diff --git a/.github/build-nest-v3 b/.github/build-nest-v3 index ca7bf83..2edeafb 100644 --- a/.github/build-nest-v3 +++ b/.github/build-nest-v3 @@ -1 +1 @@ -13 \ No newline at end of file +20 \ No newline at end of file diff --git a/.github/workflows/build-nestv3.yml b/.github/workflows/build-nestv3.yml index f784499..5aeebfa 100644 --- a/.github/workflows/build-nestv3.yml +++ b/.github/workflows/build-nestv3.yml @@ -36,7 +36,8 @@ jobs: - name: Build Package run: ./main.sh - #- uses: actions/upload-artifact@v3 - # with: - # name: sbctl - # path: output/sbctl*.deb + - uses: actions/upload-artifact@v3 + with: + name: sbctl-all + path: | + output/sbctl*.deb diff --git a/debian/rules b/debian/rules index d410b57..386a966 100755 --- a/debian/rules +++ b/debian/rules @@ -51,6 +51,10 @@ export PIKA_BUILD_ARCH = $(shell cat ../pika-build-arch) #override_dh_clean: # echo "disabled" +override_dh_auto_install: + dh_auto_install + install -Dm755 debian/sbctl-pkexec 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