aboutsummaryrefslogtreecommitdiffstats
path: root/community/polkit/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'community/polkit/APKBUILD')
-rw-r--r--community/polkit/APKBUILD118
1 files changed, 53 insertions, 65 deletions
diff --git a/community/polkit/APKBUILD b/community/polkit/APKBUILD
index b7e3b80b4c8..a7dbd21247b 100644
--- a/community/polkit/APKBUILD
+++ b/community/polkit/APKBUILD
@@ -3,35 +3,31 @@
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=polkit
-pkgver=0.120
-pkgrel=2
+pkgver=124
+pkgrel=0
pkgdesc="Application development toolkit for controlling system-wide privileges"
url="https://www.freedesktop.org/wiki/Software/polkit/"
-arch="all !s390x !riscv64" # Rust
+arch="all"
license="GPL-2.0-or-later"
options="suid !check" # Needs a functioning dbus daemon
-depends="$pkgname-common=$pkgver-r$pkgrel $pkgname-libs=$pkgver-r$pkgrel"
makedepends="
- autoconf
- automake
- bash
dbus-glib-dev
+ duktape-dev
elogind-dev
expat-dev
glib-dev
gobject-introspection-dev
gtk-doc
- intltool
- libtool
linux-pam-dev
- mozjs78-dev
+ meson
+ perl
"
pkgusers="polkitd"
pkggroups="polkitd"
install="$pkgname-common.pre-install $pkgname-common.pre-upgrade"
subpackages="
$pkgname-dev
- $pkgname-libs
+ $pkgname-noelogind-libs:libs
$pkgname-doc
$pkgname-lang
$pkgname-openrc
@@ -40,11 +36,10 @@ subpackages="
$pkgname-elogind-dev:_elogind_dev
$pkgname-elogind-libs:_elogind_libs
"
-source="https://www.freedesktop.org/software/polkit/releases/polkit-$pkgver.tar.gz
- make-innetgr-optional.patch
+source="https://gitlab.freedesktop.org/polkit/polkit/-/archive/$pkgver/polkit-$pkgver.tar.bz2
alpine-polkit.pam
polkit.initd
- CVE-2021-4034.patch
+ logind_dep.patch
"
# secfixes:
@@ -53,57 +48,48 @@ source="https://www.freedesktop.org/software/polkit/releases/polkit-$pkgver.tar.
# 0.119-r0:
# - CVE-2021-3560
-prepare() {
- default_prepare
- autoreconf -fi
-
- cp -r "$builddir" "$builddir-elogind"
-}
-
build() {
msg 'Building without elogind'
- _build --disable-libsystemd-login
+ _build no-elogind -Dsession_tracking="ConsoleKit"
msg 'Building with elogind'
- cd "$builddir-elogind"
- _build --enable-libsystemd-login
+ _build elogind -Dsession_tracking="libelogind"
}
_build() {
- ./configure \
- --build=$CBUILD \
- --host=$CHOST \
- --prefix=/usr \
- --sysconfdir=/etc \
- --mandir=/usr/share/man \
- --infodir=/usr/share/info \
- --libexecdir=/usr/lib/polkit-1 \
- --localstatedir=/var \
- --disable-static \
- --enable-introspection \
- --with-authfw=pam \
- --with-os-type=alpine \
- --disable-gtk-doc \
- --disable-gtk-doc-html \
- --disable-gtk-doc-pdf \
- --disable-libelogind \
- --disable-systemd \
- "$@"
- make
+ local outdir="$1"
+ shift
+ abuild-meson \
+ -Db_lto=true \
+ -Dtests="$(want_check && echo true || echo false)" \
+ -Dman=true \
+ -Dsystemdsystemunitdir=/trash \
+ -Dpam_prefix=/etc/pam.d \
+ "$@" \
+ . "$outdir"
+ meson compile -C "$outdir"
}
check() {
- make check
+ meson test --print-errorlogs --no-rebuild -C elogind
}
package() {
provider_priority=100 # highest
- _make_install "$builddir" "$pkgdir"
- _make_install "$builddir-elogind" "$builddir-elogind/dest"
+ depends="
+ $pkgname-common=$pkgver-r$pkgrel
+ $pkgname-noelogind-libs=$pkgver-r$pkgrel
+ "
+
+ DESTDIR="$pkgdir" meson install --no-rebuild -C no-elogind
+ DESTDIR="$builddir/elogind/dest" meson install --no-rebuild -C elogind
cd "$pkgdir"
+ # systemd files
+ rm -rf ./trash
+
# Use our own polkit rules, upstream may change them
install -m644 "$srcdir"/alpine-polkit.pam etc/pam.d/polkit-1
@@ -116,17 +102,12 @@ package() {
install -Dm755 "$srcdir"/polkit.initd etc/init.d/polkit
}
-_make_install() {
- # Set SHELL as a workaround for #10081
- make -C "$1" install \
- SHELL=/bin/bash \
- DESTDIR="$2" \
- dbusconfdir=/usr/share/dbus-1/system.d \
- rulesdir=/usr/share/polkit-1/rules.d
-}
-
libs() {
+ provides="$pkgname-libs"
provider_priority=100 # highest
+
+ replaces="$pkgname-elogind-libs"
+
depends=""
default_libs
@@ -143,7 +124,7 @@ dev() {
# specified. This sucks, but I don't know of a better solution (@jirutka).
depends="$depends_dev
$pkgname-common=$pkgver-r$pkgrel
- $pkgname-libs=$pkgver-r$pkgrel
+ $pkgname-libs
dbus-glib-dev
pc:gio-2.0>=2.18
pc:glib-2.0>=2.18
@@ -159,7 +140,7 @@ elogind() {
provider_priority=10 # lowest
replaces="$pkgname" # for backward compatibility
- cd "$builddir-elogind/dest"
+ cd "$builddir"/elogind/dest
mkdir -p "$subpkgdir"/usr/lib/polkit-1
mv usr/lib/polkit-1/polkitd "$subpkgdir"/usr/lib/polkit-1/
@@ -170,7 +151,7 @@ _elogind_dev() {
depends="$pkgname-dev=$pkgver-r$pkgrel $pkgname-elogind-libs=$pkgver-r$pkgrel"
replaces="$pkgname-dev"
- cd "$builddir-elogind/dest"
+ cd "$builddir"/elogind/dest
# *.gir files for the default and the elogind variant differ, the rest
# is the same.
@@ -181,11 +162,13 @@ _elogind_dev() {
_elogind_libs() {
pkgdesc="Polkit with elogind session tracking (libraries)"
depends=""
- provides="$pkgname-libs=$pkgver-r$pkgrel"
+ provides="$pkgname-libs"
provider_priority=10 # lowest
- replaces="$pkgname-libs $pkgname-elogind<=0.118" # for backward compatibility
- cd "$builddir-elogind/dest"
+ # for backward compatibility/overwrite order
+ replaces="$pkgname-libs $pkgname-noelogind-libs $pkgname-elogind<=0.118"
+
+ cd "$builddir"/elogind/dest
mkdir -p "$subpkgdir"/usr/lib
mv usr/lib/lib*.so.* "$subpkgdir"/usr/lib/
@@ -206,10 +189,15 @@ common() {
mv "$subpkgdir"/usr/lib/polkit-1/polkitd "$pkgdir"/usr/lib/polkit-1/
}
+openrc() {
+ default_openrc
+ # polkit-elogind won't pull it otherwise
+ install_if="$pkgname-common=$pkgver-r$pkgrel openrc"
+}
+
sha512sums="
-db072769439d5e17d0eed681e7b94251b77828c1474b40fe40b94293903a64333e7fa17515a3270648691f04a1374d8b404405ead6abf292a8eb8483164adc46 polkit-0.120.tar.gz
-0c47751e928a91ce3a477a330ef38b8f6f003b515c94e7fb9842e6f2043be43d749ab7390cc1dbcf1fa6128b62cf0eab353d4f8855d68e595bc53777512f4562 make-innetgr-optional.patch
+db520882b0bedf1c96052570bf4c55d7e966d8172f6d26acf0791d98c4b911fce5ee39e6d830f06122ac8df33c6b43c252cdb7ba3a54523804824ebf355405dc polkit-124.tar.bz2
f5102dc00d390b3a3c957b62e1712db778c7ffb7378f3d8e816c0757c11a308c5d5303e42595b0d6add9839247c773880cd34e56afacc89eb6efaadf9aae7826 alpine-polkit.pam
f6e5ac0ed41feb392dfd104979ec577c5936f3db2bd252b12b7b9b2609a0901dae38bebec1ea65ccf4f427860b520383ae4d2c66fb74ab986c715f6b0ad50473 polkit.initd
-462ca97dd15e1035c1df3b7fcaf8f803b3d9ddd3f9d0188889c1b1fc4c5290d717b684b2f355d0840c6f733d9bef906363a1242d6079478abb2aaaf15a357b45 CVE-2021-4034.patch
+d93b47cbb0a490fba030dfc2a02ddc5e9271856a7b962ccb5dc3a110e7dcbd4361dbaaf62cf02a3d53f3568cf227485c14a3b9ca30536a3d3be29c4e4a48da37 logind_dep.patch
"