summaryrefslogtreecommitdiff
path: root/repo/polkit/polkit.xibuild
blob: e8286ddfa63b4a4152cd9a1dfe5734d5a50641aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/sh

NAME="polkit"
DESC="Application development toolkit for controlling system-wide privileges"

MAKEDEPS="autoconf automake bash dbus-glib elogind expat glib gobject-introspection gtk2 intltool libtool pam js78"

PKG_VER=0.120
SOURCE="https://www.freedesktop.org/software/polkit/releases/polkit-$PKG_VER.tar.gz"

ADDITIONAL="
CVE-2021-4034.patch
alpine-polkit.pam
make-innetgr-optional.patch
polkit-common.pre-install
polkit-common.pre-upgrade
polkit.initd
"

prepare() {
	apply_patches
	autoreconf -fi
}

build() {
	./configure \
        --disable-libsystemd-login \
		--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
}

package() {
	provider_priority=100  # highest

	make DESTDIR="$PKG_DEST" \
		dbusconfdir=/usr/share/dbus-1/system.d \
		rulesdir=/usr/share/polkit-1/rules.d \
        install
	cd "$PKG_DEST"

	# Use our own polkit rules, upstream may change them
	install -m644 "$BUILD_ROOT"/alpine-polkit.pam etc/pam.d/polkit-1

	# See polkit's configure script which tells us what permissions to set
	chown -R polkitd:polkitd etc/polkit-1/rules.d usr/share/polkit-1/rules.d
	chmod -R 700 etc/polkit-1/rules.d usr/share/polkit-1/rules.d
	chmod 4755 usr/lib/polkit-1/polkit-agent-helper-1
	chmod 4755 usr/bin/pkexec

	install -Dm755 "$BUILD_ROOT"/polkit.initd etc/init.d/polkit
}