diff --git a/sys/auth/elogind/elogind.initd b/sys/auth/elogind/elogind.initd new file mode 100644 index 00000000..0c22ca99 --- /dev/null +++ b/sys/auth/elogind/elogind.initd @@ -0,0 +1,23 @@ +#!/sbin/openrc-run +supervisor=supervise-daemon + +name="System login manager" +description="System service that manages user logins" +description_reload="Reload configuration without exiting" + +command=/usr/libexec/elogind/elogind + +depend() { + need dbus + + # Make sure we start before any other display manager + before display-manager +} + +extra_started_commands="reload" + +reload() { + ebegin "Reloading configuration" + $supervisor $RC_SVCNAME --signal HUP + eend $? +} diff --git a/sys/auth/elogind/remove-polkit-gobject-1-check.patch b/sys/auth/elogind/remove-polkit-gobject-1-check.patch new file mode 100644 index 00000000..f58f08b6 --- /dev/null +++ b/sys/auth/elogind/remove-polkit-gobject-1-check.patch @@ -0,0 +1,54 @@ +From: Jakub Jirutka +Date: Wed, 20 Oct 2021 00:18:47 +0200 +Subject: [PATCH] Remove build-time check for polkit-gobject-1 + +polkit-gobject-1 is actually not needed for building elogind with PolKit +support; elogind binaries are not dynamically linked against polkit +libraries, there's only runtime dependency. + +I've verified that building without polkit-dev installed won't change the +resulting binaries. + +We need to remove polkit-dev dependency from elogind to avoid circular +dependency between polkit and elogind. + +See: https://gitlab.alpinelinux.org/alpine/aports/-/issues/13095 + +--- a/meson.build ++++ b/meson.build +@@ -1148,21 +1148,21 @@ + install_polkit_pkla = false + if want_polkit != 'false' and not skip_deps + install_polkit = true +- +- libpolkit = dependency('polkit-gobject-1', +- required : false) +- if libpolkit.found() and libpolkit.version().version_compare('< 0.106') +- message('Old polkit detected, will install pkla files') +- install_polkit_pkla = true +- endif ++# XXX-Patched: libpolkit is actually not needed for building with polkit support ++# libpolkit = dependency('polkit-gobject-1', ++# required : false) ++# if libpolkit.found() and libpolkit.version().version_compare('< 0.106') ++# message('Old polkit detected, will install pkla files') ++# install_polkit_pkla = true ++# endif + #if 1 /// Disable polkit completely if libpolkit is not there. See elogind issue #167 +- if not libpolkit.found() +- if want_polkit != 'auto' +- error('Polkit requested but libpolkit was not found.') +- endif +- install_polkit = false +- want_polkit = false +- endif ++# if not libpolkit.found() ++# if want_polkit != 'auto' ++# error('Polkit requested but libpolkit was not found.') ++# endif ++# install_polkit = false ++# want_polkit = false ++# endif + #endif // 1 + endif + conf.set10('ENABLE_POLKIT', install_polkit) diff --git a/sys/auth/elogind/systemd.pc b/sys/auth/elogind/systemd.pc new file mode 100644 index 00000000..4fef4fcf --- /dev/null +++ b/sys/auth/elogind/systemd.pc @@ -0,0 +1,101 @@ +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +# Names with prefixes are preferred, and the run-together names should be +# considered deprecated (though there is no plan to remove them). New names +# shall have underscores. + +prefix=/usr +root_prefix=/ +rootprefix=${root_prefix} +sysconf_dir=/etc +sysconfdir=${sysconf_dir} + +systemd_util_dir=${root_prefix}/lib/systemd +systemdutildir=${systemd_util_dir} + +systemd_system_unit_dir=${rootprefix}/lib/systemd/system +systemdsystemunitdir=${systemd_system_unit_dir} + +systemd_system_preset_dir=${rootprefix}/lib/systemd/system-preset +systemdsystempresetdir=${systemd_system_preset_dir} + +systemd_user_unit_dir=/usr/lib/systemd/user +systemduserunitdir=${systemd_user_unit_dir} + +systemd_user_preset_dir=/usr/lib/systemd/user-preset +systemduserpresetdir=${systemd_user_preset_dir} + +systemd_system_conf_dir=${sysconfdir}/systemd/system +systemdsystemconfdir=${systemd_system_conf_dir} + +systemd_user_conf_dir=${sysconfdir}/systemd/user +systemduserconfdir=${systemd_user_conf_dir} + +systemd_system_unit_path=${systemd_system_conf_dir}:/etc/systemd/system:/run/systemd/system:/usr/local/lib/systemd/system:${systemd_system_unit_dir}:/usr/lib/systemd/system:/lib/systemd/system +systemdsystemunitpath=${systemd_system_unit_path} + +systemd_user_unit_path=${systemd_user_conf_dir}:/etc/systemd/user:/run/systemd/user:/usr/local/lib/systemd/user:/usr/local/share/systemd/user:${systemd_user_unit_dir}:/usr/lib/systemd/user:/usr/share/systemd/user +systemduserunitpath=${systemd_user_unit_path} + +systemd_system_generator_dir=${root_prefix}/lib/systemd/system-generators +systemdsystemgeneratordir=${systemd_system_generator_dir} + +systemd_user_generator_dir=/usr/lib/systemd/user-generators +systemdusergeneratordir=${systemd_user_generator_dir} + +systemd_system_generator_path=/run/systemd/system-generators:/etc/systemd/system-generators:/usr/local/lib/systemd/system-generators:${systemd_system_generator_dir} +systemdsystemgeneratorpath=${systemd_system_generator_path} + +systemd_user_generator_path=/run/systemd/user-generators:/etc/systemd/user-generators:/usr/local/lib/systemd/user-generators:${systemd_user_generator_dir} +systemdusergeneratorpath=${systemd_user_generator_path} + +systemd_sleep_dir=${root_prefix}/lib/systemd/system-sleep +systemdsleepdir=${systemd_sleep_dir} + +systemd_shutdown_dir=${root_prefix}/lib/systemd/system-shutdown +systemdshutdowndir=${systemd_shutdown_dir} + +tmpfiles_dir=/usr/lib/tmpfiles.d +tmpfilesdir=${tmpfiles_dir} + +sysusers_dir=${rootprefix}/lib/sysusers.d +sysusersdir=${sysusers_dir} + +sysctl_dir=${rootprefix}/lib/sysctl.d +sysctldir=${sysctl_dir} + +binfmt_dir=${rootprefix}/lib/binfmt.d +binfmtdir=${binfmt_dir} + +modules_load_dir=${rootprefix}/lib/modules-load.d +modulesloaddir=${modules_load_dir} + +catalog_dir=/usr/lib/systemd/catalog +catalogdir=${catalog_dir} + +system_uid_max=9999 +systemuidmax=${system_uid_max} +system_gid_max=9999 +systemgidmax=${system_gid_max} + +dynamic_uid_min=0 +dynamicuidmin=${dynamic_uid_min} +dynamic_uid_max=0 +dynamicuidmax=${dynamic_uid_max} + +container_uid_base_min=0 +containeruidbasemin=${container_uid_base_min} +container_uid_base_max=9999 +containeruidbasemax=${container_uid_base_max} + +Name: systemd +Description: systemd Library +URL: https://github.com/elogind/elogind +Version: 999.99 diff --git a/sys/auth/elogind/ympbuild b/sys/auth/elogind/ympbuild new file mode 100644 index 00000000..d5d83aa5 --- /dev/null +++ b/sys/auth/elogind/ympbuild @@ -0,0 +1,71 @@ +#!/usr/bin/env bash +name='elogind' +release='1' +version='246.10' +url='https://github.com/elogind/elogind' +description="he systemd project's logind, extracted to a standalone package" +email='aliriza.keskin@pardus.org.tr' +maintainer='aliriza' +license=('GPLv3') +source=("https://github.com/elogind/elogind/archive/refs/tags/v$version.tar.gz" + "remove-polkit-gobject-1-check.patch" + "elogind.initd" + "systemd.pc") +depends=(acl attr audit libcap-ng libcap dbus pam) +makedepends=() +md5sums=('32ab2201281f14738d9c045f3669c14d' + 'SKIP' + 'SKIP' + 'SKIP') +group=(sys.auth) +uses=() +arch=('x86_64') + +cd $name-$version + +prepare(){ + patch -Np1 -i ../remove-polkit-gobject-1-check.patch +} + +setup(){ + meson setup build --prefix=/usr \ + --libdir=/lib64/ \ + -Dudevrulesdir=/lib64/udev/rules.d \ + -Dcgroup-controller=elogind \ + -Dhalt-path=/sbin/halt \ + -Drootlibexecdir=/usr/libexec/elogind \ + -Dreboot-path=/sbin/reboot \ + -Ddefault-hierarchy=hybrid \ + -Ddefault-kill-user-processes=false \ + -Dpam=true \ + -Dselinux=false \ + -Daudit=true \ + -Dpolkit=true +} + +build(){ + ninja -C build +} + +package(){ + ninja -C build install + + # Claim compatiblity with systemd and systemd-logind (thanks Alpine linux) + ln -s libelogind.pc "$DESTDIR"/lib64/pkgconfig/libsystemd.pc + ln -s libelogind.pc "$DESTDIR"/lib64/pkgconfig/libsystemd-logind.pc + ln -s elogind "$DESTDIR"/usr/include/systemd + # Extra compatiblity support + ln -s libelogind.so.0 "$DESTDIR"/lib64/libsystemd.so.0 + ln -s libelogind.so.0 "$DESTDIR"/lib64/libsystemd.so.0.35.0 + ln -s pam_elogind.so "$DESTDIR"/lib64/security/pam_systemd.so + install ../systemd.pc "$DESTDIR"/lib64/pkgconfig/ + + # Install headers from elogind + install -Dm644 src/systemd/sd-id128.h "$DESTDIR"/usr/include/sd-id128.h + install -Dm644 src/systemd/_sd-common.h "$DESTDIR"/usr/include/_sd-common.h + + # openrc service + mkdir -p "${DESTDIR}"/etc/init.d + install ../elogind.initd "${DESTDIR}"/etc/init.d/elogind +} +