commit:     4a2d803749f9fc7c068ab5d77257eebe43812230
Author:     Michael Palimaka <kensington <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 20 11:17:58 2017 +0000
Commit:     Michael Palimaka <kensington <AT> gentoo <DOT> org>
CommitDate: Mon Feb 20 11:19:06 2017 +0000
URL:        https://gitweb.gentoo.org/proj/kde.git/commit/?id=4a2d8037

sys-auth/elogind: add live ebuild

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 sys-auth/elogind/elogind-9999.ebuild      | 90 +++++++++++++++++++++++++++++++
 sys-auth/elogind/files/elogind-docs.patch | 15 ++++++
 sys-auth/elogind/files/elogind.conf       |  7 +++
 sys-auth/elogind/files/elogind.init       | 32 +++++++++++
 sys-auth/elogind/metadata.xml             | 10 ++++
 5 files changed, 154 insertions(+)

diff --git a/sys-auth/elogind/elogind-9999.ebuild 
b/sys-auth/elogind/elogind-9999.ebuild
new file mode 100644
index 0000000000..38df8c18de
--- /dev/null
+++ b/sys-auth/elogind/elogind-9999.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit autotools git-r3 linux-info pam udev
+
+DESCRIPTION="The systemd project's logind, extracted to a standalone package"
+HOMEPAGE="https://github.com/elogind/elogind";
+EGIT_REPO_URI="https://github.com/elogind/elogind.git";
+EGIT_BRANCH="dev_v226"
+
+LICENSE="CC0-1.0 LGPL-2.1+ public-domain"
+SLOT="0"
+KEYWORDS=""
+IUSE="acl pam policykit selinux"
+
+COMMON_DEPEND="
+       sys-apps/util-linux
+       sys-libs/libcap
+       virtual/libudev:=
+       acl? ( sys-apps/acl )
+       pam? ( virtual/pam )
+       selinux? ( sys-libs/libselinux )
+"
+RDEPEND="${COMMON_DEPEND}
+       sys-apps/dbus
+       !sys-apps/systemd
+"
+DEPEND="${COMMON_DEPEND}
+       app-text/docbook-xml-dtd:4.2
+       app-text/docbook-xml-dtd:4.5
+       app-text/docbook-xsl-stylesheets
+       dev-util/gperf
+       dev-util/intltool
+       sys-devel/libtool
+       virtual/pkgconfig
+"
+PDEPEND="policykit? ( sys-auth/polkit )"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-docs.patch"
+)
+
+pkg_setup() {
+       local CONFIG_CHECK="~CGROUPS ~EPOLL ~INOTIFY_USER ~SECURITY_SMACK
+               ~SIGNALFD ~TIMERFD"
+
+       if use kernel_linux; then
+               linux-info_pkg_setup
+       fi
+}
+
+src_prepare() {
+       default
+       eautoreconf # Makefile.am patched by "${FILESDIR}/${PN}-docs.patch"
+}
+
+src_configure() {
+       econf \
+               --with-pamlibdir=$(getpam_mod_dir) \
+               --with-udevrulesdir="$(get_udevdir)"/rules.d \
+               --libdir="${EPREFIX}"/$(get_libdir) \
+               --enable-smack \
+               $(use_enable acl) \
+               $(use_enable pam) \
+               $(use_enable selinux)
+}
+
+src_install() {
+       default
+       find "${D}" -name '*.la' -delete || die
+
+       # Build system ignores --with-rootlibdir and puts pkgconfig below
+       # /$(libdir) - Move it to /usr/$(libdir)/pkgconfig
+       mkdir -p "${ED%/}"/usr/$(get_libdir) || die
+       mv "${ED%/}"/$(get_libdir)/pkgconfig "${ED%/}"/usr/$(get_libdir)/ || die
+
+       newinitd "${FILESDIR}"/${PN}.init ${PN}
+       newconfd "${FILESDIR}"/${PN}.conf ${PN}
+}
+
+pkg_postinst() {
+       if [ "$(rc-config list default | grep elogind)" = "" ]; then
+               ewarn "To enable the elogind daemon, elogind must be"
+               ewarn "added to the default runlevel:"
+               ewarn "# rc-update add elogind default"
+       fi
+}

diff --git a/sys-auth/elogind/files/elogind-docs.patch 
b/sys-auth/elogind/files/elogind-docs.patch
new file mode 100644
index 0000000000..b48e52d73a
--- /dev/null
+++ b/sys-auth/elogind/files/elogind-docs.patch
@@ -0,0 +1,15 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -191,12 +191,6 @@
+ rootbin_PROGRAMS =
+ pkglibexec_PROGRAMS =
+ 
+-dist_doc_DATA = \
+-      README \
+-      NEWS \
+-      LICENSE.LGPL2.1 \
+-      LICENSE.GPL2
+-
+ @INTLTOOL_POLICY_RULE@
+ 
+ # 
------------------------------------------------------------------------------

diff --git a/sys-auth/elogind/files/elogind.conf 
b/sys-auth/elogind/files/elogind.conf
new file mode 100644
index 0000000000..73d1336aec
--- /dev/null
+++ b/sys-auth/elogind/files/elogind.conf
@@ -0,0 +1,7 @@
+# /etc/conf.d/elogind: config file for /etc/init.d/elogind
+
+# this is the elogind executable
+ELOGIND_EXEC="/usr/libexec/elogind/elogind"
+
+# this is where elogind will store its pid file
+ELOGIND_PIDFILE="/var/run/elogind.pid"

diff --git a/sys-auth/elogind/files/elogind.init 
b/sys-auth/elogind/files/elogind.init
new file mode 100644
index 0000000000..04ce34ab4c
--- /dev/null
+++ b/sys-auth/elogind/files/elogind.init
@@ -0,0 +1,32 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+       need dbus
+
+       # Make sure elogind is up before xdm starts any dm
+       before xdm
+}
+
+start() {
+       ebegin "Starting elogind"
+
+       # elogind needs a /run/systemd directory
+       if [[ ! -e /run/systemd ]]; then
+               mkdir -p /run/systemd
+               chmod 755 /run/systemd
+       fi
+
+       start-stop-daemon --start --quiet --background \
+               --make-pidfile --pidfile "${ELOGIND_PIDFILE}" \
+               --exec "${ELOGIND_EXEC}"
+       eend $?
+}
+
+stop() {
+       ebegin "Stopping elogind"
+       start-stop-daemon --stop --quiet --pidfile "${ELOGIND_PIDFILE}"
+       eend $?
+}

diff --git a/sys-auth/elogind/metadata.xml b/sys-auth/elogind/metadata.xml
new file mode 100644
index 0000000000..927a215253
--- /dev/null
+++ b/sys-auth/elogind/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="project">
+               <email>[email protected]</email>
+       </maintainer>
+       <use>
+               <flag name="apparmor">Enable AppArmor support</flag>
+       </use>
+</pkgmetadata>

Reply via email to