1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 if [[ ${PV} = *9999* ]]; then
7 EGIT_BRANCH="v241-stable"
8 EGIT_REPO_URI="https://github.com/elogind/elogind.git"
11 SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
12 KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
15 inherit linux-info meson pam udev xdg-utils
17 DESCRIPTION="The systemd project's logind, extracted to a standalone package"
18 HOMEPAGE="https://github.com/elogind/elogind"
20 LICENSE="CC0-1.0 LGPL-2.1+ public-domain"
22 IUSE="+acl debug doc +pam +policykit selinux"
25 app-text/docbook-xml-dtd:4.2
26 app-text/docbook-xml-dtd:4.5
27 app-text/docbook-xsl-stylesheets
38 selinux? ( sys-libs/libselinux )
45 policykit? ( sys-auth/polkit )
48 DOCS=( README.md src/libelogind/sd-bus/GVARIANT-SERIALIZATION )
51 "${FILESDIR}/${P}-nodocs.patch"
52 "${FILESDIR}/${PN}-241.4-broken-test.patch" # bug 699116
56 local CONFIG_CHECK="~CGROUPS ~EPOLL ~INOTIFY_USER ~SIGNALFD ~TIMERFD"
58 use kernel_linux && linux-info_pkg_setup
67 local rccgroupmode="$(grep rc_cgroup_mode ${EPREFIX}/etc/rc.conf | cut -d '"' -f 2)"
68 local cgroupmode="legacy"
70 if [[ "xhybrid" = "x${rccgroupmode}" ]] ; then
72 elif [[ "xunified" = "x${rccgroupmode}" ]] ; then
77 -Ddocdir="${EPREFIX}/usr/share/doc/${PF}"
78 -Dhtmldir="${EPREFIX}/usr/share/doc/${PF}/html"
79 -Dpamlibdir=$(getpam_mod_dir)
80 -Dudevrulesdir="${EPREFIX}$(get_udevdir)"/rules.d
81 --libdir="${EPREFIX}"/usr/$(get_libdir)
82 -Drootlibdir="${EPREFIX}"/$(get_libdir)
83 -Drootlibexecdir="${EPREFIX}"/$(get_libdir)/elogind
84 -Drootprefix="${EPREFIX}/"
85 -Dbashcompletiondir="${EPREFIX}/usr/share/bash-completion/completions"
88 -Dcgroup-controller=openrc
89 -Ddefault-hierarchy=${cgroupmode}
90 -Ddefault-kill-user-processes=false
91 -Dacl=$(usex acl true false)
92 --buildtype $(usex debug debug release)
93 -Dhtml=$(usex doc auto false)
94 -Dpam=$(usex pam true false)
95 -Dselinux=$(usex selinux true false)
96 -Dutmp=$(usex elibc_musl false true)
103 DOCS+=( src/libelogind/sd-bus/GVARIANT-SERIALIZATION )
107 newinitd "${FILESDIR}"/${PN}.init ${PN}
109 sed -e "s/@libdir@/$(get_libdir)/" "${FILESDIR}"/${PN}.conf.in > ${PN}.conf || die
110 newconfd ${PN}.conf ${PN}
114 if [[ "$(rc-config list boot | grep elogind)" != "" ]]; then
115 elog "elogind is currently started from boot runlevel."
116 elif [[ "$(rc-config list default | grep elogind)" != "" ]]; then
117 ewarn "elogind is currently started from default runlevel."
118 ewarn "Please remove elogind from the default runlevel and"
119 ewarn "add it to the boot runlevel by:"
120 ewarn "# rc-update del elogind default"
121 ewarn "# rc-update add elogind boot"
123 elog "elogind is currently not started from any runlevel."
124 elog "You may add it to the boot runlevel by:"
125 elog "# rc-update add elogind boot"
127 elog "Alternatively, you can leave elogind out of any"
128 elog "runlevel. It will then be started automatically"
130 elog "when the first service calls it via dbus, or"
131 elog "the first user logs into the system."
133 elog "when the first service calls it via dbus."