Gentoo Archives: gentoo-commits

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