aboutsummaryrefslogtreecommitdiffstats
path: root/community/utmps/APKBUILD
blob: 38c0771e2292df43a1aa58cf71880ea5e45b5f59 (plain) (blame)
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
# Maintainer: Laurent Bercot <ska-devel@skarnet.org>
# Contributor: Laurent Bercot <ska-devel@skarnet.org>
pkgname=utmps
pkgver=0.0.2.2
pkgrel=0
pkgdesc="A secure utmp/wtmp implementation"
url="https://skarnet.org/software/$pkgname/"
arch="all"
license="ISC"
depends="execline s6"
depends_dev="skalibs-dev"
makedepends="skalibs-dev"
options="!check"
subpackages="$pkgname-dev $pkgname-doc $pkgname-openrc"
source="https://skarnet.org/software/utmps/utmps-$pkgver.tar.gz
	$pkgname.initd
	utmpd.run
	wtmpd.run
	"
install="$pkgname.pre-install $pkgname.pre-upgrade"

build() {
	./configure \
		--enable-shared \
		--enable-static \
		--disable-allstatic \
		--libdir=/usr/lib \
		--libexecdir="/lib/$pkgname" \
		--with-dynlib=/lib
	make
}

package() {
	make DESTDIR="$pkgdir" install
	mkdir -p "$pkgdir/etc/init.d" \
		"$pkgdir/var/lib/$pkgname/services/utmpd" \
		"$pkgdir/var/lib/$pkgname/services/wtmpd"
	cp -f "$srcdir/$pkgname.initd" "$pkgdir/etc/init.d/$pkgname"
	cp -f "$srcdir/utmpd.run" "$pkgdir/var/lib/$pkgname/services/utmpd/run"
	echo 3 > "$pkgdir/var/lib/$pkgname/services/utmpd/notification-fd"
	s6-mkfifodir -g 0 -- "$pkgdir/var/lib/$pkgname/services/utmpd/event"
	cp -f "$srcdir/wtmpd.run" "$pkgdir/var/lib/$pkgname/services/wtmpd/run"
	echo 3 > "$pkgdir/var/lib/$pkgname/services/wtmpd/notification-fd"
	s6-mkfifodir -g 0 -- "$pkgdir/var/lib/$pkgname/services/wtmpd/event"
	chmod 0755 "$pkgdir/etc/init.d/$pkgname" \
		"$pkgdir/var/lib/$pkgname/services/utmpd/run" \
		"$pkgdir/var/lib/$pkgname/services/wtmpd/run"
	mkdir -m 0700 "$pkgdir/var/lib/$pkgname/services/utmpd/supervise" \
		"$pkgdir/var/lib/$pkgname/services/wtmpd/supervise"
	dd if=/dev/zero of="$pkgdir/var/lib/$pkgname/services/utmpd/supervise/status" bs=35 count=1
	dd if=/dev/zero of="$pkgdir/var/lib/$pkgname/services/wtmpd/supervise/status" bs=35 count=1
}

# Remove this dev() override when musl-dev doesn't own /usr/include/utmpx.h anymore.
dev() {
	default_dev
	rm -f "$subpkgdir/usr/include/utmpx.h"
}

doc() {
	default_doc
	mkdir -p "$subpkgdir/usr/share/doc"
	cp -a "$builddir/doc" "$subpkgdir/usr/share/doc/$pkgname"
}

sha512sums="1e7b53e7fcbd15a113aef8001ac77c3646ecd4723eaca77b36400c76ee96dafe919a993603a1fd441f1c9fff08c5924714910d43ae86fbf85971c39b950323c0  utmps-0.0.2.2.tar.gz
437d0c52ef1ecd23775990225647c2a6ca53691fb5688ffa866a0e6db177a08fe465f2e683e8b98ba668d8ddcd4ffa0fe3939f23ded276f4ca7acaa2553b10e6  utmps.initd
0ec30284c64c6ea9f25142c5f4a643bd48b137fe85781b650104f5137ffa4dfc35ca7be3e41e3acd3403ebe1d8c5378073afa4e2f3607d3d794fcd9f98ed51c4  utmpd.run
cba4f2ec3b8f5becf3ae57eecf584745d783046ee6cf5d116322421ad5ffd074d2955da22d31d2b5b1d05f906378aae92f221d2ac95ac21b54a361fbdc0566e7  wtmpd.run"