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