1 |
commit: 9189edf61c8e135c0cd28be3534d7624cafff239 |
2 |
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Oct 28 22:53:46 2018 +0000 |
4 |
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Oct 28 23:21:05 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9189edf6 |
7 |
|
8 |
sys-apps/systemd: backport several patches for 239 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/662776 |
11 |
Bug: https://bugs.gentoo.org/669664 |
12 |
Bug: https://bugs.gentoo.org/669716 |
13 |
Package-Manager: Portage-2.3.51_p2, Repoman-2.3.11_p27 |
14 |
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org> |
15 |
|
16 |
sys-apps/systemd/Manifest | 1 + |
17 |
sys-apps/systemd/systemd-239-r2.ebuild | 448 +++++++++++++++++++++++++++++++++ |
18 |
2 files changed, 449 insertions(+) |
19 |
|
20 |
diff --git a/sys-apps/systemd/Manifest b/sys-apps/systemd/Manifest |
21 |
index bc680ff9ea6..151c9029776 100644 |
22 |
--- a/sys-apps/systemd/Manifest |
23 |
+++ b/sys-apps/systemd/Manifest |
24 |
@@ -3,4 +3,5 @@ DIST systemd-236.tar.gz 6759035 BLAKE2B 0fc26bd67fb6cc3b0565c763fc26e38186c4b05c |
25 |
DIST systemd-238-patches-1.tar.gz 47512 BLAKE2B 9edf8835ec7bba43bd00b1481b23bc5a4148030724633a8bfe1e82ec48b79699d4822b0bc5ea3a979b404e706efa9c0eae8e0460d76658ba2e901c4853da0c04 SHA512 809d8a3a9a023217b509b738e0d341d060f1343df6159e5acfcededfb452986de140ddf4b879a5157fba1a5646d00db8b6537aba8358c48f75fd6527f881a14c |
26 |
DIST systemd-238.tar.gz 6954022 BLAKE2B 9b5cc36a7234c0d037a2656ee1e5ed54186a394b8be41771ebc29c903d3efcecf7f13f004a6d1695c022923bd0d540a243e897852f07e810f73fd3163f688dde SHA512 c0f272b022308d3bd94679184e102a8dc85de55310bda205a458ea33c77c7733e5c8c8e5b15f786ba3e0ce59e7c6a9bf0d5a0950517c6b91e0f345950129b9c8 |
27 |
DIST systemd-239-patches-0.tar.gz 14007 BLAKE2B a1653ac6cb46347fa1e1a4a81a7003af0e565ac2ba43e1aaed9df87d7e4bd13cdcf26ffc9527f46defa226d7d11b03fbc6b018f0734a6654a0f4bf88bf4ef6e7 SHA512 a640a446db153523a2ca97b811e20bc42c8273d2c494ebd8a6c5cd33718c714e37544533749cad57e887c17635cbfca01b86b52e9f5a12878ef70f2e95fc7485 |
28 |
+DIST systemd-239-patches-1.tar.gz 20639 BLAKE2B 9b03367becdef20d16056cdbbeaaefd9f10bf6c56528ad1a738684ab08d99a464411c23aea32d47307b0399f092107069d09ad42fb07217f8eca520cc4010b84 SHA512 757c7fc8f60ccf99d2803128a8c4d8b924093b150384569c5ffb3bc39f06728e99b18e2f77ff0f1c16bbd45bc75cbb0f385dac0135443d70c7dcd9cc1e84a490 |
29 |
DIST systemd-239.tar.gz 7157293 BLAKE2B 975f6215c8bb6662d6e161f637e1fece22930c0190b3c31a8fc4cb1a10600546a252704ac95590d9d14e495fcd06082a590e6d755e36603a41b3a396d579d8b0 SHA512 fd44590dfd148504c5ed1e67521efce50d84b627b7fc77015fa95dfa76d7a42297c56cc89eff40181809732024b16d48f2a87038cf435e0c63bc2b95ecd86b0f |
30 |
|
31 |
diff --git a/sys-apps/systemd/systemd-239-r2.ebuild b/sys-apps/systemd/systemd-239-r2.ebuild |
32 |
new file mode 100644 |
33 |
index 00000000000..5adff5e094e |
34 |
--- /dev/null |
35 |
+++ b/sys-apps/systemd/systemd-239-r2.ebuild |
36 |
@@ -0,0 +1,448 @@ |
37 |
+# Copyright 1999-2018 Gentoo Authors |
38 |
+# Distributed under the terms of the GNU General Public License v2 |
39 |
+ |
40 |
+EAPI=6 |
41 |
+ |
42 |
+if [[ ${PV} == 9999 ]]; then |
43 |
+ EGIT_REPO_URI="https://github.com/systemd/systemd.git" |
44 |
+ inherit git-r3 |
45 |
+else |
46 |
+ SRC_URI="https://github.com/systemd/systemd/archive/v${PV}/${P}.tar.gz |
47 |
+ https://dev.gentoo.org/~floppym/dist/${P}-patches-1.tar.gz" |
48 |
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86" |
49 |
+fi |
50 |
+ |
51 |
+PYTHON_COMPAT=( python{3_4,3_5,3_6} ) |
52 |
+ |
53 |
+inherit bash-completion-r1 linux-info meson multilib-minimal ninja-utils pam python-any-r1 systemd toolchain-funcs udev user |
54 |
+ |
55 |
+DESCRIPTION="System and service manager for Linux" |
56 |
+HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd" |
57 |
+ |
58 |
+LICENSE="GPL-2 LGPL-2.1 MIT public-domain" |
59 |
+SLOT="0/2" |
60 |
+IUSE="acl apparmor audit build cryptsetup curl elfutils +gcrypt gnuefi http idn importd +kmod libidn2 +lz4 lzma nat pam pcre policykit qrcode +resolvconf +seccomp selinux +split-usr ssl +sysv-utils test vanilla xkb" |
61 |
+ |
62 |
+REQUIRED_USE="importd? ( curl gcrypt lzma )" |
63 |
+RESTRICT="!test? ( test )" |
64 |
+ |
65 |
+MINKV="3.11" |
66 |
+ |
67 |
+COMMON_DEPEND=">=sys-apps/util-linux-2.30:0=[${MULTILIB_USEDEP}] |
68 |
+ sys-libs/libcap:0=[${MULTILIB_USEDEP}] |
69 |
+ !<sys-libs/glibc-2.16 |
70 |
+ acl? ( sys-apps/acl:0= ) |
71 |
+ apparmor? ( sys-libs/libapparmor:0= ) |
72 |
+ audit? ( >=sys-process/audit-2:0= ) |
73 |
+ cryptsetup? ( >=sys-fs/cryptsetup-1.6:0= ) |
74 |
+ curl? ( net-misc/curl:0= ) |
75 |
+ elfutils? ( >=dev-libs/elfutils-0.158:0= ) |
76 |
+ gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] ) |
77 |
+ http? ( |
78 |
+ >=net-libs/libmicrohttpd-0.9.33:0= |
79 |
+ ssl? ( >=net-libs/gnutls-3.1.4:0= ) |
80 |
+ ) |
81 |
+ idn? ( |
82 |
+ libidn2? ( net-dns/libidn2:= ) |
83 |
+ !libidn2? ( net-dns/libidn:= ) |
84 |
+ ) |
85 |
+ importd? ( |
86 |
+ app-arch/bzip2:0= |
87 |
+ sys-libs/zlib:0= |
88 |
+ ) |
89 |
+ kmod? ( >=sys-apps/kmod-15:0= ) |
90 |
+ lz4? ( >=app-arch/lz4-0_p131:0=[${MULTILIB_USEDEP}] ) |
91 |
+ lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] ) |
92 |
+ nat? ( net-firewall/iptables:0= ) |
93 |
+ pam? ( virtual/pam:=[${MULTILIB_USEDEP}] ) |
94 |
+ pcre? ( dev-libs/libpcre2 ) |
95 |
+ qrcode? ( media-gfx/qrencode:0= ) |
96 |
+ seccomp? ( >=sys-libs/libseccomp-2.3.3:0= ) |
97 |
+ selinux? ( sys-libs/libselinux:0= ) |
98 |
+ xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )" |
99 |
+ |
100 |
+# baselayout-2.2 has /run |
101 |
+RDEPEND="${COMMON_DEPEND} |
102 |
+ >=sys-apps/baselayout-2.2 |
103 |
+ selinux? ( sec-policy/selinux-base-policy[systemd] ) |
104 |
+ sysv-utils? ( !sys-apps/sysvinit ) |
105 |
+ !sysv-utils? ( sys-apps/sysvinit ) |
106 |
+ resolvconf? ( !net-dns/openresolv ) |
107 |
+ !build? ( || ( |
108 |
+ sys-apps/util-linux[kill(-)] |
109 |
+ sys-process/procps[kill(+)] |
110 |
+ sys-apps/coreutils[kill(-)] |
111 |
+ ) ) |
112 |
+ !sys-auth/nss-myhostname |
113 |
+ !<sys-kernel/dracut-044 |
114 |
+ !sys-fs/eudev |
115 |
+ !sys-fs/udev" |
116 |
+ |
117 |
+# sys-apps/dbus: the daemon only (+ build-time lib dep for tests) |
118 |
+PDEPEND=">=sys-apps/dbus-1.9.8[systemd] |
119 |
+ >=sys-apps/hwids-20150417[udev] |
120 |
+ >=sys-fs/udev-init-scripts-25 |
121 |
+ policykit? ( sys-auth/polkit ) |
122 |
+ !vanilla? ( sys-apps/gentoo-systemd-integration )" |
123 |
+ |
124 |
+# Newer linux-headers needed by ia64, bug #480218 |
125 |
+DEPEND="${COMMON_DEPEND} |
126 |
+ app-arch/xz-utils:0 |
127 |
+ dev-util/gperf |
128 |
+ >=dev-util/intltool-0.50 |
129 |
+ >=sys-apps/coreutils-8.16 |
130 |
+ >=sys-kernel/linux-headers-${MINKV} |
131 |
+ virtual/pkgconfig |
132 |
+ gnuefi? ( >=sys-boot/gnu-efi-3.0.2 ) |
133 |
+ test? ( sys-apps/dbus ) |
134 |
+ app-text/docbook-xml-dtd:4.2 |
135 |
+ app-text/docbook-xml-dtd:4.5 |
136 |
+ app-text/docbook-xsl-stylesheets |
137 |
+ dev-libs/libxslt:0 |
138 |
+ $(python_gen_any_dep 'dev-python/lxml[${PYTHON_USEDEP}]') |
139 |
+" |
140 |
+ |
141 |
+pkg_pretend() { |
142 |
+ if [[ ${MERGE_TYPE} != buildonly ]]; then |
143 |
+ local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS |
144 |
+ ~CHECKPOINT_RESTORE ~DEVTMPFS ~EPOLL ~FANOTIFY ~FHANDLE |
145 |
+ ~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SIGNALFD ~SYSFS |
146 |
+ ~TIMERFD ~TMPFS_XATTR ~UNIX |
147 |
+ ~CRYPTO_HMAC ~CRYPTO_SHA256 ~CRYPTO_USER_API_HASH |
148 |
+ ~!FW_LOADER_USER_HELPER_FALLBACK ~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED |
149 |
+ ~!SYSFS_DEPRECATED_V2" |
150 |
+ |
151 |
+ use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL" |
152 |
+ use seccomp && CONFIG_CHECK+=" ~SECCOMP ~SECCOMP_FILTER" |
153 |
+ kernel_is -lt 3 7 && CONFIG_CHECK+=" ~HOTPLUG" |
154 |
+ kernel_is -lt 4 7 && CONFIG_CHECK+=" ~DEVPTS_MULTIPLE_INSTANCES" |
155 |
+ kernel_is -ge 4 10 && CONFIG_CHECK+=" ~CGROUP_BPF" |
156 |
+ |
157 |
+ if linux_config_exists; then |
158 |
+ local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH) |
159 |
+ if [[ -n ${uevent_helper_path} ]] && [[ ${uevent_helper_path} != '""' ]]; then |
160 |
+ ewarn "It's recommended to set an empty value to the following kernel config option:" |
161 |
+ ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}" |
162 |
+ fi |
163 |
+ if linux_chkconfig_present X86; then |
164 |
+ CONFIG_CHECK+=" ~DMIID" |
165 |
+ fi |
166 |
+ fi |
167 |
+ |
168 |
+ if kernel_is -lt ${MINKV//./ }; then |
169 |
+ ewarn "Kernel version at least ${MINKV} required" |
170 |
+ fi |
171 |
+ |
172 |
+ check_extra_config |
173 |
+ fi |
174 |
+} |
175 |
+ |
176 |
+pkg_setup() { |
177 |
+ : |
178 |
+} |
179 |
+ |
180 |
+src_unpack() { |
181 |
+ default |
182 |
+ [[ ${PV} != 9999 ]] || git-r3_src_unpack |
183 |
+} |
184 |
+ |
185 |
+src_prepare() { |
186 |
+ # Do NOT add patches here |
187 |
+ local PATCHES=() |
188 |
+ |
189 |
+ [[ -d "${WORKDIR}"/patches ]] && PATCHES+=( "${WORKDIR}"/patches ) |
190 |
+ |
191 |
+ # Add local patches here |
192 |
+ PATCHES+=( |
193 |
+ "${FILESDIR}"/239-debug-extra.patch |
194 |
+ ) |
195 |
+ |
196 |
+ if ! use vanilla; then |
197 |
+ PATCHES+=( |
198 |
+ "${FILESDIR}/gentoo-Dont-enable-audit-by-default.patch" |
199 |
+ "${FILESDIR}/gentoo-systemd-user-pam.patch" |
200 |
+ "${FILESDIR}/gentoo-uucp-group-r1.patch" |
201 |
+ "${FILESDIR}/gentoo-generator-path.patch" |
202 |
+ ) |
203 |
+ fi |
204 |
+ |
205 |
+ default |
206 |
+} |
207 |
+ |
208 |
+src_configure() { |
209 |
+ # Prevent conflicts with i686 cross toolchain, bug 559726 |
210 |
+ tc-export AR CC NM OBJCOPY RANLIB |
211 |
+ |
212 |
+ python_setup |
213 |
+ |
214 |
+ multilib-minimal_src_configure |
215 |
+} |
216 |
+ |
217 |
+meson_use() { |
218 |
+ usex "$1" true false |
219 |
+} |
220 |
+ |
221 |
+meson_multilib() { |
222 |
+ if multilib_is_native_abi; then |
223 |
+ echo true |
224 |
+ else |
225 |
+ echo false |
226 |
+ fi |
227 |
+} |
228 |
+ |
229 |
+meson_multilib_native_use() { |
230 |
+ if multilib_is_native_abi && use "$1"; then |
231 |
+ echo true |
232 |
+ else |
233 |
+ echo false |
234 |
+ fi |
235 |
+} |
236 |
+ |
237 |
+multilib_src_configure() { |
238 |
+ local myconf=( |
239 |
+ --localstatedir="${EPREFIX}/var" |
240 |
+ -Dpamlibdir="$(getpam_mod_dir)" |
241 |
+ # avoid bash-completion dep |
242 |
+ -Dbashcompletiondir="$(get_bashcompdir)" |
243 |
+ # make sure we get /bin:/sbin in PATH |
244 |
+ -Dsplit-usr=$(usex split-usr true false) |
245 |
+ -Drootprefix="$(usex split-usr "${EPREFIX:-/}" "${EPREFIX}/usr")" |
246 |
+ -Dsysvinit-path= |
247 |
+ -Dsysvrcnd-path= |
248 |
+ # Avoid infinite exec recursion, bug 642724 |
249 |
+ -Dtelinit-path="${EPREFIX}/lib/sysvinit/telinit" |
250 |
+ # no deps |
251 |
+ -Defi=$(meson_multilib) |
252 |
+ -Dima=true |
253 |
+ # Optional components/dependencies |
254 |
+ -Dacl=$(meson_multilib_native_use acl) |
255 |
+ -Dapparmor=$(meson_multilib_native_use apparmor) |
256 |
+ -Daudit=$(meson_multilib_native_use audit) |
257 |
+ -Dlibcryptsetup=$(meson_multilib_native_use cryptsetup) |
258 |
+ -Dlibcurl=$(meson_multilib_native_use curl) |
259 |
+ -Delfutils=$(meson_multilib_native_use elfutils) |
260 |
+ -Dgcrypt=$(meson_use gcrypt) |
261 |
+ -Dgnu-efi=$(meson_multilib_native_use gnuefi) |
262 |
+ -Defi-libdir="${EPREFIX}/usr/$(get_libdir)" |
263 |
+ -Dmicrohttpd=$(meson_multilib_native_use http) |
264 |
+ $(usex http -Dgnutls=$(meson_multilib_native_use ssl) -Dgnutls=false) |
265 |
+ -Dimportd=$(meson_multilib_native_use importd) |
266 |
+ -Dbzip2=$(meson_multilib_native_use importd) |
267 |
+ -Dzlib=$(meson_multilib_native_use importd) |
268 |
+ -Dkmod=$(meson_multilib_native_use kmod) |
269 |
+ -Dlz4=$(meson_use lz4) |
270 |
+ -Dxz=$(meson_use lzma) |
271 |
+ -Dlibiptc=$(meson_multilib_native_use nat) |
272 |
+ -Dpam=$(meson_use pam) |
273 |
+ -Dpcre2=$(meson_multilib_native_use pcre) |
274 |
+ -Dpolkit=$(meson_multilib_native_use policykit) |
275 |
+ -Dqrencode=$(meson_multilib_native_use qrcode) |
276 |
+ -Dseccomp=$(meson_multilib_native_use seccomp) |
277 |
+ -Dselinux=$(meson_multilib_native_use selinux) |
278 |
+ #-Dtests=$(meson_multilib_native_use test) |
279 |
+ -Ddbus=$(meson_multilib_native_use test) |
280 |
+ -Dxkbcommon=$(meson_multilib_native_use xkb) |
281 |
+ # hardcode a few paths to spare some deps |
282 |
+ -Dkill-path=/bin/kill |
283 |
+ -Dntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org" |
284 |
+ # Breaks screen, tmux, etc. |
285 |
+ -Ddefault-kill-user-processes=false |
286 |
+ |
287 |
+ # multilib options |
288 |
+ -Dbacklight=$(meson_multilib) |
289 |
+ -Dbinfmt=$(meson_multilib) |
290 |
+ -Dcoredump=$(meson_multilib) |
291 |
+ -Denvironment-d=$(meson_multilib) |
292 |
+ -Dfirstboot=$(meson_multilib) |
293 |
+ -Dhibernate=$(meson_multilib) |
294 |
+ -Dhostnamed=$(meson_multilib) |
295 |
+ -Dhwdb=$(meson_multilib) |
296 |
+ -Dldconfig=$(meson_multilib) |
297 |
+ -Dlocaled=$(meson_multilib) |
298 |
+ -Dman=$(meson_multilib) |
299 |
+ -Dnetworkd=$(meson_multilib) |
300 |
+ -Dquotacheck=$(meson_multilib) |
301 |
+ -Drandomseed=$(meson_multilib) |
302 |
+ -Drfkill=$(meson_multilib) |
303 |
+ -Dsysusers=$(meson_multilib) |
304 |
+ -Dtimedated=$(meson_multilib) |
305 |
+ -Dtimesyncd=$(meson_multilib) |
306 |
+ -Dtmpfiles=$(meson_multilib) |
307 |
+ -Dvconsole=$(meson_multilib) |
308 |
+ ) |
309 |
+ |
310 |
+ if multilib_is_native_abi && use idn; then |
311 |
+ myconf+=( |
312 |
+ -Dlibidn2=$(usex libidn2 true false) |
313 |
+ -Dlibidn=$(usex libidn2 false true) |
314 |
+ ) |
315 |
+ else |
316 |
+ myconf+=( |
317 |
+ -Dlibidn2=false |
318 |
+ -Dlibidn=false |
319 |
+ ) |
320 |
+ fi |
321 |
+ |
322 |
+ meson_src_configure "${myconf[@]}" |
323 |
+} |
324 |
+ |
325 |
+multilib_src_compile() { |
326 |
+ eninja |
327 |
+} |
328 |
+ |
329 |
+multilib_src_test() { |
330 |
+ unset DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR |
331 |
+ eninja test |
332 |
+} |
333 |
+ |
334 |
+multilib_src_install() { |
335 |
+ DESTDIR="${D}" eninja install |
336 |
+} |
337 |
+ |
338 |
+multilib_src_install_all() { |
339 |
+ local rootprefix=$(usex split-usr '' /usr) |
340 |
+ |
341 |
+ # meson doesn't know about docdir |
342 |
+ mv "${ED%/}"/usr/share/doc/{systemd,${PF}} || die |
343 |
+ |
344 |
+ einstalldocs |
345 |
+ dodoc "${FILESDIR}"/nsswitch.conf |
346 |
+ |
347 |
+ if ! use resolvconf; then |
348 |
+ rm -f "${ED%/}${rootprefix}"/sbin/resolvconf || die |
349 |
+ fi |
350 |
+ |
351 |
+ if ! use sysv-utils; then |
352 |
+ rm "${ED%/}${rootprefix}"/sbin/{halt,init,poweroff,reboot,runlevel,shutdown,telinit} || die |
353 |
+ rm "${ED%/}"/usr/share/man/man1/init.1 || die |
354 |
+ rm "${ED%/}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 || die |
355 |
+ fi |
356 |
+ |
357 |
+ if ! use resolvconf && ! use sysv-utils; then |
358 |
+ rmdir "${ED%/}${rootprefix}"/sbin || die |
359 |
+ fi |
360 |
+ |
361 |
+ # Preserve empty dirs in /etc & /var, bug #437008 |
362 |
+ keepdir /etc/{binfmt.d,modules-load.d,tmpfiles.d} |
363 |
+ keepdir /etc/systemd/{ntp-units.d,user} /var/lib/systemd |
364 |
+ keepdir /etc/udev/{hwdb.d,rules.d} |
365 |
+ keepdir /var/log/journal/remote |
366 |
+ |
367 |
+ # Symlink /etc/sysctl.conf for easy migration. |
368 |
+ dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf |
369 |
+ |
370 |
+ # If we install these symlinks, there is no way for the sysadmin to remove them |
371 |
+ # permanently. |
372 |
+ rm -f "${ED%/}"/etc/systemd/system/multi-user.target.wants/systemd-networkd.service || die |
373 |
+ rm -f "${ED%/}"/etc/systemd/system/dbus-org.freedesktop.network1.service || die |
374 |
+ rm -f "${ED%/}"/etc/systemd/system/multi-user.target.wants/systemd-resolved.service || die |
375 |
+ rm -f "${ED%/}"/etc/systemd/system/dbus-org.freedesktop.resolve1.service || die |
376 |
+ rm -fr "${ED%/}"/etc/systemd/system/network-online.target.wants || die |
377 |
+ rm -fr "${ED%/}"/etc/systemd/system/sockets.target.wants || die |
378 |
+ rm -fr "${ED%/}"/etc/systemd/system/sysinit.target.wants || die |
379 |
+ |
380 |
+ local udevdir=/lib/udev |
381 |
+ use split-usr || udevdir=/usr/lib/udev |
382 |
+ |
383 |
+ rm -r "${ED%/}${udevdir}/hwdb.d" || die |
384 |
+ |
385 |
+ if use split-usr; then |
386 |
+ # Avoid breaking boot/reboot |
387 |
+ dosym ../../../lib/systemd/systemd /usr/lib/systemd/systemd |
388 |
+ dosym ../../../lib/systemd/systemd-shutdown /usr/lib/systemd/systemd-shutdown |
389 |
+ fi |
390 |
+} |
391 |
+ |
392 |
+migrate_locale() { |
393 |
+ local envd_locale_def="${EROOT%/}/etc/env.d/02locale" |
394 |
+ local envd_locale=( "${EROOT%/}"/etc/env.d/??locale ) |
395 |
+ local locale_conf="${EROOT%/}/etc/locale.conf" |
396 |
+ |
397 |
+ if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then |
398 |
+ # If locale.conf does not exist... |
399 |
+ if [[ -e ${envd_locale} ]]; then |
400 |
+ # ...either copy env.d/??locale if there's one |
401 |
+ ebegin "Moving ${envd_locale} to ${locale_conf}" |
402 |
+ mv "${envd_locale}" "${locale_conf}" |
403 |
+ eend ${?} || FAIL=1 |
404 |
+ else |
405 |
+ # ...or create a dummy default |
406 |
+ ebegin "Creating ${locale_conf}" |
407 |
+ cat > "${locale_conf}" <<-EOF |
408 |
+ # This file has been created by the sys-apps/systemd ebuild. |
409 |
+ # See locale.conf(5) and localectl(1). |
410 |
+ |
411 |
+ # LANG=${LANG} |
412 |
+ EOF |
413 |
+ eend ${?} || FAIL=1 |
414 |
+ fi |
415 |
+ fi |
416 |
+ |
417 |
+ if [[ ! -L ${envd_locale} ]]; then |
418 |
+ # now, if env.d/??locale is not a symlink (to locale.conf)... |
419 |
+ if [[ -e ${envd_locale} ]]; then |
420 |
+ # ...warn the user that he has duplicate locale settings |
421 |
+ ewarn |
422 |
+ ewarn "To ensure consistent behavior, you should replace ${envd_locale}" |
423 |
+ ewarn "with a symlink to ${locale_conf}. Please migrate your settings" |
424 |
+ ewarn "and create the symlink with the following command:" |
425 |
+ ewarn "ln -s -n -f ../locale.conf ${envd_locale}" |
426 |
+ ewarn |
427 |
+ else |
428 |
+ # ...or just create the symlink if there's nothing here |
429 |
+ ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink" |
430 |
+ ln -n -s ../locale.conf "${envd_locale_def}" |
431 |
+ eend ${?} || FAIL=1 |
432 |
+ fi |
433 |
+ fi |
434 |
+} |
435 |
+ |
436 |
+pkg_postinst() { |
437 |
+ newusergroup() { |
438 |
+ enewgroup "$1" |
439 |
+ enewuser "$1" -1 -1 -1 "$1" |
440 |
+ } |
441 |
+ |
442 |
+ enewgroup input |
443 |
+ enewgroup kvm 78 |
444 |
+ enewgroup render |
445 |
+ enewgroup systemd-journal |
446 |
+ newusergroup systemd-bus-proxy |
447 |
+ newusergroup systemd-coredump |
448 |
+ newusergroup systemd-journal-gateway |
449 |
+ newusergroup systemd-journal-remote |
450 |
+ newusergroup systemd-journal-upload |
451 |
+ newusergroup systemd-network |
452 |
+ newusergroup systemd-resolve |
453 |
+ newusergroup systemd-timesync |
454 |
+ |
455 |
+ systemd_update_catalog |
456 |
+ |
457 |
+ # Keep this here in case the database format changes so it gets updated |
458 |
+ # when required. Despite that this file is owned by sys-apps/hwids. |
459 |
+ if has_version "sys-apps/hwids[udev]"; then |
460 |
+ udevadm hwdb --update --root="${EROOT%/}" |
461 |
+ fi |
462 |
+ |
463 |
+ udev_reload || FAIL=1 |
464 |
+ |
465 |
+ # Bug 465468, make sure locales are respect, and ensure consistency |
466 |
+ # between OpenRC & systemd |
467 |
+ migrate_locale |
468 |
+ |
469 |
+ systemd_reenable systemd-networkd.service systemd-resolved.service |
470 |
+ |
471 |
+ if [[ ${FAIL} ]]; then |
472 |
+ eerror "One of the postinst commands failed. Please check the postinst output" |
473 |
+ eerror "for errors. You may need to clean up your system and/or try installing" |
474 |
+ eerror "systemd again." |
475 |
+ eerror |
476 |
+ fi |
477 |
+} |
478 |
+ |
479 |
+pkg_prerm() { |
480 |
+ # If removing systemd completely, remove the catalog database. |
481 |
+ if [[ ! ${REPLACED_BY_VERSION} ]]; then |
482 |
+ rm -f -v "${EROOT}"/var/lib/systemd/catalog/database |
483 |
+ fi |
484 |
+} |