aboutsummaryrefslogtreecommitdiffstats
path: root/community/elogind/APKBUILD
blob: c4bdd78c8e01bbc159ad992e350c67ab2f523d44 (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
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
95
96
97
98
99
100
101
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Leo <thinkabit.ukim@gmail.com>
pkgname=elogind
pkgver=246.10
pkgrel=0
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
	coreutils
	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
	$pkgname-openrc
	lib$pkgname:libs
	$pkgname-zsh-completion:zshcomp:noarch
	$pkgname-bash-completion:bashcomp:noarch
	"
source="https://github.com/elogind/elogind/archive/v$pkgver/elogind-v$pkgver.tar.gz
	elogind.initd
	fix-mips-detection.patch
	fix-version.patch
	"

build() {
	[ "$CARCH" == "s390x" ] && export CFLAGS="$CFLAGS -D__IGNORE_pkey_mprotect -DSO_PEERSEC=31"
	export LDFLAGS="$LDFLAGS -lintl"
	abuild-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=false \
		-Dman=true \
		build
	meson compile ${JOBS:+-j ${JOBS}} -C build
}

check() {
	meson test --no-rebuild -v -C build
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C build

	# 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

	# Install openrc service
	install -Dm755 "$srcdir"/elogind.initd "$pkgdir"/etc/init.d/elogind
}

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="9db0f068ed94ec07bab4d764ccb38840af3d05a4b7c9c539721906f5381b509cb9a3cbfb0453a978210d306136368de6162578c600d522416ef2a7ac1b9f348b  elogind-v246.10.tar.gz
e73738488e78af099fdbb7c93a411a3e8d69080a93f89c245cb8c6de5fe4cb7fe724687d19e21eb6be52ccc795ec200d9c6e499efb1afd2b27467f7f541a7dd1  elogind.initd
0fda4318afc6db9c9d00121ed4f8267286e692cca04acf4c1006fab99267cdd6228e1d176293f99db043384ae6fa192fc8109a365bf221dda7f2c4177d104820  fix-mips-detection.patch
178c33608f0d69fde8558c521aea9981e0a0bd4a6666d2e1b4f0714dbb7038955ceb86cf323ea741ee67f89218a2e7d332aa05507c2a06eb01fd0785dd81716b  fix-version.patch"