From 7648f091c0bb2cfba04d95722ddfefb8a7a12017 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Thu, 8 May 2025 17:15:48 +0300 Subject: [PATCH] Initial Commit --- pkg.info | 9 ++++++++ source-files/polkitd.esv | 7 ++++++ source.sh | 50 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 pkg.info create mode 100644 source-files/polkitd.esv create mode 100644 source.sh diff --git a/pkg.info b/pkg.info new file mode 100644 index 0000000..42b60b8 --- /dev/null +++ b/pkg.info @@ -0,0 +1,9 @@ +name: polkit +description: Toolkit for defining and handling authorizations +version: 126 +url: https://github.com/polkit-org/polkit +license: LGPL2-or-later +architecture: any +depends: ["docbook-xsl-nons","duktape","elogind","expat","glib","glibc","pam","sysusers"] +make_depends: ["dbus","gobject-introspection","meson","python-setuptools"] +type: source diff --git a/source-files/polkitd.esv b/source-files/polkitd.esv new file mode 100644 index 0000000..a44305a --- /dev/null +++ b/source-files/polkitd.esv @@ -0,0 +1,7 @@ +name: polkit +description: Start polkit daemon +dependencies: ["dbus"] +type: background +start_cmd: /usr/lib/polkit-1/polkitd +exit_method: kill +restart: true diff --git a/source.sh b/source.sh new file mode 100644 index 0000000..1ad8f58 --- /dev/null +++ b/source.sh @@ -0,0 +1,50 @@ +# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package +# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE +# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT + +DOWNLOAD="https://github.com/polkit-org/polkit/archive/${BPM_PKG_VERSION}/polkit-${BPM_PKG_VERSION}.tar.gz" +# Removes systemd dependency when using elogind +DOWNLOAD_PATCH="https://github.com/polkit-org/polkit/commit/55ee1b70456eca8281dda9612c485c619122f202.patch" +FILENAME="${DOWNLOAD##*/}" +FILENAME_PATCH="${DOWNLOAD_PATCH##*/}" + +# The prepare function is executed in the root of the temp directory +# This function is used for downloading files and putting them into the correct location +prepare() { + wget "$DOWNLOAD" + wget "$DOWNLOAD_PATCH" + tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE" + + cd "$BPM_SOURCE" + git apply ../${FILENAME_PATCH} +} + +# The build function is executed in the source directory +# This function is used to compile the source code +build() { + mkdir build + cd build + + meson setup --prefix=/usr \ + --libdir=/usr/lib \ + --buildtype=release \ + -Dman=true \ + -Dos_type=lfs \ + -Dpolkitd_uid=9 \ + -Dpolkitd_user=polkitd \ + -Dsession_tracking=elogind \ + -Dsystemdsystemunitdir=/tmp \ + -Dtests=false .. + ninja +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package() { + cd build + + DESTDIR="$BPM_OUTPUT" ninja install + + install -Dm644 "$BPM_WORKDIR"/polkitd.esv "$BPM_OUTPUT"/etc/esvm/services/polkitd.esv + install -Dm644 ../COPYING "$BPM_OUTPUT"/usr/share/licenses/polkit/COPYING +}