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