summaryrefslogtreecommitdiff
path: root/repo/utmps/utmps.xibuild
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-05-31 11:05:19 +0100
committerdavidovski <david@davidovski.xyz>2022-05-31 11:05:19 +0100
commit48ca75555522716f0f686dcae3dd6cf3d8ad714d (patch)
tree00c0f58550ba4661e87376f2f02c8001c69bae44 /repo/utmps/utmps.xibuild
parent871b2b573f01c1b3176a0f65458b3d281b41c437 (diff)
removed idea of repos
Diffstat (limited to 'repo/utmps/utmps.xibuild')
-rw-r--r--repo/utmps/utmps.xibuild74
1 files changed, 74 insertions, 0 deletions
diff --git a/repo/utmps/utmps.xibuild b/repo/utmps/utmps.xibuild
new file mode 100644
index 0000000..f0112e6
--- /dev/null
+++ b/repo/utmps/utmps.xibuild
@@ -0,0 +1,74 @@
+#!/bin/sh
+
+MAKEDEPS=""
+DEPS="skalibs"
+
+PKG_VER=0.1.1.0
+SOURCE=https://skarnet.org/software/utmps/utmps-$PKG_VER.tar.gz
+
+ADDITIONAL="
+btmpd.initd
+btmpd.logrotate
+utmpd.initd
+utmp-init.initd
+utmp-prepare.initd
+wtmpd.initd
+wtmpd.logrotate
+"
+
+DESC="Library implementing utmpx.h family of functions"
+
+build () {
+ ./configure \
+ --enable-shared \
+ --libdir=/usr/lib \
+ --with-dynlib=/lib \
+ --libexecdir="/lib/utmps"
+ 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
+ install -D -m755 utmp-prepare.initd "$PKG_DEST/etc/init.d/utmp-prepare"
+ install -D -m755 utmpd.initd "$PKG_DEST/etc/init.d/utmpd"
+ install -D -m755 wtmpd.initd "$PKG_DEST/etc/init.d/wtmpd"
+ install -D -m755 btmpd.initd "$PKG_DEST/etc/init.d/btmpd"
+ install -D -m755 utmp-init.initd "$PKG_DEST/etc/init.d/utmp-init"
+ install -D -m644 wtmpd.logrotate "$PKG_DEST/etc/logrotate.d/wtmpd"
+ install -D -m644 btmpd.logrotate "$PKG_DEST/etc/logrotate.d/btmpd"
+}
+
+postinstall () {
+ # check that shadow exists
+ command -v useradd || exit 1
+ command -v chown || exit 1
+
+ grep -q "utmps" /etc/passwd || useradd -c "utmps user" -d /run/utmps \
+ -u 984 -g utmp -s /bin/false utmp
+ [ -d /var/log/utmps ] || mkdir -p /var/log/utmps
+ [ -d /var/log/wtmp ] && mv /var/log/wtmp /var/log/utmps
+ chown -R utmp:utmp /var/log/utmps
+ [ -e /var/log/wtmp ] || ln -s utmps/wtmp /var/log/wtmp
+
+# utmps is broken, dont try to make services with it without s6 ipc
+# rc-update add utmp-prepare boot
+# rc-update add utmpd boot
+# rc-update add wtmpd boot
+# rc-update add btmpd boot
+# rc-update add utmp-init boot
+# rc-service utmp-prepare start
+# rc-service utmpd start
+# rc-service wtmpd start
+# rc-service btmpd start
+}