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

MAKEDEPS=""
DEPS="skalibs"

PKG_VER=0.1.1.0
SOURCE=https://skarnet.org/software/utmps/utmps-$PKG_VER.tar.gz

DESC="Library implementing utmpx.h family of functions"

build () {
    ./configure \
            --enable-shared      \
            --libdir=/usr/lib    \
            --with-dynlib=/lib   \
            --libexecdir="/lib/utmps" \
            --with=dynlib=/lib
    make
}

package () {
    make DESTDIR=$PKG_DEST install
    ln -s utmps/utmpx.h $PKG_DEST/usr/include/utmpx.h
    install -d $PKG_DEST/usr/lib/pkgconfig
    cat > $PKG_DEST/usr/lib/pkgconfig/utmps.pc << EOF
Name: utmps
Description: A secure implementation of the utmp mechanism.
URL: https://skarnet.org/software/utmps/
Version: $PKG_VER 
Requires.private: skalibs
Libs: -lutmps
Cflags: -I/usr/include/utmps
EOF

    #ln -s utmps/wtmp /var/log/wtmp
}

postinstall () {
    # check that shadow exists
    command -v useradd || exit 1
    command -v chown || exit 1

    useradd -c "utmps user" -d /run/utmps \
        -u 984 -g utmp -s /bin/false utmp
    [ -d /var/log/utmps ] || mkdir -p /var/log/utmps
    chown -R utmp:utmp /var/log/utmps
}