1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit linux-info meson pam udev xdg-utils
8 DESCRIPTION="The systemd project's logind, extracted to a standalone package"
9 HOMEPAGE="https://github.com/elogind/elogind"
10 SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
12 LICENSE="CC0-1.0 LGPL-2.1+ public-domain"
14 KEYWORDS="~amd64 ~arm ~x86"
15 IUSE="+acl debug doc +pam +policykit selinux"
23 selinux? ( sys-libs/libselinux )
25 DEPEND="${COMMON_DEPEND}
26 app-text/docbook-xml-dtd:4.2
27 app-text/docbook-xml-dtd:4.5
28 app-text/docbook-xsl-stylesheets
34 RDEPEND="${COMMON_DEPEND}
39 policykit? ( sys-auth/polkit )
42 DOCS=( src/libelogind/sd-bus/GVARIANT-SERIALIZATION )
44 PATCHES=( "${FILESDIR}/${P}-docs.patch" )
47 local CONFIG_CHECK="~CGROUPS ~EPOLL ~INOTIFY_USER ~SIGNALFD ~TIMERFD"
49 if use kernel_linux; then
60 local rccgroupmode="$(grep rc_cgroup_mode /etc/rc.conf | cut -d '"' -f 2)"
61 local cgroupmode="legacy"
63 if [[ "xhybrid" = "x${rccgroupmode}" ]] ; then
65 elif [[ "xunified" = "x${rccgroupmode}" ]] ; then
70 -Ddocdir="${EPREFIX}/usr/share/doc/${PF}"
71 -Dhtmldir="${EPREFIX}/usr/share/doc/${PF}/html"
72 -Dpamlibdir=$(getpam_mod_dir)
73 -Dudevrulesdir="$(get_udevdir)"/rules.d
74 --libdir="${EPREFIX}"/usr/$(get_libdir)
75 -Drootlibdir="${EPREFIX}"/$(get_libdir)
76 -Drootlibexecdir="${EPREFIX}"/$(get_libdir)/elogind
77 -Drootprefix="${EPREFIX}/"
78 -Dbashcompletiondir="${EPREFIX}/usr/share/bash-completion/completions"
81 -Dcgroup-controller=openrc
82 -Ddefault-hierarchy=${cgroupmode}
83 -Ddefault-kill-user-processes=false
84 -Dacl=$(usex acl true false)
85 -Ddebug=$(usex debug elogind false)
86 --buildtype $(usex debug debug release)
87 -Dhtml=$(usex doc auto false)
88 -Dpam=$(usex pam true false)
89 -Dselinux=$(usex selinux true false)
96 DOCS+=( src/libelogind/sd-bus/GVARIANT-SERIALIZATION )
100 newinitd "${FILESDIR}"/${PN}.init ${PN}
102 sed -e "s/@libdir@/$(get_libdir)/" "${FILESDIR}"/${PN}.conf.in > ${PN}.conf || die
103 newconfd ${PN}.conf ${PN}
107 if [[ "$(rc-config list boot | grep elogind)" != "" ]]; then
108 elog "elogind is currently started from boot runlevel."
109 elif [[ "$(rc-config list default | grep elogind)" != "" ]]; then
110 ewarn "elogind is currently started from default runlevel."
111 ewarn "Please remove elogind from the default runlevel and"
112 ewarn "add it to the boot runlevel by:"
113 ewarn "# rc-update del elogind default"
114 ewarn "# rc-update add elogind boot"
116 ewarn "elogind is currently not started from any runlevel."
117 ewarn "You may add it to the boot runlevel by:"
118 ewarn "# rc-update add elogind boot"