aboutsummaryrefslogtreecommitdiffstats
path: root/community/elogind
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2019-05-25 15:19:06 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2019-05-25 15:19:06 +0200
commitc9c95c143671e443a8f59ddc71d587c35546ccf8 (patch)
treefffa9ed49be4c8622cfe8007daaaa64d3420bf97 /community/elogind
parent19bfcef590655dbb27dc59fe27103715a8fcbce5 (diff)
downloadaports-c9c95c143671e443a8f59ddc71d587c35546ccf8.tar.bz2
aports-c9c95c143671e443a8f59ddc71d587c35546ccf8.tar.xz
community/elogind: move from testing
Diffstat (limited to 'community/elogind')
-rw-r--r--community/elogind/APKBUILD93
-rw-r--r--community/elogind/reverse_CLOSE_ON_EXEC_removal.patch14
-rw-r--r--community/elogind/reverse_DISABLE_BUFFER_in_cg_attach.patch13
3 files changed, 120 insertions, 0 deletions
diff --git a/community/elogind/APKBUILD b/community/elogind/APKBUILD
new file mode 100644
index 0000000000..8be30430c4
--- /dev/null
+++ b/community/elogind/APKBUILD
@@ -0,0 +1,93 @@
+# Contributor: Leo <thinkabit.ukim@gmail.com>
+# Maintainer: Leo <thinkabit.ukim@gmail.com>
+pkgname=elogind
+pkgver=241.3
+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"
+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"
diff --git a/community/elogind/reverse_CLOSE_ON_EXEC_removal.patch b/community/elogind/reverse_CLOSE_ON_EXEC_removal.patch
new file mode 100644
index 0000000000..98f1fdbcf7
--- /dev/null
+++ b/community/elogind/reverse_CLOSE_ON_EXEC_removal.patch
@@ -0,0 +1,14 @@
+diff --git a/src/basic/fileio.c b/src/basic/fileio.c
+index e981cd024..ffcbf7309 100644
+--- a/src/basic/fileio.c
++++ b/src/basic/fileio.c
+@@ -156,7 +156,7 @@ int write_string_file_ts(
+ goto fail;
+ }
+
+- f = fdopen(fd, "w");
++ f = fdopen(fd, "we");
+ if (!f) {
+ r = -errno;
+ safe_close(fd);
+
diff --git a/community/elogind/reverse_DISABLE_BUFFER_in_cg_attach.patch b/community/elogind/reverse_DISABLE_BUFFER_in_cg_attach.patch
new file mode 100644
index 0000000000..b9017dcc01
--- /dev/null
+++ b/community/elogind/reverse_DISABLE_BUFFER_in_cg_attach.patch
@@ -0,0 +1,13 @@
+diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c
+index 9235361b6..11102790e 100644
+--- a/src/basic/cgroup-util.c
++++ b/src/basic/cgroup-util.c
+@@ -824,7 +824,7 @@ int cg_attach(const char *controller, const char *path, pid_t pid) {
+
+ xsprintf(c, PID_FMT "\n", pid);
+
+- r = write_string_file(fs, c, WRITE_STRING_FILE_DISABLE_BUFFER);
++ r = write_string_file(fs, c, 0);
+ if (r < 0)
+ return r;
+