1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 inherit autotools libtool linux-info ltprune pam xdg-utils
10 DESCRIPTION="Framework for defining and tracking users, login sessions and seats"
11 HOMEPAGE="https://github.com/ConsoleKit2/ConsoleKit2 https://www.freedesktop.org/wiki/Software/ConsoleKit"
12 SRC_URI="https://github.com/${MY_PN}/${MY_PN}/releases/download/${PV}/${MY_P}.tar.bz2"
16 KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ia64 ppc ppc64 s390 ~sparc x86 ~amd64-linux ~x86-linux"
17 IUSE="acl cgroups debug doc evdev kernel_linux pam pm-utils policykit selinux test udev"
18 RESTRICT="!test? ( test )"
20 COMMON_DEPEND=">=dev-libs/glib-2.40:2=[dbus]
21 >=sys-devel/gettext-0.19
31 >=sys-libs/libnih-1.0.2[dbus]
33 evdev? ( dev-libs/libevdev:= )
39 policykit? ( >=sys-auth/polkit-0.110 )
40 selinux? ( sys-libs/libselinux )"
41 # pm-utils: bug 557432
42 RDEPEND="${COMMON_DEPEND}
43 kernel_linux? ( sys-apps/coreutils[acl?] )
44 pm-utils? ( sys-power/pm-utils )
45 selinux? ( sec-policy/selinux-consolekit )"
46 DEPEND="${COMMON_DEPEND}
49 doc? ( app-text/xmlto )
51 app-text/docbook-xml-dtd:4.1.2
57 QA_MULTILIB_PATHS="usr/lib/ConsoleKit/.*"
60 if use kernel_linux; then
61 # This is from https://bugs.gentoo.org/376939
62 use acl && CONFIG_CHECK="~TMPFS_POSIX_ACL"
63 # This is required to get login-session-id string with pam_ck_connector.so
64 use pam && CONFIG_CHECK+=" ~AUDITSYSCALL"
72 sed -i -e '/SystemdService/d' data/org.freedesktop.ConsoleKit.service.in || die
75 # patch needs autoreconf, so dont need libtoolize
77 #elibtoolize # bug 593314
82 XMLTO_FLAGS='--skip-validation' \
83 --libexecdir="${EPREFIX}"/usr/lib/ConsoleKit \
84 --localstatedir="${EPREFIX}"/var \
85 $(use_enable pam pam-module) \
86 $(use_enable doc docbook-docs) \
87 $(use_enable test docbook-docs) \
89 $(use_enable policykit polkit) \
90 $(use_enable evdev libevdev) \
91 $(use_enable acl udev-acl) \
92 $(use_enable cgroups libcgmanager) \
93 $(use_enable selinux libselinux) \
94 $(use_enable udev libdrm) \
95 $(use_enable udev libudev) \
96 $(use_enable test tests) \
97 --with-dbus-services="${EPREFIX}"/usr/share/dbus-1/services \
98 --with-pam-module-dir="$(getpam_mod_dir)" \
99 --with-xinitrc-dir="${EPREFIX}"/etc/X11/xinit/xinitrc.d \
100 --without-systemdsystemunitdir
106 htmldocdir="${EPREFIX}"/usr/share/doc/${PF}/html \
109 dosym /usr/lib/ConsoleKit /usr/lib/${PN}
111 dodoc AUTHORS HACKING NEWS README TODO
113 newinitd "${FILESDIR}"/${PN}-1.0.0.initd consolekit
115 keepdir /usr/lib/ConsoleKit/run-seat.d
116 keepdir /usr/lib/ConsoleKit/run-session.d
117 keepdir /etc/ConsoleKit/run-session.d
118 keepdir /var/log/ConsoleKit
120 exeinto /etc/X11/xinit/xinitrc.d
121 newexe "${FILESDIR}"/90-consolekit-3 90-consolekit
123 if use kernel_linux; then
125 exeinto /usr/lib/ConsoleKit/run-session.d
126 doexe "${FILESDIR}"/pam-foreground-compat.ck
129 prune_libtool_files --all # --all for pam_ck_connector.la
131 rm -rf "${ED}"/var/run || die # let the init script create the directory