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