aboutsummaryrefslogblamecommitdiffstats
path: root/community/elogind/APKBUILD
blob: 0c864069cbed5e3604a54a55bfd3382579d75ecf (plain) (tree)
1
2
3
4
5
6
7
8
9


                                             
            
        



                                              
                     
                                         
























                                                 
                                                                                           

                                                 

         
                                                                                                   































                                                                            















                                                                     
                                                                                                                                                                  

                                                                                                                                                                           
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Leo <thinkabit.ukim@gmail.com>
pkgname=elogind
pkgver=241.3
pkgrel=1
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"