summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--user/elogind/APKBUILD54
-rw-r--r--user/elogind/elogind.confd4
-rw-r--r--user/elogind/elogind.initd26
-rw-r--r--user/elogind/elogind.pamd18
-rw-r--r--user/elogind/elogind.post-deinstall3
-rw-r--r--user/elogind/elogind.post-install3
-rw-r--r--user/elogind/utmps.patch21
7 files changed, 129 insertions, 0 deletions
diff --git a/user/elogind/APKBUILD b/user/elogind/APKBUILD
new file mode 100644
index 000000000..30dd59823
--- /dev/null
+++ b/user/elogind/APKBUILD
@@ -0,0 +1,54 @@
+# Contributor: A. Wilcox <awilfox@adelielinux.org>
+# Maintainer: A. Wilcox <awilfox@adelielinux.org>
+pkgname=elogind
+pkgver=243.7
+pkgrel=0
+pkgdesc="Session manager system"
+url=" "
+arch="all"
+license="LGPL-2.1+"
+depends="dbus eudev polkit utmps"
+makedepends="meson ninja acl-dev dbus-dev docbook-xsl eudev-dev gperf libcap-dev
+ libxslt-dev linux-headers linux-pam-dev m4 skalibs-libs-dev
+ utmps-libs-dev"
+subpackages="$pkgname-dev $pkgname-doc $pkgname-lang $pkgname-openrc"
+install="$pkgname.post-install $pkgname.post-deinstall"
+source="elogind-$pkgver.tar.gz::https://github.com/elogind/elogind/archive/v$pkgver.tar.gz
+ utmps.patch
+
+ elogind.pamd
+ elogind.confd
+ elogind.initd
+ "
+
+build() {
+ export LDFLAGS="-Wl,--no-as-needed -l:libutmps.so -Wl,--as-needed"
+ # Note: We can't use openrc as our cgroup controller,
+ # otherwise we aren't portable to s6/runit later.
+ meson \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ -Dcgroup-controller=elogind \
+ -Ddefault-kill-user-processes=false \
+ -Dman=auto \
+ build
+ ninja -C build
+}
+
+check() {
+ ninja -C build test
+}
+
+package() {
+ DESTDIR="$pkgdir" ninja -C build install
+ install -D -m644 "$srcdir"/elogind.pamd "$pkgdir"/etc/pam.d/elogind-user
+ install -D -m755 "$srcdir"/elogind.initd "$pkgdir"/etc/init.d/elogind
+ install -D -m644 "$srcdir"/elogind.confd "$pkgdir"/etc/conf.d/elogind
+}
+
+sha512sums="fd17c5016d083d63805f9ed0326ee32597870f6c48c9c246712cb09a77db775036b0fd0f4258b6557e189a1eceb4b50f4ae2e9e7881f4d9759b87a0b49ce3472 elogind-243.7.tar.gz
+5c1596b85e893e965ffb6f401c51d07dc4a77468b2ccfbe93a2b84eae596acf8a31a760c16f174cf73ffd6d404e9252e9baa7ea5ecc7785e6bf66282c27c66fc utmps.patch
+b5043d7bcbefdf00704d40670deafa0984899cc7be083e8d886a92137932a9f23c25749c106cfc07906166e57db32fe6c602cf1c54129faa7e5b04d6228b7c17 elogind.pamd
+2c9047c054582824f8a3e71bb0a79a5621d7a92cb15c66bb7e7a8deb931037b6d3a331b86cdc9eb5ec4e7b2b725548a7ee6657e3c3193d81ba6422cd101a2491 elogind.confd
+bbc203a924abf65b45d7d4d2fc31baf2d4e23135d98c7c937f93a4fe2d4ce9dac3d4e0747c1e09101f8b2ce674d25d49e085bf2445e7cb28408d7d209f8f4491 elogind.initd"
diff --git a/user/elogind/elogind.confd b/user/elogind/elogind.confd
new file mode 100644
index 000000000..f212514cb
--- /dev/null
+++ b/user/elogind/elogind.confd
@@ -0,0 +1,4 @@
+# /etc/conf.d/elogind: config file for /etc/init.d/elogind
+
+# this is where elogind will store its pid file
+ELOGIND_PIDFILE="/run/elogind.pid"
diff --git a/user/elogind/elogind.initd b/user/elogind/elogind.initd
new file mode 100644
index 000000000..ab6a3905c
--- /dev/null
+++ b/user/elogind/elogind.initd
@@ -0,0 +1,26 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need dbus
+
+ # Make sure elogind is up before xdm starts any dm
+ before xdm
+ before sddm
+}
+
+start() {
+ ebegin "Starting elogind"
+
+ start-stop-daemon --start --quiet \
+ --pidfile "${ELOGIND_PIDFILE}" \
+ --exec /lib/elogind/elogind -- --daemon
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping elogind"
+ start-stop-daemon --stop --quiet --pidfile "${ELOGIND_PIDFILE}"
+ eend $?
+}
diff --git a/user/elogind/elogind.pamd b/user/elogind/elogind.pamd
new file mode 100644
index 000000000..210d3becb
--- /dev/null
+++ b/user/elogind/elogind.pamd
@@ -0,0 +1,18 @@
+# Welcome to Adélie Linux.
+# This file describes the PAM configuration for elogind.
+# This is *not* the configuration that adds elogind to the system;
+# that file is $SYSROOT/etc/pam.d/base-session-elogind.
+
+account required pam_access.so
+account include base-account
+
+session required pam_env.so
+session required pam_limits.so
+session required pam_unix.so
+session required pam_loginuid.so
+session optional pam_keyinit.so force revoke
+session optional pam_elogind.so
+
+auth required pam_deny.so
+
+password required pam_deny.so
diff --git a/user/elogind/elogind.post-deinstall b/user/elogind/elogind.post-deinstall
new file mode 100644
index 000000000..76e04048e
--- /dev/null
+++ b/user/elogind/elogind.post-deinstall
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+printf "" > /etc/pam.d/base-session-elogind
diff --git a/user/elogind/elogind.post-install b/user/elogind/elogind.post-install
new file mode 100644
index 000000000..8a6636660
--- /dev/null
+++ b/user/elogind/elogind.post-install
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+printf "# Welcome to Adélie Linux\n# This file integrates elogind with your system PAM configuration.\n# It should not be modified. If you no longer wish to use elogind,\n# simply remove the include line from /etc/pam.d/base-session.\n\nsession\t\trequired\tpam_loginuid.so\nsession\t\toptional\tpam_elogind.so\n" > /etc/pam.d/base-session-elogind
diff --git a/user/elogind/utmps.patch b/user/elogind/utmps.patch
new file mode 100644
index 000000000..c1ac7c515
--- /dev/null
+++ b/user/elogind/utmps.patch
@@ -0,0 +1,21 @@
+--- elogind-243.7/src/shared/musl_missing.h.old 2020-03-12 19:33:40.000000000 +0000
++++ elogind-243.7/src/shared/musl_missing.h 2020-07-24 23:42:45.556511070 +0000
+@@ -76,7 +76,6 @@
+ /* Make musl utmp/wtmp stubs visible if needed. */
+ #if ENABLE_UTMP
+ # include <paths.h>
+-# include <utmp.h>
+ # include <utmpx.h>
+ # if defined(_PATH_UTMP) && !defined(_PATH_UTMPX)
+ # define _PATH_UTMPX _PATH_UTMP
+--- elogind-243.7/src/basic/user-util.c.old 2020-03-12 19:33:40.000000000 +0000
++++ elogind-243.7/src/basic/user-util.c 2020-07-24 23:44:44.253733648 +0000
+@@ -12,7 +12,7 @@
+ #include <string.h>
+ #include <sys/stat.h>
+ #include <unistd.h>
+-#include <utmp.h>
++#include <utmpx.h>
+
+ #include "alloc-util.h"
+ #include "errno-util.h"