Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/systemd/
Date: Mon, 20 Nov 2017 22:02:54
Message-Id: 1511215367.4be05a627b9858a5c530045fef057ec6bb9057f1.floppym@gentoo
1 commit: 4be05a627b9858a5c530045fef057ec6bb9057f1
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Mon Nov 20 22:01:14 2017 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Mon Nov 20 22:02:47 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4be05a62
7
8 sys-apps/systemd: remove ROOTPREFIX variable and add usrmerge USE flag
9
10 Package-Manager: Portage-2.3.14_p5, Repoman-2.3.6
11
12 sys-apps/systemd/metadata.xml | 1 +
13 sys-apps/systemd/systemd-9999.ebuild | 35 ++++++++++-------------------------
14 2 files changed, 11 insertions(+), 25 deletions(-)
15
16 diff --git a/sys-apps/systemd/metadata.xml b/sys-apps/systemd/metadata.xml
17 index 357ed6005f9..85e4b806ba6 100644
18 --- a/sys-apps/systemd/metadata.xml
19 +++ b/sys-apps/systemd/metadata.xml
20 @@ -27,6 +27,7 @@
21 <flag name="nat">Enable support for network address translation in networkd</flag>
22 <flag name="qrcode">Enable qrcode output support in journal</flag>
23 <flag name="sysv-utils">Install sysvinit compatibility symlinks and manpages for init, telinit, halt, poweroff, reboot, runlevel, and shutdown</flag>
24 + <flag name="usrmerge">Enable /usr merge</flag>
25 <flag name="vanilla">Disable Gentoo-specific behavior and compatibility quirks</flag>
26 <flag name="xkb">Depend on <pkg>x11-libs/libxkbcommon</pkg> to allow logind to control the X11 keymap</flag>
27 </use>
28
29 diff --git a/sys-apps/systemd/systemd-9999.ebuild b/sys-apps/systemd/systemd-9999.ebuild
30 index 8256350c5e1..68d217b7d1c 100644
31 --- a/sys-apps/systemd/systemd-9999.ebuild
32 +++ b/sys-apps/systemd/systemd-9999.ebuild
33 @@ -20,9 +20,7 @@ HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd"
34
35 LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
36 SLOT="0/2"
37 -IUSE="acl apparmor audit build cryptsetup curl elfutils +gcrypt gnuefi http
38 - idn importd +kmod libidn2 +lz4 lzma nat pam policykit
39 - qrcode +seccomp selinux ssl sysv-utils test vanilla xkb"
40 +IUSE="acl apparmor audit build cryptsetup curl elfutils +gcrypt gnuefi http idn importd +kmod libidn2 +lz4 lzma nat pam policykit qrcode +seccomp selinux ssl sysv-utils test usrmerge vanilla xkb"
41
42 REQUIRED_USE="importd? ( curl gcrypt lzma )"
43
44 @@ -200,9 +198,8 @@ multilib_src_configure() {
45 -Dpamlibdir="$(getpam_mod_dir)"
46 # avoid bash-completion dep
47 -Dbashcompletiondir="$(get_bashcompdir)"
48 - # make sure we get /bin:/sbin in $PATH
49 - -Dsplit-usr=true
50 - -Drootprefix="${EPREFIX}${ROOTPREFIX}"
51 + # make sure we get /bin:/sbin in PATH
52 + -Dsplit-usr=$(usex usrmerge false true)
53 -Dsysvinit-path=
54 -Dsysvrcnd-path=
55 # no deps
56 @@ -299,10 +296,11 @@ multilib_src_install_all() {
57 dodoc "${FILESDIR}"/nsswitch.conf
58
59 if use sysv-utils; then
60 + local app
61 for app in halt poweroff reboot runlevel shutdown telinit; do
62 - dosym "${EPREFIX}${ROOTPREFIX%/}/bin/systemctl" /sbin/${app}
63 + dosym ../bin/systemctl /sbin/${app}
64 done
65 - dosym "${EPREFIX}${ROOTPREFIX%/}/lib/systemd/systemd" /sbin/init
66 + dosym ../lib/systemd/systemd /sbin/init
67 else
68 # we just keep sysvinit tools, so no need for the mans
69 rm "${ED%/}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \
70 @@ -328,12 +326,12 @@ multilib_src_install_all() {
71 rm -fr "${ED%/}"/etc/systemd/system/sockets.target.wants || die
72 rm -fr "${ED%/}"/etc/systemd/system/sysinit.target.wants || die
73
74 - rm -r "${ED%/}${ROOTPREFIX%/}/lib/udev/hwdb.d" || die
75 + rm -r "${ED%/}"/lib/udev/hwdb.d || die
76
77 - if [[ ! -e "${ED%/}"/usr/lib/systemd/systemd ]]; then
78 + if ! use usrmerge; then
79 # Avoid breaking boot/reboot
80 - dosym "../../..${ROOTPREFIX%/}/lib/systemd/systemd" /usr/lib/systemd/systemd
81 - dosym "../../..${ROOTPREFIX%/}/lib/systemd/systemd-shutdown" /usr/lib/systemd/systemd-shutdown
82 + dosym ../../../lib/systemd/systemd /usr/lib/systemd/systemd
83 + dosym ../../../lib/systemd/systemd-shutdown /usr/lib/systemd/systemd-shutdown
84 fi
85 }
86
87 @@ -381,19 +379,6 @@ migrate_locale() {
88 fi
89 }
90
91 -pkg_preinst() {
92 - # If /lib/systemd and /usr/lib/systemd are the same directory, remove the
93 - # symlinks we created in src_install.
94 - if [[ $(realpath "${EROOT%/}${ROOTPREFIX}/lib/systemd") == $(realpath "${EROOT%/}/usr/lib/systemd") ]]; then
95 - if [[ -L ${ED%/}/usr/lib/systemd/systemd ]]; then
96 - rm "${ED%/}/usr/lib/systemd/systemd" || die
97 - fi
98 - if [[ -L ${ED%/}/usr/lib/systemd/systemd-shutdown ]]; then
99 - rm "${ED%/}/usr/lib/systemd/systemd-shutdown" || die
100 - fi
101 - fi
102 -}
103 -
104 pkg_postinst() {
105 newusergroup() {
106 enewgroup "$1"