aboutsummaryrefslogtreecommitdiffstats
path: root/community/elogind/APKBUILD
blob: fcbb8a0c6e4ad45860bf152f25582121c15e73fd (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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Leo <thinkabit.ukim@gmail.com>
pkgname=elogind
pkgver=241.3
pkgrel=2
pkgdesc="Standalone fork of systemd's elogind"
url="https://github.com/elogind/elogind"
arch="all"
license="GPL-2.0-or-later LGPL-2.1-or-later"
depends="dbus shadow"
options="!check" # Tests fail on builders
makedepends="
	meson
	docbook-xsl
	gettext-dev
	git
	gperf
	intltool
	libxslt-dev
	glib-dev
	acl-dev
	eudev-dev
	libcap-dev
	libseccomp-dev
	linux-pam-dev
	m4
	dbus-dev
	pcre2-dev
	"
subpackages="
	$pkgname-dev
	$pkgname-doc
	$pkgname-lang
	lib$pkgname:libs
	$pkgname-zsh-completion:zshcomp:noarch
	$pkgname-bash-completion:bashcomp:noarch"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/elogind/elogind/archive/v$pkgver.tar.gz
	reverse_DISABLE_BUFFER_in_cg_attach.patch
	reverse_CLOSE_ON_EXEC_removal.patch"

build() {
	[ "$CARCH" == "s390x" ] && export CFLAGS="$CFLAGS -D__IGNORE_pkey_mprotect -DSO_PEERSEC=31"
	export LDFLAGS="$LDFLAGS -lintl"
	meson \
		--libdir=/usr/lib \
		--libexecdir=/usr/libexec \
		-Dprefix=/usr \
		-Dcgroup-controller=elogind \
		-Dhalt-path=/sbin/halt \
		-Drootlibexecdir=/usr/libexec/elogind \
		-Dreboot-path=/sbin/reboot \
		-Ddefault-hierarchy=hybrid \
		-Ddefault-kill-user-processes=false \
		build
	ninja -C build
}

check() {
	ninja -C build test
}

package() {
	DESTDIR="$pkgdir" ninja -C build install

	# Claim compatiblity with systemd and systemd-logind
	ln -s libelogind.pc "$pkgdir"/usr/lib/pkgconfig/libsystemd.pc
	ln -s libelogind.pc "$pkgdir"/usr/lib/pkgconfig/libsystemd-logind.pc
	ln -s "$pkgdir"/usr/include/elogind "$pkgdir"/usr/include/systemd

	# Install headers from elogind
	install -Dm644 src/systemd/sd-id128.h usr/include/sd-id128.h
	install -Dm644 src/systemd/_sd-common.h usr/include/_sd-common.h
}

zshcomp() {
	pkgdesc="Zsh completion for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel zsh"

	mkdir -p "$subpkgdir"/usr/share
	mv "$pkgdir"/usr/share/zsh "$subpkgdir"/usr/share/
}

bashcomp() {
	pkgdesc="Bash completion for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"

	mkdir -p "$subpkgdir"/usr/share
	mv "$pkgdir"/usr/share/bash-completion "$subpkgdir"/usr/share
}

sha512sums="b33c0ed85c4a97216f8d56441207510be180258d4f4e5ff9dea07d59d53b84b03c27f5397f09214ce9fc880f38865e20d7c05b41255d4b762c33099b7ebb53eb  elogind-241.3.tar.gz
52db50ddd1002736fbbbacb1f8142c624cd78d0177bdc6b5669a54b2e59250903bc1b2639333b0563e382b86cf10cd06f159e9391f7e9224932bebfff3056f60  reverse_DISABLE_BUFFER_in_cg_attach.patch
46799574b42eb0974f1648f703e86215571e040463c2957b9aca01b14924677d33d17d68680dafcde6d269062e23be001231d39f0c92e078a8b89c4e531447bb  reverse_CLOSE_ON_EXEC_removal.patch"