sys-auth/consolekit: [QA] inherit ltprune.eclass directly
[gentoo.git] / sys-auth / consolekit / consolekit-1.2.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 inherit autotools libtool linux-info ltprune pam xdg-utils
6
7 MY_PN=ConsoleKit2
8 MY_P=${MY_PN}-${PV}
9
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"
13
14 LICENSE="GPL-2"
15 SLOT="0"
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 )"
19
20 COMMON_DEPEND=">=dev-libs/glib-2.40:2=[dbus]
21         >=sys-devel/gettext-0.19
22         sys-apps/dbus
23         sys-libs/zlib:=
24         x11-libs/libX11:=
25         acl? (
26                 sys-apps/acl:=
27                 >=virtual/udev-200
28                 )
29         cgroups? (
30                 app-admin/cgmanager
31                 >=sys-libs/libnih-1.0.2[dbus]
32                 )
33         evdev? ( dev-libs/libevdev:= )
34         udev? (
35                 virtual/libudev
36                 x11-libs/libdrm:=
37         )
38         pam? ( sys-libs/pam )
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}
47         dev-libs/libxslt
48         virtual/pkgconfig
49         doc? ( app-text/xmlto )
50         test? (
51                 app-text/docbook-xml-dtd:4.1.2
52                 app-text/xmlto
53                 )"
54
55 S=${WORKDIR}/${MY_P}
56
57 QA_MULTILIB_PATHS="usr/lib/ConsoleKit/.*"
58
59 pkg_setup() {
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"
65                 linux-info_pkg_setup
66         fi
67 }
68
69 src_prepare() {
70         xdg_environment_reset
71
72         sed -i -e '/SystemdService/d' data/org.freedesktop.ConsoleKit.service.in || die
73
74         default
75         # patch needs autoreconf, so dont need libtoolize
76         eautoreconf
77         #elibtoolize # bug 593314
78 }
79
80 src_configure() {
81         econf \
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) \
88                 $(use_enable debug) \
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
101 }
102
103 src_install() {
104         emake \
105                 DESTDIR="${D}" \
106                 htmldocdir="${EPREFIX}"/usr/share/doc/${PF}/html \
107                 install
108
109         dosym /usr/lib/ConsoleKit /usr/lib/${PN}
110
111         dodoc AUTHORS HACKING NEWS README TODO
112
113         newinitd "${FILESDIR}"/${PN}-1.0.0.initd consolekit
114
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
119
120         exeinto /etc/X11/xinit/xinitrc.d
121         newexe "${FILESDIR}"/90-consolekit-3 90-consolekit
122
123         if use kernel_linux; then
124                 # bug 571524
125                 exeinto /usr/lib/ConsoleKit/run-session.d
126                 doexe "${FILESDIR}"/pam-foreground-compat.ck
127         fi
128
129         prune_libtool_files --all # --all for pam_ck_connector.la
130
131         rm -rf "${ED}"/var/run || die # let the init script create the directory
132 }