summaryrefslogtreecommitdiff
path: root/repo/system/elogind.xibuild
blob: 9543945c2662470f90ed32f16bb87f5d80f65c7e (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
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/sh

MAKEDEPS="make docbook4-xml docbook-xsl docbook-dtd libxslt ubase glib acl m4"
DEPS="pam gperf eudev"

PKG_VER=246.10
SOURCE=https://github.com/elogind/elogind/archive/v$PKG_VER/elogind-$PKG_VER.tar.gz
ADDITIONAL="
https://raw.githubusercontent.com/void-linux/void-packages/master/srcpkgs/elogind/patches/id-nobody.patch
https://raw.githubusercontent.com/void-linux/void-packages/master/srcpkgs/elogind/patches/mips.patch
https://raw.githubusercontent.com/void-linux/void-packages/master/srcpkgs/elogind/patches/ppc64-bad-tuple.patch
https://raw.githubusercontent.com/void-linux/void-packages/master/srcpkgs/elogind/patches/ppcle.patch
"
DESC="The standalone logind daemon"

prepare () {
    sed -i '/Disable polkit/,+8 d' meson.build
    
    for p in *.patch; do
        patch -Np1 -i $p
    done
}

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

    # TODO re-enable BUILD_MANS
    meson \
		-Dcgroup-controller=elogind \
		-Dhalt-path=/sbin/halt \
		-Drootlibexecdir=/usr/libexec/elogind \
		-Dreboot-path=/sbin/reboot \
		-Ddefault-hierarchy=hybrid \
		-Ddefault-kill-user-processes=false \
		-Dpolkit=true \
		-Dman=true \
		..
    ninja
}

package () {
    DESTDIR=$PKG_DEST ninja install &&
    ln -sf  libelogind.pc $PKG_DEST/usr/lib/pkgconfig/libsystemd.pc &&
    ln -sfn elogind $PKG_DEST/usr/include/systemd


    sed -e '/\[Login\]/a KillUserProcesses=no' \
    -i $PKG_DEST/etc/elogind/logind.conf

    cat >> $PKG_DEST/etc/pam.d/system-session << "EOF" &&
# Begin elogind addition

session  required    pam_loginuid.so
session  optional    pam_elogind.so

# End elogind addition
EOF
    cat > $PKG_DEST/etc/pam.d/elogind-user << "EOF"
# Begin /etc/pam.d/elogind-user

account  required    pam_access.so
account  include     system-account

session  required    pam_env.so
session  required    pam_limits.so
session  required    pam_unix.so
session  required    pam_loginuid.so
session  optional    pam_keyinit.so force revoke
session  optional    pam_elogind.so

auth     required    pam_deny.so
password required    pam_deny.so

# End /etc/pam.d/elogind-user
EOF


}