summaryrefslogtreecommitdiff
path: root/sys-auth/consolekit
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-auth/consolekit
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-auth/consolekit')
-rw-r--r--sys-auth/consolekit/Manifest28
-rw-r--r--sys-auth/consolekit/consolekit-0.4.6.ebuild124
-rw-r--r--sys-auth/consolekit/consolekit-1.0.1.ebuild116
-rw-r--r--sys-auth/consolekit/consolekit-1.1.0-r1.ebuild119
-rw-r--r--sys-auth/consolekit/consolekit-1.1.0.ebuild116
-rw-r--r--sys-auth/consolekit/consolekit-1.1.1.ebuild130
-rw-r--r--sys-auth/consolekit/consolekit-1.1.2.ebuild130
-rw-r--r--sys-auth/consolekit/consolekit-1.2.0.ebuild131
-rw-r--r--sys-auth/consolekit/consolekit-9999.ebuild127
-rw-r--r--sys-auth/consolekit/files/90-consolekit-332
-rw-r--r--sys-auth/consolekit/files/consolekit-0.2.rc25
-rw-r--r--sys-auth/consolekit/files/consolekit-0.4.5-polkit-automagic.patch30
-rw-r--r--sys-auth/consolekit/files/consolekit-1.0.0.initd16
-rw-r--r--sys-auth/consolekit/files/consolekit-1.1.0-Remove-the-root-restriction-for-runtime-dirs.patch57
-rw-r--r--sys-auth/consolekit/files/consolekit-1.1.1-0001-Fix-enable-libudev-configure-flag.patch41
-rw-r--r--sys-auth/consolekit/files/consolekit-cleanup_console_tags.patch67
-rw-r--r--sys-auth/consolekit/files/consolekit-shutdown-reboot-without-policies.patch26
-rw-r--r--sys-auth/consolekit/files/consolekit-udev-acl-install_to_usr.patch28
-rw-r--r--sys-auth/consolekit/files/pam-foreground-compat.ck17
-rw-r--r--sys-auth/consolekit/metadata.xml22
20 files changed, 1382 insertions, 0 deletions
diff --git a/sys-auth/consolekit/Manifest b/sys-auth/consolekit/Manifest
new file mode 100644
index 000000000000..aa212cd312db
--- /dev/null
+++ b/sys-auth/consolekit/Manifest
@@ -0,0 +1,28 @@
+AUX 90-consolekit-3 1027 SHA256 91e0900995f7db536220065959d236fb75ec2c77096981a142e2e948518d9761 SHA512 2a1273d775aeb69a3e0873d6a82868d909cdbc3d5003b7625ab12e76ef44f115b464514e7890f7e562c44a92383475e698c3679f6c9f1bf42b5199d03d8c604a WHIRLPOOL 85fd88509ab68a8cdc069e078f4f944c87688fc26b9414ca5556057c90c9ef96382e88f4df3ad1415547cb1abd1f2b4b50518984a314fe1430d4de5d3d63dbd2
+AUX consolekit-0.2.rc 513 SHA256 3843cf3025c974b4cff5923c1e6cce7d41265357090172e0296a8d44971305cc SHA512 09263369d9769d34305c716ab107a01227b615d2cca4ff067fbc629d15fa5b478dcb70f505b8b981eaf9baef41ba2de7f09a356efd2ce9cb0924de5154c8fdc7 WHIRLPOOL 8f42e7dbd7d79a1087e9b5c61700f3a7005864c03edb14538f01eee5cdacc6189007a81ea75137b471e4319588b55a74a97a617b319f0ecd554b441cff606d28
+AUX consolekit-0.4.5-polkit-automagic.patch 870 SHA256 7cd8e4ecc868b0d2566cc0d0b7b3d13a006fe55ff425314d15ecff83e550d184 SHA512 50c2bafe2bf995bd5ef863557a1783211e172d77d819c8001c9007b4833b4e6b3ccfa7c04bf6811086dff6371be488411fdd23a49cecec3f545c388a0bbd61ab WHIRLPOOL 5611fdb8f17afd662ce0f745334dcbbb606fb8247ae18f914ae233cb7c024f418b94b4e353d6513c67c4346475af98d02d5551b4cb88e511df21eb765cbd1cb7
+AUX consolekit-1.0.0.initd 360 SHA256 08d4123fc501ccf7087ea439ba6109b46daf1cd4bfb03138b0d18dfd09bfc43e SHA512 68cbc15ea711c8cfbd810627912a1fa050b076804013e35a370ded64affe7458db6f89e9f4436a685fa8ccd4840f299790e9e2641ecf474bd029254f7198067b WHIRLPOOL 6fe49d6fd89788fd4e119f1ec87894522c5a7040303348f4b411444004d3b032225200b721a81f8c42a1ab726f15fd713898953c089b62cc28f3ab92586b3dfe
+AUX consolekit-1.1.0-Remove-the-root-restriction-for-runtime-dirs.patch 1640 SHA256 a7f273efeef9270a991563ca86c9925643d054daebdd794ad59d30008b883942 SHA512 a56ff368c1a674d4088a68db972bcb15c0107339704063839cf6b024eee000cff36dc9e39886f59ace3f5aefc4807de126225960e90b49b1d53bcd1674fc5d71 WHIRLPOOL a03574b6a2bd48a281e1e2e9454ffbc6b9790c6fd067f1b15306326f3a15a197d269209b10c8f512801842d5305ce7c7224646352c5bd979f57a3d88d0ec7050
+AUX consolekit-1.1.1-0001-Fix-enable-libudev-configure-flag.patch 1610 SHA256 9ee9a380fa038bf52e52858bfe8864cedfa687bae1296a1b3a32cb765603d944 SHA512 ee418e6fef34b42995aeb92e4b2e22751110887833ec5d6703bb9b84b4bde94e5eea1c2f4a781575a92413cd48426132cb21c4974434065a56e2b4ddfc706a77 WHIRLPOOL 7ee88ccc77e2bf387cc2ddc260d54b50c686f79f7fdd43e45535dca6c365ccf6711f182a6b9e96052f87b54fb6eed169c96a26f2788edac27d2baba79f6d5f22
+AUX consolekit-cleanup_console_tags.patch 1596 SHA256 178d25a93bc04b070840650b6f847b018796186d2a54a3be7b0a6df75e8f501c SHA512 8639c45baefc5fa4751654345225029b455e9a5ee5be5835c69ff0d6bf3532fc1ccf606fdb0cd29849071a26ab3defff8f7e31d19e83117dfe467b6209a37a77 WHIRLPOOL 2bf35176a05687402b333d74497dd3d2340ede2d55fe068926d3267d921adeef7f5333435f34d9eec1813c1fc0f8fcdc0b0ee979439f6f27ef86aeae620e96fb
+AUX consolekit-shutdown-reboot-without-policies.patch 924 SHA256 cd9a2aa582644ad50fb98e4580b9cf889c71a40f637eb0beb0eaab96d3ad9a47 SHA512 7bca0a448329cabbaa42028e212edc4ae242dcef9947cc2d49e66280cfae1193aedcac9921be90b9dd24265c17c3c53876bbea1ca223906a20252d94c4d65a9c WHIRLPOOL 56aa6327a226255ae01cc2c0298b658daf1f21dc8d54269b105aa6b490f815df0aac02604a82c01c2c4fd3d3f7899482df1596dffa10b6aa7b13b136fa3fcb3c
+AUX consolekit-udev-acl-install_to_usr.patch 750 SHA256 823316f6898eaab0744e42fa11b1631f64187aebca35baa5aeab09279820bedd SHA512 d2d6fcedea5e72f5a1b387f411ac62a59fd3c9e90a318bd85c35d210b89b18f01511f6b05352c1a4a9508622f0b9242c1b9c15d5ae4f8adf2819b6c3a0ff5ac9 WHIRLPOOL a9b8f48c5dddabfa28c2a65ac99c10dd7cba41d8bdcdc1fac4a0932391a81d9ed87f34115d7a43611d2cd126d10a5378edb8e734c888d529eca4b0d20dd15ac1
+AUX pam-foreground-compat.ck 389 SHA256 0b5b22641e2b138f4e9dfff9790df9fedaf2f760cc3d878ee1e94c2fd52edea9 SHA512 3cabd23ff7dc5de0a86284c3a3d3ff923228969cc954a1036290d4f7f6d58646ea6ea1445f472476b6f319df4dcd22f71e5e0f5cc8c845cd7e0b148af689ce5a WHIRLPOOL a8e36292dc094e107492e65efd147b35e217c652c8bcc52c768942b15660ff7d251e55ee038ce326905f5dc8f17857b62725768d60c3d5c93927550c8ff47db2
+DIST ConsoleKit-0.4.6.tar.xz 366572 SHA256 b41d17e06f80059589fbeefe96ad07bcc564c49e65516da1caf975146475565c SHA512 54955e3e83778a9216846104da8762fd50a37190e209127dd5d211e2227da617e14f6f5c1359905396d299656e526d14e1187b28eaff7d0ae1d7563dc8d9b46d WHIRLPOOL ebf36b109b4c646d0b874f6b8e2ae9e2d190022ee9b6feff6cbb6b9203c80401c538cc3ca674fa7bde4f07e658d5460864e9784c1e0249d49b4784725a4e05c7
+DIST ConsoleKit2-1.0.1.tar.bz2 1192681 SHA256 741c53321a0792b165f386c73c668af25615accab6d15983290103348a3ff00c SHA512 028e7347ff7293ebf3d08541d801e987cbc82fb31d98b67aa23e6dc28d00a422db9591c716c568320b6dde3fa01eb0b77b43c06d230f4bedd1085e078848a202 WHIRLPOOL c555281cd177ed243b1beb3d07d2988d029d8d89cac5242d12dcc37270d2d7adb1d503eaeba2f466964b589c4d10b8f2f014fef7067b535a7be9a360612d0485
+DIST ConsoleKit2-1.1.0.tar.bz2 630178 SHA256 a40d92358aca9f627a224dca674090e310423b00ed63fc06482997611661b69b SHA512 14ded07d4140e7a31132de21e84c2878475676b8c98f72b42340708972ed384abb9ba9380d74719718fc220c001387c788cf709cd15f8b19d598467dfe8a57df WHIRLPOOL 8f08d81576b5121b2da6cd94b3b5675ea55dce17997b035d0ba451c011b101f9e315e983b20610ee022ee286b50a7b13e2508584b9c08dba0c6cda20b8801a63
+DIST ConsoleKit2-1.1.1.tar.bz2 1372801 SHA256 795b2cfb766bdffb9187ef7f8beb8d8298e4c38df4a69377115297a0dee3b0d0 SHA512 168af9760e10914dff5e693d2c3b2e2a35b1662fc2769e2954eec0238f7f313ff154add650fa6f0f59e73e4e0aec2fe63ff62446a3c73c2d4437408e69aa97b6 WHIRLPOOL cef8ac778923671f9bffe87ecd8045b30630578e2599d0ccf37ad8d8070b7c0ca6936e9837abc5fc1f7af5f119edfeae68d9a14199485936677a5faba09b0958
+DIST ConsoleKit2-1.1.2.tar.bz2 1125567 SHA256 f4b26b45edf7416ed76052b8f85ea05b7b560c744edee8042575667528bc1f24 SHA512 fadca85e05c176b06ead40fba5c068d497bf69bcc322287363d0c27cdd6627b758295db1ef534b908c0e6240486430d8cb36660b4d71216a60d19a52d6d0db39 WHIRLPOOL b9655418498cb2b63a30d6d1a56f6afe0adf8f6ae3a6aa97fc55da8288fae588deea04ab868f0ef524e185696ad87a35aca6de8eb4e6cb32bc4ba729040e0cbb
+DIST ConsoleKit2-1.2.0.tar.bz2 1125402 SHA256 d6ea13b306557a76519388de39bf7f1a1ea9010af147fad4fb3131ce634bd8b3 SHA512 c0f6e629b7229c2ffaafe8da899970b48c8372402447af18560fffd8804d9ab91a4ad2eb82c8f648a14807f8ccc5fb1ab4366de14faa8a2d5fb3767a6a4253f7 WHIRLPOOL 46c463fbfafd188dcaecc61f3ce83599a746e18b4c3ea129a205fec24927cc80958decf95913de679ddded0120e15fb631dcdeb08fd09a0029350b70b8b8ecd9
+DIST consolekit_0.4.6-4.debian.tar.gz 12192 SHA256 6d4dd5e13a76454b4bab27ab6b407718cd77616afd2b1af7cb8d947c1323b802 SHA512 f7fc5965b1f495d16a8ca167940431bc2569e9bde9e4a356b9c9ed00c2825db61da7b6db3d434d977fff72b3aaef30c455a365b9eba282a887a523753613b58f WHIRLPOOL 961a918c21259e24c68c7a5bf93964825b891ea207c088fecab61f81434012dc8925fca83b74518cfc9cf42f2c4a87eba7518c0829f663716ca0e11e38c856c9
+EBUILD consolekit-0.4.6.ebuild 3396 SHA256 69aee2e526d17e7be61d82199e0b9ae1d6d52431ec0c97bcb06b842966d3d69c SHA512 2a0acd029eb9db8d3035d0fbdc52e5c0cf6a84779dfd41d7175970b8c4ff8600292302740d375eacf8fa0939714d82c3c602f285abf811fa36e29c3e41eb7e3a WHIRLPOOL 1789b31faffc8d565650562fa2e1f0ab7e07b49c689a45bf1b5d54447f890161dc97d08da6662644b1affc0b6eb4fe61d915c766465644d8001226d7093efb13
+EBUILD consolekit-1.0.1.ebuild 3104 SHA256 8f4b8990ba7d781aa6d881fae13e943a3e072b55f19ac3d4bed004f751dd92a0 SHA512 4bf6bd62eba5e480d710235cef658516afb119b53157eee51ef6ec20f28ca91fdddb290c34201e598a46aeb82d4f9fcb42da224c8bed0446a818b857a121a31c WHIRLPOOL 07dc530b15bf56776811f3810fc0fd99953619f41d80539573e42c554d6c08a7772cf5b80fbbd20fbea43a608a6625d9c8646e5ae95705c492e4e98304ede4ee
+EBUILD consolekit-1.1.0-r1.ebuild 3238 SHA256 bb02ece53c8df44c4e9231c69858668ee1c62bcbd0cfe9ef8d67921ac1d806f7 SHA512 d124ec42562ab4bb87e34344dd165a70f5fb0116f016d901dd6f2cfa3123540f72ec1466c0c40406f9b1a7629c4a2854c8905ba24984851cf4acfdcd1a3226b8 WHIRLPOOL 85796ca9fc312ee227ab6b47eb71d861354030f7621feab62d723335df034b02da369acc1b40cfe8661981120733d68abf5e3d195a861576583062c8228b8212
+EBUILD consolekit-1.1.0.ebuild 3099 SHA256 57f61a91d8df4e82e8725f71326b05246d55025fade6de68ec63ee054e73a8ef SHA512 dd4750b57e2cc646cf5ca7ea541a94a35f4be52aa89efa6e805df80532573b044e3a4236aa4b95b40455f991e3dc6c18f2fc71f9711c193108ad4179be014984 WHIRLPOOL b566a0056a4bdf8fda5225e6d3cc63582301eac726a062c816c45b845765554ccba9d522f23d62548ff0449bd75749214bff8161ac72f19693b5afc2fe0e6ef3
+EBUILD consolekit-1.1.1.ebuild 3545 SHA256 1deee9c0995c6440c8e6cc612c29d27ba08dfcc915f5dd0126dbe018cd7dcf51 SHA512 a77a489d2ed4696e4ac883607ea421490c1713fbc8865a36edb90f8a07c171c80522cdff194ff342c72be88328ed9085b40fabf1679203bce5d175efddde432d WHIRLPOOL e7f537d3af33a0c68ee0657f7747afa96fe0d912fe91775956e902d6e83847504ad028aa303a7f628682286e2dac4996599b70a3b46cc645340e2dcbfec24ebd
+EBUILD consolekit-1.1.2.ebuild 3509 SHA256 f42736643f4508f986a03cd897200768b795c7cea5ed2f7c4c418be305e467a4 SHA512 adc57d3ba67df9f06cd6b8facdb6f98ca97f1a1ee5e949809adc5d0fe29b70067194fc207cd81b3f432152c5af0c89a30327f0bff1fa3ee8c4eeabb1da03cbea WHIRLPOOL aa80d6143a1b90e5c463b3a206a800d35e908d675f37bae7cd7df845cd9678cdac293d18b061055d1a38bd0d14e2447e803d2f39388eab191c038442f446222c
+EBUILD consolekit-1.2.0.ebuild 3544 SHA256 e77561272e9d7441d1a1285d7699b569b1e36a3cf295a97edaea77b273d8d960 SHA512 03019491f7e0972f11e0af0f8430bd78537145b52f6ab23e8461fe620fc27d62cebce6781d1f11d0c85246945c71dbe21c86a4c78772eb8057cbbde454f42cda WHIRLPOOL dd83e65f62970ddd72606a00cdd618fdd18ad74e7b6c0a4d8fb7750294a792873fc2667653ed6044c2d1996174679326440c1efbd5423f3b488040a15c285938
+EBUILD consolekit-9999.ebuild 3311 SHA256 2197dd7144686db2715b99f7b718f5089629c8dbe7757d355eea3fc5446e7a77 SHA512 d28c3a5da5ece93cf7e9f22746ffcbd53beee19b9106258c210b4ff937713cff650771cdfd4d2919d4122517f2e534d5e7861d3a8392d4fc4e691e92a25e4b69 WHIRLPOOL 605e200b25ccc2a93b16339d861e9c860708c216f64d1dfd98218ae952d6be4d1e9c768cffe438d3838f42cf4fa2429976493a2fba9d37b5680d1c0b475efe3f
+MISC ChangeLog 11611 SHA256 f404a21305473e08a34ed4cf11635b310df9225f7371b32a614df4d6b78e3ead SHA512 d5ec5fa0ac8691acd134e4bbce34b3ffa762a5a78f6b9354c9388a892277984a986585fea415691437beec2f1bc4f004420cbab5a94c0f4111a3766dcb56bc38 WHIRLPOOL 6d205c944d8926186ce6e1c1824474d79ea8251b25a9dfd3ea8825259c10cd2e8f08fe062dfbe44f95ad0176c175fbb092a0549f5499f75f52821e64c518da6b
+MISC ChangeLog-2015 27717 SHA256 bb12cd6e6784f6f87a420e8cf1dea2e5000c0f87f9ca652702492eb14f116b34 SHA512 e01c42a85818919e57aeb58c7713f3fae740094a743f83f41b6b70cc9b3b537add09b0b7ab3f935bdd033f65efc084113db3f510c69c9009f31f308ce26795b5 WHIRLPOOL 802c7719cb7361cc6c3b9e8640371a389ed3cc250cd3868cf26d078e0022065408c5b3ac69de5f6a71a63ac3e4fee1a39e626eb55df5b3e2412d35bc11335ef5
+MISC metadata.xml 1053 SHA256 d4b913761bdc0507f055edc02d6f0d8b04f5350cfe81a271ebc8086c42ca813c SHA512 866958aa11b4410414886c8de76948212e356bb9784f241238aae0bb1b5cccc39731b660ec7affe88aff1095470c37ff076bd09a7546d202aa7a95acc5748014 WHIRLPOOL 0d52198beac98157581fd20934273fe92cb5efea9c0b2ea9f4b2d9921a073687ae2a2c7063c11f8846423b9733078d0a50913a9949e1cc722bd159e59f05fc75
diff --git a/sys-auth/consolekit/consolekit-0.4.6.ebuild b/sys-auth/consolekit/consolekit-0.4.6.ebuild
new file mode 100644
index 000000000000..3d373c6e8797
--- /dev/null
+++ b/sys-auth/consolekit/consolekit-0.4.6.ebuild
@@ -0,0 +1,124 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit autotools eutils linux-info pam systemd
+
+MY_PN=ConsoleKit
+MY_P=${MY_PN}-${PV}
+
+DESCRIPTION="Framework for defining and tracking users, login sessions and seats"
+HOMEPAGE="https://www.freedesktop.org/wiki/Software/ConsoleKit"
+SRC_URI="https://www.freedesktop.org/software/${MY_PN}/dist/${MY_P}.tar.xz
+ https://launchpad.net/debian/+archive/primary/+files/${PN}_${PV}-4.debian.tar.gz" # for logrotate file
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="acl debug doc kernel_linux pam policykit selinux systemd-units test"
+
+COMMON_DEPEND=">=dev-libs/dbus-glib-0.100:=
+ >=dev-libs/glib-2.38.2-r1:2=
+ sys-libs/zlib:=
+ x11-libs/libX11:=
+ acl? (
+ sys-apps/acl:=
+ >=virtual/udev-200
+ )
+ pam? ( virtual/pam )
+ policykit? ( >=sys-auth/polkit-0.110 )"
+RDEPEND="${COMMON_DEPEND}
+ kernel_linux? ( sys-apps/coreutils[acl?] )
+ selinux? ( sec-policy/selinux-consolekit )"
+DEPEND="${COMMON_DEPEND}
+ dev-libs/libxslt
+ virtual/pkgconfig
+ doc? ( app-text/xmlto )
+ test? (
+ app-text/docbook-xml-dtd:4.1.2
+ app-text/xmlto
+ )"
+
+S=${WORKDIR}/${MY_P}
+
+QA_MULTILIB_PATHS="usr/lib/ConsoleKit/.*"
+
+pkg_setup() {
+ if use kernel_linux; then
+ # This is from https://bugs.gentoo.org/376939
+ use acl && CONFIG_CHECK="~TMPFS_POSIX_ACL"
+ # This is required to get login-session-id string with pam_ck_connector.so
+ use pam && CONFIG_CHECK+=" ~AUDITSYSCALL"
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-cleanup_console_tags.patch \
+ "${FILESDIR}"/${PN}-shutdown-reboot-without-policies.patch \
+ "${FILESDIR}"/${PN}-udev-acl-install_to_usr.patch \
+ "${FILESDIR}"/${PN}-0.4.5-polkit-automagic.patch
+
+ if ! use systemd-units; then
+ sed -i -e '/SystemdService/d' data/org.freedesktop.ConsoleKit.service.in || die
+ fi
+
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+ if use systemd-units; then
+ myconf="$(systemd_with_unitdir)"
+ else
+ myconf="--with-systemdsystemunitdir=/tmp"
+ fi
+
+ econf \
+ XMLTO_FLAGS='--skip-validation' \
+ --libexecdir="${EPREFIX}"/usr/lib/${MY_PN} \
+ --localstatedir="${EPREFIX}"/var \
+ $(use_enable pam pam-module) \
+ $(use_enable doc docbook-docs) \
+ $(use_enable test docbook-docs) \
+ $(use_enable debug) \
+ $(use_enable policykit polkit) \
+ $(use_enable acl udev-acl) \
+ --with-dbus-services="${EPREFIX}"/usr/share/dbus-1/services \
+ --with-pam-module-dir="$(getpam_mod_dir)" \
+ ${myconf}
+}
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ htmldocdir="${EPREFIX}"/usr/share/doc/${PF}/html \
+ install
+
+ dosym /usr/lib/${MY_PN} /usr/lib/${PN}
+
+ dodoc AUTHORS HACKING NEWS README TODO
+
+ newinitd "${FILESDIR}"/${PN}-0.2.rc consolekit
+
+ keepdir /usr/lib/ConsoleKit/run-seat.d
+ keepdir /usr/lib/ConsoleKit/run-session.d
+ keepdir /etc/ConsoleKit/run-session.d
+ keepdir /var/log/ConsoleKit
+
+ exeinto /etc/X11/xinit/xinitrc.d
+ newexe "${FILESDIR}"/90-consolekit-3 90-consolekit
+
+ exeinto /usr/lib/ConsoleKit/run-session.d
+ doexe "${FILESDIR}"/pam-foreground-compat.ck
+
+ prune_libtool_files --all # --all for pam_ck_connector.la
+
+ use systemd-units || rm -rf "${ED}"/tmp
+
+ rm -rf "${ED}"/var/run # let the init script create the directory
+
+ insinto /etc/logrotate.d
+ newins "${WORKDIR}"/debian/${PN}.logrotate ${PN} #374513
+}
diff --git a/sys-auth/consolekit/consolekit-1.0.1.ebuild b/sys-auth/consolekit/consolekit-1.0.1.ebuild
new file mode 100644
index 000000000000..9f12159869a1
--- /dev/null
+++ b/sys-auth/consolekit/consolekit-1.0.1.ebuild
@@ -0,0 +1,116 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils linux-info pam
+
+MY_PN=ConsoleKit2
+MY_P=${MY_PN}-${PV}
+
+DESCRIPTION="Framework for defining and tracking users, login sessions and seats"
+HOMEPAGE="https://github.com/ConsoleKit2/ConsoleKit2 https://www.freedesktop.org/wiki/Software/ConsoleKit"
+SRC_URI="https://github.com/${MY_PN}/${MY_PN}/releases/download/${PV}/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc64 ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="acl cgroups debug doc kernel_linux pam pm-utils policykit selinux test"
+
+COMMON_DEPEND=">=dev-libs/glib-2.40:2=[dbus]
+ >=sys-devel/gettext-0.19
+ sys-apps/dbus
+ sys-libs/zlib:=
+ x11-libs/libX11:=
+ acl? (
+ sys-apps/acl:=
+ >=virtual/udev-200
+ )
+ cgroups? (
+ app-admin/cgmanager
+ >=sys-libs/libnih-1.0.2[dbus]
+ )
+ pam? ( virtual/pam )
+ policykit? ( >=sys-auth/polkit-0.110 )"
+# pm-utils: bug 557432
+RDEPEND="${COMMON_DEPEND}
+ kernel_linux? ( sys-apps/coreutils[acl?] )
+ pm-utils? ( sys-power/pm-utils )
+ selinux? ( sec-policy/selinux-consolekit )"
+DEPEND="${COMMON_DEPEND}
+ dev-libs/libxslt
+ virtual/pkgconfig
+ doc? ( app-text/xmlto )
+ test? (
+ app-text/docbook-xml-dtd:4.1.2
+ app-text/xmlto
+ )"
+
+S=${WORKDIR}/${MY_P}
+
+QA_MULTILIB_PATHS="usr/lib/ConsoleKit/.*"
+
+pkg_setup() {
+ if use kernel_linux; then
+ # This is from https://bugs.gentoo.org/376939
+ use acl && CONFIG_CHECK="~TMPFS_POSIX_ACL"
+ # This is required to get login-session-id string with pam_ck_connector.so
+ use pam && CONFIG_CHECK+=" ~AUDITSYSCALL"
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ sed -i -e '/SystemdService/d' data/org.freedesktop.ConsoleKit.service.in || die
+
+ epatch_user
+}
+
+src_configure() {
+ econf \
+ XMLTO_FLAGS='--skip-validation' \
+ --libexecdir="${EPREFIX}"/usr/lib/ConsoleKit \
+ --localstatedir="${EPREFIX}"/var \
+ $(use_enable pam pam-module) \
+ $(use_enable doc docbook-docs) \
+ $(use_enable test docbook-docs) \
+ $(use_enable debug) \
+ $(use_enable policykit polkit) \
+ $(use_enable acl udev-acl) \
+ $(use_enable cgroups) \
+ $(use_enable test tests) \
+ --with-dbus-services="${EPREFIX}"/usr/share/dbus-1/services \
+ --with-pam-module-dir="$(getpam_mod_dir)" \
+ --with-xinitrc-dir=/etc/X11/xinit/xinitrc.d \
+ --without-systemdsystemunitdir
+}
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ htmldocdir="${EPREFIX}"/usr/share/doc/${PF}/html \
+ install
+
+ dosym /usr/lib/ConsoleKit /usr/lib/${PN}
+
+ dodoc AUTHORS HACKING NEWS README TODO
+
+ newinitd "${FILESDIR}"/${PN}-1.0.0.initd consolekit
+
+ keepdir /usr/lib/ConsoleKit/run-seat.d
+ keepdir /usr/lib/ConsoleKit/run-session.d
+ keepdir /etc/ConsoleKit/run-session.d
+ keepdir /var/log/ConsoleKit
+
+ exeinto /etc/X11/xinit/xinitrc.d
+ newexe "${FILESDIR}"/90-consolekit-3 90-consolekit
+
+ if use kernel_linux; then
+ # bug 571524
+ exeinto /usr/lib/ConsoleKit/run-session.d
+ doexe "${FILESDIR}"/pam-foreground-compat.ck
+ fi
+
+ prune_libtool_files --all # --all for pam_ck_connector.la
+
+ rm -rf "${ED}"/var/run || die # let the init script create the directory
+}
diff --git a/sys-auth/consolekit/consolekit-1.1.0-r1.ebuild b/sys-auth/consolekit/consolekit-1.1.0-r1.ebuild
new file mode 100644
index 000000000000..58786383c9cf
--- /dev/null
+++ b/sys-auth/consolekit/consolekit-1.1.0-r1.ebuild
@@ -0,0 +1,119 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit libtool linux-info pam
+
+MY_PN=ConsoleKit2
+MY_P=${MY_PN}-${PV}
+
+DESCRIPTION="Framework for defining and tracking users, login sessions and seats"
+HOMEPAGE="https://github.com/ConsoleKit2/ConsoleKit2 https://www.freedesktop.org/wiki/Software/ConsoleKit"
+SRC_URI="https://github.com/${MY_PN}/${MY_PN}/releases/download/${PV}/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ppc ppc64 sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="acl cgroups debug doc kernel_linux pam pm-utils policykit selinux test"
+
+COMMON_DEPEND=">=dev-libs/glib-2.40:2=[dbus]
+ >=sys-devel/gettext-0.19
+ sys-apps/dbus
+ sys-libs/zlib:=
+ x11-libs/libX11:=
+ acl? (
+ sys-apps/acl:=
+ >=virtual/udev-200
+ )
+ cgroups? (
+ app-admin/cgmanager
+ >=sys-libs/libnih-1.0.2[dbus]
+ )
+ pam? ( virtual/pam )
+ policykit? ( >=sys-auth/polkit-0.110 )"
+# pm-utils: bug 557432
+RDEPEND="${COMMON_DEPEND}
+ kernel_linux? ( sys-apps/coreutils[acl?] )
+ pm-utils? ( sys-power/pm-utils )
+ selinux? ( sec-policy/selinux-consolekit )"
+DEPEND="${COMMON_DEPEND}
+ dev-libs/libxslt
+ virtual/pkgconfig
+ doc? ( app-text/xmlto )
+ test? (
+ app-text/docbook-xml-dtd:4.1.2
+ app-text/xmlto
+ )"
+
+S=${WORKDIR}/${MY_P}
+
+QA_MULTILIB_PATHS="usr/lib/ConsoleKit/.*"
+
+PATCHES=( "${FILESDIR}/${P}-Remove-the-root-restriction-for-runtime-dirs.patch" )
+
+pkg_setup() {
+ if use kernel_linux; then
+ # This is from https://bugs.gentoo.org/376939
+ use acl && CONFIG_CHECK="~TMPFS_POSIX_ACL"
+ # This is required to get login-session-id string with pam_ck_connector.so
+ use pam && CONFIG_CHECK+=" ~AUDITSYSCALL"
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ sed -i -e '/SystemdService/d' data/org.freedesktop.ConsoleKit.service.in || die
+
+ default
+ elibtoolize # bug 593314
+}
+
+src_configure() {
+ econf \
+ XMLTO_FLAGS='--skip-validation' \
+ --libexecdir="${EPREFIX}"/usr/lib/ConsoleKit \
+ --localstatedir="${EPREFIX}"/var \
+ $(use_enable pam pam-module) \
+ $(use_enable doc docbook-docs) \
+ $(use_enable test docbook-docs) \
+ $(use_enable debug) \
+ $(use_enable policykit polkit) \
+ $(use_enable acl udev-acl) \
+ $(use_enable cgroups) \
+ $(use_enable test tests) \
+ --with-dbus-services="${EPREFIX}"/usr/share/dbus-1/services \
+ --with-pam-module-dir="$(getpam_mod_dir)" \
+ --with-xinitrc-dir="${EPREFIX}"/etc/X11/xinit/xinitrc.d \
+ --without-systemdsystemunitdir
+}
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ htmldocdir="${EPREFIX}"/usr/share/doc/${PF}/html \
+ install
+
+ dosym /usr/lib/ConsoleKit /usr/lib/${PN}
+
+ dodoc AUTHORS HACKING NEWS README TODO
+
+ newinitd "${FILESDIR}"/${PN}-1.0.0.initd consolekit
+
+ keepdir /usr/lib/ConsoleKit/run-seat.d
+ keepdir /usr/lib/ConsoleKit/run-session.d
+ keepdir /etc/ConsoleKit/run-session.d
+ keepdir /var/log/ConsoleKit
+
+ exeinto /etc/X11/xinit/xinitrc.d
+ newexe "${FILESDIR}"/90-consolekit-3 90-consolekit
+
+ if use kernel_linux; then
+ # bug 571524
+ exeinto /usr/lib/ConsoleKit/run-session.d
+ doexe "${FILESDIR}"/pam-foreground-compat.ck
+ fi
+
+ prune_libtool_files --all # --all for pam_ck_connector.la
+
+ rm -rf "${ED}"/var/run || die # let the init script create the directory
+}
diff --git a/sys-auth/consolekit/consolekit-1.1.0.ebuild b/sys-auth/consolekit/consolekit-1.1.0.ebuild
new file mode 100644
index 000000000000..f33886b94e61
--- /dev/null
+++ b/sys-auth/consolekit/consolekit-1.1.0.ebuild
@@ -0,0 +1,116 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit eutils linux-info pam
+
+MY_PN=ConsoleKit2
+MY_P=${MY_PN}-${PV}
+
+DESCRIPTION="Framework for defining and tracking users, login sessions and seats"
+HOMEPAGE="https://github.com/ConsoleKit2/ConsoleKit2 https://www.freedesktop.org/wiki/Software/ConsoleKit"
+SRC_URI="https://github.com/${MY_PN}/${MY_PN}/releases/download/${PV}/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ~ppc ppc64 x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="acl cgroups debug doc kernel_linux pam pm-utils policykit selinux test"
+
+COMMON_DEPEND=">=dev-libs/glib-2.40:2=[dbus]
+ >=sys-devel/gettext-0.19
+ sys-apps/dbus
+ sys-libs/zlib:=
+ x11-libs/libX11:=
+ acl? (
+ sys-apps/acl:=
+ >=virtual/udev-200
+ )
+ cgroups? (
+ app-admin/cgmanager
+ >=sys-libs/libnih-1.0.2[dbus]
+ )
+ pam? ( virtual/pam )
+ policykit? ( >=sys-auth/polkit-0.110 )"
+# pm-utils: bug 557432
+RDEPEND="${COMMON_DEPEND}
+ kernel_linux? ( sys-apps/coreutils[acl?] )
+ pm-utils? ( sys-power/pm-utils )
+ selinux? ( sec-policy/selinux-consolekit )"
+DEPEND="${COMMON_DEPEND}
+ dev-libs/libxslt
+ virtual/pkgconfig
+ doc? ( app-text/xmlto )
+ test? (
+ app-text/docbook-xml-dtd:4.1.2
+ app-text/xmlto
+ )"
+
+S=${WORKDIR}/${MY_P}
+
+QA_MULTILIB_PATHS="usr/lib/ConsoleKit/.*"
+
+pkg_setup() {
+ if use kernel_linux; then
+ # This is from https://bugs.gentoo.org/376939
+ use acl && CONFIG_CHECK="~TMPFS_POSIX_ACL"
+ # This is required to get login-session-id string with pam_ck_connector.so
+ use pam && CONFIG_CHECK+=" ~AUDITSYSCALL"
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ sed -i -e '/SystemdService/d' data/org.freedesktop.ConsoleKit.service.in || die
+
+ default
+}
+
+src_configure() {
+ econf \
+ XMLTO_FLAGS='--skip-validation' \
+ --libexecdir="${EPREFIX}"/usr/lib/ConsoleKit \
+ --localstatedir="${EPREFIX}"/var \
+ $(use_enable pam pam-module) \
+ $(use_enable doc docbook-docs) \
+ $(use_enable test docbook-docs) \
+ $(use_enable debug) \
+ $(use_enable policykit polkit) \
+ $(use_enable acl udev-acl) \
+ $(use_enable cgroups) \
+ $(use_enable test tests) \
+ --with-dbus-services="${EPREFIX}"/usr/share/dbus-1/services \
+ --with-pam-module-dir="$(getpam_mod_dir)" \
+ --with-xinitrc-dir=/etc/X11/xinit/xinitrc.d \
+ --without-systemdsystemunitdir
+}
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ htmldocdir="${EPREFIX}"/usr/share/doc/${PF}/html \
+ install
+
+ dosym /usr/lib/ConsoleKit /usr/lib/${PN}
+
+ dodoc AUTHORS HACKING NEWS README TODO
+
+ newinitd "${FILESDIR}"/${PN}-1.0.0.initd consolekit
+
+ keepdir /usr/lib/ConsoleKit/run-seat.d
+ keepdir /usr/lib/ConsoleKit/run-session.d
+ keepdir /etc/ConsoleKit/run-session.d
+ keepdir /var/log/ConsoleKit
+
+ exeinto /etc/X11/xinit/xinitrc.d
+ newexe "${FILESDIR}"/90-consolekit-3 90-consolekit
+
+ if use kernel_linux; then
+ # bug 571524
+ exeinto /usr/lib/ConsoleKit/run-session.d
+ doexe "${FILESDIR}"/pam-foreground-compat.ck
+ fi
+
+ prune_libtool_files --all # --all for pam_ck_connector.la
+
+ rm -rf "${ED}"/var/run || die # let the init script create the directory
+}
diff --git a/sys-auth/consolekit/consolekit-1.1.1.ebuild b/sys-auth/consolekit/consolekit-1.1.1.ebuild
new file mode 100644
index 000000000000..bac2ded4fb84
--- /dev/null
+++ b/sys-auth/consolekit/consolekit-1.1.1.ebuild
@@ -0,0 +1,130 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools libtool linux-info pam
+
+MY_PN=ConsoleKit2
+MY_P=${MY_PN}-${PV}
+
+DESCRIPTION="Framework for defining and tracking users, login sessions and seats"
+HOMEPAGE="https://github.com/ConsoleKit2/ConsoleKit2 https://www.freedesktop.org/wiki/Software/ConsoleKit"
+SRC_URI="https://github.com/${MY_PN}/${MY_PN}/releases/download/${PV}/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="acl cgroups debug doc evdev kernel_linux pam pm-utils policykit selinux test udev"
+
+COMMON_DEPEND=">=dev-libs/glib-2.40:2=[dbus]
+ >=sys-devel/gettext-0.19
+ sys-apps/dbus
+ sys-libs/zlib:=
+ x11-libs/libX11:=
+ acl? (
+ sys-apps/acl:=
+ >=virtual/udev-200
+ )
+ cgroups? (
+ app-admin/cgmanager
+ >=sys-libs/libnih-1.0.2[dbus]
+ )
+ evdev? ( dev-libs/libevdev:= )
+ udev? (
+ virtual/libudev
+ x11-libs/libdrm:=
+ )
+ pam? ( virtual/pam )
+ policykit? ( >=sys-auth/polkit-0.110 )
+ selinux? ( sys-libs/libselinux )"
+# pm-utils: bug 557432
+RDEPEND="${COMMON_DEPEND}
+ kernel_linux? ( sys-apps/coreutils[acl?] )
+ pm-utils? ( sys-power/pm-utils )
+ selinux? ( sec-policy/selinux-consolekit )"
+DEPEND="${COMMON_DEPEND}
+ dev-libs/libxslt
+ virtual/pkgconfig
+ doc? ( app-text/xmlto )
+ test? (
+ app-text/docbook-xml-dtd:4.1.2
+ app-text/xmlto
+ )"
+
+S=${WORKDIR}/${MY_P}
+
+QA_MULTILIB_PATHS="usr/lib/ConsoleKit/.*"
+
+PATCHES=( "${FILESDIR}/consolekit-1.1.1-0001-Fix-enable-libudev-configure-flag.patch" )
+
+pkg_setup() {
+ if use kernel_linux; then
+ # This is from https://bugs.gentoo.org/376939
+ use acl && CONFIG_CHECK="~TMPFS_POSIX_ACL"
+ # This is required to get login-session-id string with pam_ck_connector.so
+ use pam && CONFIG_CHECK+=" ~AUDITSYSCALL"
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ sed -i -e '/SystemdService/d' data/org.freedesktop.ConsoleKit.service.in || die
+
+ default
+ # patch needs autoreconf, so dont need libtoolize
+ eautoreconf
+ #elibtoolize # bug 593314
+}
+
+src_configure() {
+ econf \
+ XMLTO_FLAGS='--skip-validation' \
+ --libexecdir="${EPREFIX}"/usr/lib/ConsoleKit \
+ --localstatedir="${EPREFIX}"/var \
+ $(use_enable pam pam-module) \
+ $(use_enable doc docbook-docs) \
+ $(use_enable test docbook-docs) \
+ $(use_enable debug) \
+ $(use_enable policykit polkit) \
+ $(use_enable evdev libevdev) \
+ $(use_enable acl udev-acl) \
+ $(use_enable cgroups) \
+ $(use_enable selinux) \
+ $(use_enable udev libudev) \
+ $(use_enable test tests) \
+ --with-dbus-services="${EPREFIX}"/usr/share/dbus-1/services \
+ --with-pam-module-dir="$(getpam_mod_dir)" \
+ --with-xinitrc-dir="${EPREFIX}"/etc/X11/xinit/xinitrc.d \
+ --without-systemdsystemunitdir
+}
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ htmldocdir="${EPREFIX}"/usr/share/doc/${PF}/html \
+ install
+
+ dosym /usr/lib/ConsoleKit /usr/lib/${PN}
+
+ dodoc AUTHORS HACKING NEWS README TODO
+
+ newinitd "${FILESDIR}"/${PN}-1.0.0.initd consolekit
+
+ keepdir /usr/lib/ConsoleKit/run-seat.d
+ keepdir /usr/lib/ConsoleKit/run-session.d
+ keepdir /etc/ConsoleKit/run-session.d
+ keepdir /var/log/ConsoleKit
+
+ exeinto /etc/X11/xinit/xinitrc.d
+ newexe "${FILESDIR}"/90-consolekit-3 90-consolekit
+
+ if use kernel_linux; then
+ # bug 571524
+ exeinto /usr/lib/ConsoleKit/run-session.d
+ doexe "${FILESDIR}"/pam-foreground-compat.ck
+ fi
+
+ prune_libtool_files --all # --all for pam_ck_connector.la
+
+ rm -rf "${ED}"/var/run || die # let the init script create the directory
+}
diff --git a/sys-auth/consolekit/consolekit-1.1.2.ebuild b/sys-auth/consolekit/consolekit-1.1.2.ebuild
new file mode 100644
index 000000000000..55ce2ac00131
--- /dev/null
+++ b/sys-auth/consolekit/consolekit-1.1.2.ebuild
@@ -0,0 +1,130 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools libtool linux-info pam xdg-utils
+
+MY_PN=ConsoleKit2
+MY_P=${MY_PN}-${PV}
+
+DESCRIPTION="Framework for defining and tracking users, login sessions and seats"
+HOMEPAGE="https://github.com/ConsoleKit2/ConsoleKit2 https://www.freedesktop.org/wiki/Software/ConsoleKit"
+SRC_URI="https://github.com/${MY_PN}/${MY_PN}/releases/download/${PV}/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~ppc ~ppc64 ~sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="acl cgroups debug doc evdev kernel_linux pam pm-utils policykit selinux test udev"
+
+COMMON_DEPEND=">=dev-libs/glib-2.40:2=[dbus]
+ >=sys-devel/gettext-0.19
+ sys-apps/dbus
+ sys-libs/zlib:=
+ x11-libs/libX11:=
+ acl? (
+ sys-apps/acl:=
+ >=virtual/udev-200
+ )
+ cgroups? (
+ app-admin/cgmanager
+ >=sys-libs/libnih-1.0.2[dbus]
+ )
+ evdev? ( dev-libs/libevdev:= )
+ udev? (
+ virtual/libudev
+ x11-libs/libdrm:=
+ )
+ pam? ( virtual/pam )
+ policykit? ( >=sys-auth/polkit-0.110 )
+ selinux? ( sys-libs/libselinux )"
+# pm-utils: bug 557432
+RDEPEND="${COMMON_DEPEND}
+ kernel_linux? ( sys-apps/coreutils[acl?] )
+ pm-utils? ( sys-power/pm-utils )
+ selinux? ( sec-policy/selinux-consolekit )"
+DEPEND="${COMMON_DEPEND}
+ dev-libs/libxslt
+ virtual/pkgconfig
+ doc? ( app-text/xmlto )
+ test? (
+ app-text/docbook-xml-dtd:4.1.2
+ app-text/xmlto
+ )"
+
+S=${WORKDIR}/${MY_P}
+
+QA_MULTILIB_PATHS="usr/lib/ConsoleKit/.*"
+
+pkg_setup() {
+ if use kernel_linux; then
+ # This is from https://bugs.gentoo.org/376939
+ use acl && CONFIG_CHECK="~TMPFS_POSIX_ACL"
+ # This is required to get login-session-id string with pam_ck_connector.so
+ use pam && CONFIG_CHECK+=" ~AUDITSYSCALL"
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ xdg_environment_reset
+
+ sed -i -e '/SystemdService/d' data/org.freedesktop.ConsoleKit.service.in || die
+
+ default
+ # patch needs autoreconf, so dont need libtoolize
+ eautoreconf
+ #elibtoolize # bug 593314
+}
+
+src_configure() {
+ econf \
+ XMLTO_FLAGS='--skip-validation' \
+ --libexecdir="${EPREFIX}"/usr/lib/ConsoleKit \
+ --localstatedir="${EPREFIX}"/var \
+ $(use_enable pam pam-module) \
+ $(use_enable doc docbook-docs) \
+ $(use_enable test docbook-docs) \
+ $(use_enable debug) \
+ $(use_enable policykit polkit) \
+ $(use_enable evdev libevdev) \
+ $(use_enable acl udev-acl) \
+ $(use_enable cgroups libcgmanager) \
+ $(use_enable selinux libselinux) \
+ $(use_enable udev libudev) \
+ $(use_enable test tests) \
+ --with-dbus-services="${EPREFIX}"/usr/share/dbus-1/services \
+ --with-pam-module-dir="$(getpam_mod_dir)" \
+ --with-xinitrc-dir="${EPREFIX}"/etc/X11/xinit/xinitrc.d \
+ --without-systemdsystemunitdir
+}
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ htmldocdir="${EPREFIX}"/usr/share/doc/${PF}/html \
+ install
+
+ dosym /usr/lib/ConsoleKit /usr/lib/${PN}
+
+ dodoc AUTHORS HACKING NEWS README TODO
+
+ newinitd "${FILESDIR}"/${PN}-1.0.0.initd consolekit
+
+ keepdir /usr/lib/ConsoleKit/run-seat.d
+ keepdir /usr/lib/ConsoleKit/run-session.d
+ keepdir /etc/ConsoleKit/run-session.d
+ keepdir /var/log/ConsoleKit
+
+ exeinto /etc/X11/xinit/xinitrc.d
+ newexe "${FILESDIR}"/90-consolekit-3 90-consolekit
+
+ if use kernel_linux; then
+ # bug 571524
+ exeinto /usr/lib/ConsoleKit/run-session.d
+ doexe "${FILESDIR}"/pam-foreground-compat.ck
+ fi
+
+ prune_libtool_files --all # --all for pam_ck_connector.la
+
+ rm -rf "${ED}"/var/run || die # let the init script create the directory
+}
diff --git a/sys-auth/consolekit/consolekit-1.2.0.ebuild b/sys-auth/consolekit/consolekit-1.2.0.ebuild
new file mode 100644
index 000000000000..ad224d1d9a6a
--- /dev/null
+++ b/sys-auth/consolekit/consolekit-1.2.0.ebuild
@@ -0,0 +1,131 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools libtool linux-info pam xdg-utils
+
+MY_PN=ConsoleKit2
+MY_P=${MY_PN}-${PV}
+
+DESCRIPTION="Framework for defining and tracking users, login sessions and seats"
+HOMEPAGE="https://github.com/ConsoleKit2/ConsoleKit2 https://www.freedesktop.org/wiki/Software/ConsoleKit"
+SRC_URI="https://github.com/${MY_PN}/${MY_PN}/releases/download/${PV}/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="acl cgroups debug doc evdev kernel_linux pam pm-utils policykit selinux test udev"
+
+COMMON_DEPEND=">=dev-libs/glib-2.40:2=[dbus]
+ >=sys-devel/gettext-0.19
+ sys-apps/dbus
+ sys-libs/zlib:=
+ x11-libs/libX11:=
+ acl? (
+ sys-apps/acl:=
+ >=virtual/udev-200
+ )
+ cgroups? (
+ app-admin/cgmanager
+ >=sys-libs/libnih-1.0.2[dbus]
+ )
+ evdev? ( dev-libs/libevdev:= )
+ udev? (
+ virtual/libudev
+ x11-libs/libdrm:=
+ )
+ pam? ( virtual/pam )
+ policykit? ( >=sys-auth/polkit-0.110 )
+ selinux? ( sys-libs/libselinux )"
+# pm-utils: bug 557432
+RDEPEND="${COMMON_DEPEND}
+ kernel_linux? ( sys-apps/coreutils[acl?] )
+ pm-utils? ( sys-power/pm-utils )
+ selinux? ( sec-policy/selinux-consolekit )"
+DEPEND="${COMMON_DEPEND}
+ dev-libs/libxslt
+ virtual/pkgconfig
+ doc? ( app-text/xmlto )
+ test? (
+ app-text/docbook-xml-dtd:4.1.2
+ app-text/xmlto
+ )"
+
+S=${WORKDIR}/${MY_P}
+
+QA_MULTILIB_PATHS="usr/lib/ConsoleKit/.*"
+
+pkg_setup() {
+ if use kernel_linux; then
+ # This is from https://bugs.gentoo.org/376939
+ use acl && CONFIG_CHECK="~TMPFS_POSIX_ACL"
+ # This is required to get login-session-id string with pam_ck_connector.so
+ use pam && CONFIG_CHECK+=" ~AUDITSYSCALL"
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ xdg_environment_reset
+
+ sed -i -e '/SystemdService/d' data/org.freedesktop.ConsoleKit.service.in || die
+
+ default
+ # patch needs autoreconf, so dont need libtoolize
+ eautoreconf
+ #elibtoolize # bug 593314
+}
+
+src_configure() {
+ econf \
+ XMLTO_FLAGS='--skip-validation' \
+ --libexecdir="${EPREFIX}"/usr/lib/ConsoleKit \
+ --localstatedir="${EPREFIX}"/var \
+ $(use_enable pam pam-module) \
+ $(use_enable doc docbook-docs) \
+ $(use_enable test docbook-docs) \
+ $(use_enable debug) \
+ $(use_enable policykit polkit) \
+ $(use_enable evdev libevdev) \
+ $(use_enable acl udev-acl) \
+ $(use_enable cgroups libcgmanager) \
+ $(use_enable selinux libselinux) \
+ $(use_enable udev libdrm) \
+ $(use_enable udev libudev) \
+ $(use_enable test tests) \
+ --with-dbus-services="${EPREFIX}"/usr/share/dbus-1/services \
+ --with-pam-module-dir="$(getpam_mod_dir)" \
+ --with-xinitrc-dir="${EPREFIX}"/etc/X11/xinit/xinitrc.d \
+ --without-systemdsystemunitdir
+}
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ htmldocdir="${EPREFIX}"/usr/share/doc/${PF}/html \
+ install
+
+ dosym /usr/lib/ConsoleKit /usr/lib/${PN}
+
+ dodoc AUTHORS HACKING NEWS README TODO
+
+ newinitd "${FILESDIR}"/${PN}-1.0.0.initd consolekit
+
+ keepdir /usr/lib/ConsoleKit/run-seat.d
+ keepdir /usr/lib/ConsoleKit/run-session.d
+ keepdir /etc/ConsoleKit/run-session.d
+ keepdir /var/log/ConsoleKit
+
+ exeinto /etc/X11/xinit/xinitrc.d
+ newexe "${FILESDIR}"/90-consolekit-3 90-consolekit
+
+ if use kernel_linux; then
+ # bug 571524
+ exeinto /usr/lib/ConsoleKit/run-session.d
+ doexe "${FILESDIR}"/pam-foreground-compat.ck
+ fi
+
+ prune_libtool_files --all # --all for pam_ck_connector.la
+
+ rm -rf "${ED}"/var/run || die # let the init script create the directory
+}
diff --git a/sys-auth/consolekit/consolekit-9999.ebuild b/sys-auth/consolekit/consolekit-9999.ebuild
new file mode 100644
index 000000000000..a87eea41cc33
--- /dev/null
+++ b/sys-auth/consolekit/consolekit-9999.ebuild
@@ -0,0 +1,127 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools libtool git-r3 linux-info pam xdg-utils
+
+MY_PN=ConsoleKit2
+MY_P=${MY_PN}-${PV}
+
+DESCRIPTION="Framework for defining and tracking users, login sessions and seats"
+HOMEPAGE="https://github.com/ConsoleKit2/ConsoleKit2 https://www.freedesktop.org/wiki/Software/ConsoleKit"
+EGIT_REPO_URI="https://github.com/${MY_PN}/${MY_PN}.git"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE="acl cgroups debug doc evdev kernel_linux pam pm-utils policykit selinux test udev"
+
+COMMON_DEPEND=">=dev-libs/glib-2.40:2=[dbus]
+ >=sys-devel/gettext-0.19
+ sys-apps/dbus
+ sys-libs/zlib:=
+ x11-libs/libX11:=
+ acl? (
+ sys-apps/acl:=
+ >=virtual/udev-200
+ )
+ cgroups? (
+ app-admin/cgmanager
+ >=sys-libs/libnih-1.0.2[dbus]
+ )
+ evdev? ( dev-libs/libevdev:= )
+ udev? (
+ virtual/libudev
+ x11-libs/libdrm:=
+ )
+ pam? ( virtual/pam )
+ policykit? ( >=sys-auth/polkit-0.110 )
+ selinux? ( sys-libs/libselinux )"
+# pm-utils: bug 557432
+RDEPEND="${COMMON_DEPEND}
+ kernel_linux? ( sys-apps/coreutils[acl?] )
+ pm-utils? ( sys-power/pm-utils )
+ selinux? ( sec-policy/selinux-consolekit )"
+DEPEND="${COMMON_DEPEND}
+ dev-libs/libxslt
+ virtual/pkgconfig
+ doc? ( app-text/xmlto )
+ test? (
+ app-text/docbook-xml-dtd:4.1.2
+ app-text/xmlto
+ )"
+
+QA_MULTILIB_PATHS="usr/lib/ConsoleKit/.*"
+
+pkg_setup() {
+ if use kernel_linux; then
+ # This is from https://bugs.gentoo.org/376939
+ use acl && CONFIG_CHECK="~TMPFS_POSIX_ACL"
+ # This is required to get login-session-id string with pam_ck_connector.so
+ use pam && CONFIG_CHECK+=" ~AUDITSYSCALL"
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ xdg_environment_reset
+
+ sed -i -e '/SystemdService/d' data/org.freedesktop.ConsoleKit.service.in || die
+
+ default
+ eautoreconf
+ #elibtoolize # bug 593314
+}
+
+src_configure() {
+ econf \
+ XMLTO_FLAGS='--skip-validation' \
+ --libexecdir="${EPREFIX}"/usr/lib/ConsoleKit \
+ --localstatedir="${EPREFIX}"/var \
+ $(use_enable pam pam-module) \
+ $(use_enable doc docbook-docs) \
+ $(use_enable test docbook-docs) \
+ $(use_enable debug) \
+ $(use_enable policykit polkit) \
+ $(use_enable evdev libevdev) \
+ $(use_enable acl udev-acl) \
+ $(use_enable cgroups libcgmanager) \
+ $(use_enable selinux libselinux) \
+ $(use_enable udev libudev) \
+ $(use_enable test tests) \
+ --with-dbus-services="${EPREFIX}"/usr/share/dbus-1/services \
+ --with-pam-module-dir="$(getpam_mod_dir)" \
+ --with-xinitrc-dir="${EPREFIX}"/etc/X11/xinit/xinitrc.d \
+ --without-systemdsystemunitdir
+}
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ htmldocdir="${EPREFIX}"/usr/share/doc/${PF}/html \
+ install
+
+ dosym /usr/lib/ConsoleKit /usr/lib/${PN}
+
+ dodoc AUTHORS HACKING NEWS README TODO
+
+ newinitd "${FILESDIR}"/${PN}-1.0.0.initd consolekit
+
+ keepdir /usr/lib/ConsoleKit/run-seat.d
+ keepdir /usr/lib/ConsoleKit/run-session.d
+ keepdir /etc/ConsoleKit/run-session.d
+ keepdir /var/log/ConsoleKit
+
+ exeinto /etc/X11/xinit/xinitrc.d
+ newexe "${FILESDIR}"/90-consolekit-3 90-consolekit
+
+ if use kernel_linux; then
+ # bug 571524
+ exeinto /usr/lib/ConsoleKit/run-session.d
+ doexe "${FILESDIR}"/pam-foreground-compat.ck
+ fi
+
+ prune_libtool_files --all # --all for pam_ck_connector.la
+
+ rm -rf "${ED}"/var/run || die # let the init script create the directory
+}
diff --git a/sys-auth/consolekit/files/90-consolekit-3 b/sys-auth/consolekit/files/90-consolekit-3
new file mode 100644
index 000000000000..358fc24f1a72
--- /dev/null
+++ b/sys-auth/consolekit/files/90-consolekit-3
@@ -0,0 +1,32 @@
+# -*- sh -*-
+# Xsession.d script for ck-launch-session.
+#
+#
+# This file is sourced by Xsession(5), not executed.
+
+CK_LAUNCH_SESSION=/usr/bin/ck-launch-session
+
+is_on_console() {
+ session=$(dbus-send --system --dest=org.freedesktop.ConsoleKit \
+ --type=method_call --print-reply --reply-timeout=2000 \
+ /org/freedesktop/ConsoleKit/Manager \
+ org.freedesktop.ConsoleKit.Manager.GetCurrentSession \
+ | grep path | awk '{print $3}' | sed s/\"//g)
+ x11_display=$(dbus-send --system --dest=org.freedesktop.ConsoleKit \
+ --type=method_call --print-reply --reply-timeout=2000 \
+ $session org.freedesktop.ConsoleKit.Session.GetX11Display \
+ | grep string | awk '{print $2}' | sed s/\"//g)
+
+ if [ -z "$x11_display" ] ; then
+ return 0
+ else
+ return 1
+ fi
+}
+
+# gdm already creates a CK session for us, so do not run the expensive D-Bus
+# calls if we have $GDMSESSION
+if [ -z "$GDMSESSION" ] && [ -x "$CK_LAUNCH_SESSION" ] && \
+ ( [ -z "$XDG_SESSION_COOKIE" ] || is_on_console ) ; then
+ command="$CK_LAUNCH_SESSION $command"
+fi
diff --git a/sys-auth/consolekit/files/consolekit-0.2.rc b/sys-auth/consolekit/files/consolekit-0.2.rc
new file mode 100644
index 000000000000..e2be0de6e1aa
--- /dev/null
+++ b/sys-auth/consolekit/files/consolekit-0.2.rc
@@ -0,0 +1,25 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+depend() {
+ need dbus
+ use logger
+}
+
+start() {
+ ebegin "Starting ConsoleKit daemon"
+
+ checkpath -q -d -m 0755 /var/run/ConsoleKit
+
+ start-stop-daemon --start -q \
+ --pidfile /var/run/ConsoleKit/pid \
+ --exec /usr/sbin/console-kit-daemon --
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ConsoleKit daemon"
+ start-stop-daemon --stop -q --pidfile /var/run/ConsoleKit/pid
+ eend $?
+}
diff --git a/sys-auth/consolekit/files/consolekit-0.4.5-polkit-automagic.patch b/sys-auth/consolekit/files/consolekit-0.4.5-polkit-automagic.patch
new file mode 100644
index 000000000000..b896089d4485
--- /dev/null
+++ b/sys-auth/consolekit/files/consolekit-0.4.5-polkit-automagic.patch
@@ -0,0 +1,30 @@
+http://bugs.freedesktop.org/show_bug.cgi?id=47587
+
+--- configure.ac
++++ configure.ac
+@@ -56,10 +56,21 @@
+ gthread-2.0 >= $GLIB_REQUIRED_VERSION
+ )
+
+-PKG_CHECK_MODULES(POLKIT,
+- polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION,
+- have_polkit=yes,
+- have_polkit=no)
++AC_ARG_ENABLE([polkit],
++ AC_HELP_STRING([--enable-polkit], [Enable PolicyKit support (default auto)]),
++ enable_polkit=$enableval,
++ enable_polkit=auto)
++
++if test "x$enable_polkit" != "xno"; then
++ PKG_CHECK_MODULES(POLKIT,
++ polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION,
++ have_polkit=yes,
++ have_polkit=no)
++ if test "x$enable_polkit" = "xyes" -a "x$have_polkit" = "xno"; then
++ AC_MSG_ERROR([PolicyKit support explicitly requested but dependencies not found])
++ fi
++fi
++
+ if test "x$have_polkit" = "xyes" ; then
+ AC_DEFINE(HAVE_POLKIT, [], [Define if we have polkit])
+ fi
diff --git a/sys-auth/consolekit/files/consolekit-1.0.0.initd b/sys-auth/consolekit/files/consolekit-1.0.0.initd
new file mode 100644
index 000000000000..4fd1140fe209
--- /dev/null
+++ b/sys-auth/consolekit/files/consolekit-1.0.0.initd
@@ -0,0 +1,16 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+description="consolekit - tracks login sessions and seats"
+pidfile="/run/ConsoleKit/pid"
+command="/usr/sbin/console-kit-daemon"
+
+depend() {
+ need dbus
+ use logger
+}
+
+start_pre() {
+ checkpath -q -d -m 0755 /run/ConsoleKit
+}
diff --git a/sys-auth/consolekit/files/consolekit-1.1.0-Remove-the-root-restriction-for-runtime-dirs.patch b/sys-auth/consolekit/files/consolekit-1.1.0-Remove-the-root-restriction-for-runtime-dirs.patch
new file mode 100644
index 000000000000..301c68f5d904
--- /dev/null
+++ b/sys-auth/consolekit/files/consolekit-1.1.0-Remove-the-root-restriction-for-runtime-dirs.patch
@@ -0,0 +1,57 @@
+From 664d2fdbd966764836b1f4da2dbc5750c7f01f0f Mon Sep 17 00:00:00 2001
+From: Eric Koegel <eric.koegel@gmail.com>
+Date: Sun, 10 Apr 2016 11:20:24 +0300
+Subject: [PATCH] Remove the root restriction for runtime dirs
+
+---
+ src/ck-sysdeps-unix.c | 5 -----
+ tools/ck-remove-directory.c | 10 ----------
+ 2 files changed, 15 deletions(-)
+
+diff --git a/src/ck-sysdeps-unix.c b/src/ck-sysdeps-unix.c
+index 67d8eac..ecd176a 100644
+--- a/src/ck-sysdeps-unix.c
++++ b/src/ck-sysdeps-unix.c
+@@ -409,11 +409,6 @@ ck_generate_runtime_dir_for_user (guint uid)
+
+ TRACE ();
+
+- if (uid < 1) {
+- g_debug ("We do not create runtime dirs for root");
+- return NULL;
+- }
+-
+ errno = 0;
+ pwent = getpwuid (uid);
+ if (pwent == NULL) {
+diff --git a/tools/ck-remove-directory.c b/tools/ck-remove-directory.c
+index cf44fd6..b1a5722 100644
+--- a/tools/ck-remove-directory.c
++++ b/tools/ck-remove-directory.c
+@@ -51,11 +51,6 @@ become_user (uid_t uid, const gchar* dest)
+ int res;
+ struct passwd *pwent;
+
+- if (uid < 1) {
+- g_critical ("invalid UID");
+- exit (1);
+- }
+-
+ if (dest == NULL) {
+ g_critical ("invalid dest");
+ exit (1);
+@@ -148,11 +143,6 @@ main (int argc,
+ exit (1);
+ }
+
+- if (user_id < 1) {
+- g_warning ("Invalid UID");
+- exit (1);
+- }
+-
+ /* Ensure we have a dest and that it starts with the correct prefix
+ * so we don't remove something important.
+ */
+--
+2.7.3
+
diff --git a/sys-auth/consolekit/files/consolekit-1.1.1-0001-Fix-enable-libudev-configure-flag.patch b/sys-auth/consolekit/files/consolekit-1.1.1-0001-Fix-enable-libudev-configure-flag.patch
new file mode 100644
index 000000000000..c6cc61d47843
--- /dev/null
+++ b/sys-auth/consolekit/files/consolekit-1.1.1-0001-Fix-enable-libudev-configure-flag.patch
@@ -0,0 +1,41 @@
+From 91f517bb6e19315c3a9971b2449f2b2e049e785b Mon Sep 17 00:00:00 2001
+From: Eric Koegel <eric.koegel@gmail.com>
+Date: Wed, 10 May 2017 07:13:23 +0300
+Subject: [PATCH] Fix --enable-libudev configure flag
+
+Thanks for perfinion to pointing this out.
+---
+ configure.ac | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 2d927fe..b17801a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -364,10 +364,10 @@ AM_CONDITIONAL([ENABLE_UDEV_ACL], [test "x$enable_udev_acl" = "xyes"])
+ # libudev - use udev as a device manager for ck-device-udev.c
+ have_libudev=no
+ AC_ARG_ENABLE([libudev],
+- AS_HELP_STRING([--enable-udev], [Enable udev support @<:@default=auto@:>@]),
+- [enable_udev=$enableval],
+- [enable_udev=auto])
+-AS_IF([test "x$enable_udev" != "xno"], [
++ AS_HELP_STRING([--enable-libudev], [Enable udev support @<:@default=auto@:>@]),
++ [enable_libudev=$enableval],
++ [enable_libudev=auto])
++AS_IF([test "x$enable_libudev" != "xno"], [
+ PKG_CHECK_MODULES([LIBUDEV], [libudev], [have_libudev=yes], [have_libudev=no])
+ PKG_CHECK_MODULES([LIBDRM], [libdrm], [have_libdrm=yes], [have_libdrm=no])
+ AC_CHECK_LIB([prop], [prop_dictionary_get_cstring], [have_libprop=yes], [have_libprop=no])
+@@ -384,7 +384,7 @@ AS_IF([test "x$enable_udev" != "xno"], [
+ LIBUDEV_LIBS="$LIBUDEV_LIBS -lprop"
+ fi
+
+- if test "x$enable_udev" = "xyes" -a "x$have_udev" = "xno"; then
++ if test "x$enable_libudev" = "xyes" -a "x$have_libudev" = "xno"; then
+ AC_MSG_ERROR([udev support explicitly requested but dependencies not found])
+ fi
+ ])
+--
+2.10.2
+
diff --git a/sys-auth/consolekit/files/consolekit-cleanup_console_tags.patch b/sys-auth/consolekit/files/consolekit-cleanup_console_tags.patch
new file mode 100644
index 000000000000..c02411ebded5
--- /dev/null
+++ b/sys-auth/consolekit/files/consolekit-cleanup_console_tags.patch
@@ -0,0 +1,67 @@
+http://bugs.gentoo.org/257761
+http://patches.ubuntu.com/by-release/extracted/ubuntu/c/consolekit/
+
+--- src/main.c
++++ src/main.c
+@@ -148,6 +148,43 @@
+ unlink (CONSOLE_KIT_PID_FILE);
+ }
+
++#define CONSOLE_TAGS_DIR "/var/run/console"
++
++static void
++delete_console_tags (void)
++{
++ GDir *dir;
++ GError *error = NULL;
++ const gchar *name;
++
++ g_debug ("Cleaning up %s", CONSOLE_TAGS_DIR);
++
++ dir = g_dir_open (CONSOLE_TAGS_DIR, 0, &error);
++ if (dir == NULL) {
++ g_debug ("Couldn't open directory %s: %s", CONSOLE_TAGS_DIR,
++ error->message);
++ g_error_free (error);
++ return;
++ }
++ while ((name = g_dir_read_name (dir)) != NULL) {
++ gchar *file;
++ file = g_build_filename (CONSOLE_TAGS_DIR, name, NULL);
++
++ g_debug ("Removing tag file: %s", file);
++ if (unlink (file) == -1) {
++ g_warning ("Couldn't delete tag file: %s", file);
++ }
++ g_free (file);
++ }
++}
++
++static void
++cleanup (void)
++{
++ delete_console_tags ();
++ delete_pid ();
++}
++
+ /* copied from nautilus */
+ static int debug_log_pipes[2];
+
+@@ -228,7 +265,7 @@
+ snprintf (pid, sizeof (pid), "%lu\n", (long unsigned) getpid ());
+ written = write (pf, pid, strlen (pid));
+ close (pf);
+- g_atexit (delete_pid);
++ g_atexit (cleanup);
+ } else {
+ g_warning ("Unable to write pid file %s: %s",
+ CONSOLE_KIT_PID_FILE,
+@@ -317,6 +354,8 @@
+ goto out;
+ }
+
++ delete_console_tags ();
++
+ create_pid_file ();
+
+ loop = g_main_loop_new (NULL, FALSE);
diff --git a/sys-auth/consolekit/files/consolekit-shutdown-reboot-without-policies.patch b/sys-auth/consolekit/files/consolekit-shutdown-reboot-without-policies.patch
new file mode 100644
index 000000000000..6a46649f7587
--- /dev/null
+++ b/sys-auth/consolekit/files/consolekit-shutdown-reboot-without-policies.patch
@@ -0,0 +1,26 @@
+From: Romain Perier <mrpouet@gentoo.org>
+Date: Sat, 24 Oct 2009 18:43:43 +0200
+Subject: [PATCH] Be able to shutdown or reboot even without polkit or RBAC supports
+
+Ck does NOTHING at the origin if its built without polkit or RBAC supports, except
+display a warning using g_warning() (which does not make sense).
+The trick is to to call do_stop()/do_restart() in the #else directive :)
+
+--- src/ck-manager.c
++++ src/ck-manager.c
+@@ -1131,6 +1131,7 @@
+ check_rbac_permissions (manager, context, RBAC_SHUTDOWN_KEY, do_restart);
+ #else
+ g_warning ("Compiled without PolicyKit or RBAC support!");
++ do_restart(manager, context);
+ #endif
+
+ return TRUE;
+@@ -1207,6 +1208,7 @@
+ check_rbac_permissions (manager, context, RBAC_SHUTDOWN_KEY, do_stop);
+ #else
+ g_warning ("Compiled without PolicyKit or RBAC support!");
++ do_stop(manager, context);
+ #endif
+
+ return TRUE;
diff --git a/sys-auth/consolekit/files/consolekit-udev-acl-install_to_usr.patch b/sys-auth/consolekit/files/consolekit-udev-acl-install_to_usr.patch
new file mode 100644
index 000000000000..3ef39873dbd6
--- /dev/null
+++ b/sys-auth/consolekit/files/consolekit-udev-acl-install_to_usr.patch
@@ -0,0 +1,28 @@
+http://bugs.gentoo.org/398049
+
+--- tools/Makefile.am
++++ tools/Makefile.am
+@@ -144,11 +144,10 @@
+ $(NULL)
+
+ if ENABLE_UDEV_ACL
+-udevdir = $(UDEVDIR)
+ udevrulesdir = $(UDEVDIR)/rules.d
+
+ dist_udevrules_DATA = 70-udev-acl.rules
+-udev_PROGRAMS = udev-acl
++libexec_PROGRAMS = udev-acl
+
+ udev_acl_SOURCES = udev-acl.c
+ udev_acl_LDADD = $(UDEV_ACL_LIBS)
+@@ -156,7 +155,9 @@
+
+ install-exec-hook:
+ mkdir -p $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d
+- ln -sf $(UDEVDIR)/udev-acl $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d/udev-acl.ck
++ mkdir -p $(DESTDIR)$(UDEVDIR)
++ ln -sf $(libexecdir)/udev-acl $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d/udev-acl.ck
++ ln -sf $(libexecdir)/udev-acl $(DESTDIR)$(UDEVDIR)/udev-acl
+ endif
+
+ EXTRA_DIST = \
diff --git a/sys-auth/consolekit/files/pam-foreground-compat.ck b/sys-auth/consolekit/files/pam-foreground-compat.ck
new file mode 100644
index 000000000000..0697ca81ba45
--- /dev/null
+++ b/sys-auth/consolekit/files/pam-foreground-compat.ck
@@ -0,0 +1,17 @@
+#!/bin/sh
+TAGDIR=/var/run/console
+
+[ -n "$CK_SESSION_USER_UID" ] || exit 1
+
+TAGFILE="$TAGDIR/`getent passwd $CK_SESSION_USER_UID | cut -f 1 -d:`"
+
+if [ "$1" = "session_added" ]; then
+ mkdir -p "$TAGDIR"
+ echo "$CK_SESSION_ID" >> "$TAGFILE"
+fi
+
+if [ "$1" = "session_removed" ] && [ -e "$TAGFILE" ]; then
+ sed -i "\%^$CK_SESSION_ID\$%d" "$TAGFILE"
+ [ -s "$TAGFILE" ] || rm -f "$TAGFILE"
+fi
+
diff --git a/sys-auth/consolekit/metadata.xml b/sys-auth/consolekit/metadata.xml
new file mode 100644
index 000000000000..3aa5069e61cb
--- /dev/null
+++ b/sys-auth/consolekit/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>perfinion@gentoo.org</email>
+ <name>Jason Zaman</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>freedesktop-bugs@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="cgroups">Use the kernel to track processes instead of the session cookie.</flag>
+ <flag name="evdev">For handling VT switching with a session controller.</flag>
+ <flag name="pm-utils">Adds support for suspend/resume using <pkg>sys-power/pm-utils</pkg></flag>
+ <flag name="policykit">Use the PolicyKit framework (<pkg>sys-auth/polkit</pkg>) to get authorization for suspend/shutdown.</flag>
+ <flag name="systemd-units">Install systemd unit files to replace the modern functionality of logind in <pkg>sys-apps/systemd</pkg>. Not recommended.</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">ConsoleKit2/ConsoleKit2</remote-id>
+ <remote-id type="launchpad">debian</remote-id>
+ </upstream>
+</pkgmetadata>