summaryrefslogtreecommitdiff
path: root/repo/system/polkit.xibuild
blob: 2f891f464789a2b560418d6c639f96fef6191b32 (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
#!/bin/sh

MAKEDEPS="git gobject-introspection meson libxslt patch elogind"
DEPS="expat glib js78 pam"

PKG_VER=0.120
SOURCE=https://www.freedesktop.org/software/polkit/releases/polkit-$PKG_VER.tar.gz
ADDITIONAL=(
    https://www.linuxfromscratch.org/patches/blfs/svn/polkit-$PKG_VER-security_fix-1.patch
    )

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

prepare () {
    sed '/0,/s/^/#/' -i meson_post_install.py &&
    sed '/policy,/d' -i actions/meson.build \
                     -i src/examples/meson.build

    patch -Np1 -i polkit-$PKG_VER-security_fix-1.patch

}

build () {
    mkdir build &&
    cd    build &&

    # TODO fix man
    meson --prefix=/usr                 \
          -Dman=false                    \
          -Dsession_tracking=libelogind \
          -Dsystemdsystemunitdir=/tmp   \
          --buildtype=release           \
          ..                            &&
    ninja
}

package () {
    DESTDIR=$PKG_DEST ninja install &&


        cat > $PKG_DEST/etc/pam.d/polkit-1 << "EOF"
# Begin /etc/pam.d/polkit-1

auth     include        system-auth
account  include        system-account
password include        system-password
session  include        system-session

# End /etc/pam.d/polkit-1
EOF

}

postinstall() {
    /usr/sbin/groupadd -fg 27 polkitd &&
    /usr/sbin/useradd -c "PolicyKit Daemon Owner" -d /etc/polkit-1 -u 27 \
            -g polkitd -s /bin/false polkitd
}