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, 04 Jan 2022 22:30:32
Message-Id: 1641335371.092ca719a44fe2cd7a066204452e04385315c898.floppym@gentoo
1 commit: 092ca719a44fe2cd7a066204452e04385315c898
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 4 22:28:57 2022 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 4 22:29:31 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=092ca719
7
8 sys-apps/systemd: add 250.1
9
10 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
11
12 sys-apps/systemd/Manifest | 1 +
13 sys-apps/systemd/systemd-250.1.ebuild | 520 ++++++++++++++++++++++++++++++++++
14 2 files changed, 521 insertions(+)
15
16 diff --git a/sys-apps/systemd/Manifest b/sys-apps/systemd/Manifest
17 index 7c49cd66997a..d4ae82f0084d 100644
18 --- a/sys-apps/systemd/Manifest
19 +++ b/sys-apps/systemd/Manifest
20 @@ -1,3 +1,4 @@
21 DIST systemd-250.tar.gz 11112823 BLAKE2B c75ac7f1fcf1a65c9c88b25dce78dd44a039025b52767c3a1de78fae7a89705ed8ba8986d18d674faa9bfac3380a1c847bde35292d16f90bf22d992a459ddc73 SHA512 7894ea63793dd0c6ae12f6acab04ba02e247e537c404693f69174bf4a10d85f01f51c4938912c9a43c35e526b3ae945a1774d45249b58b31a393332b6c01f4f8
22 DIST systemd-stable-249.6.tar.gz 10599611 BLAKE2B 9c0cbaa4319f2ce9a78dbe820d1b6df5191e6c632e2eac9f71f9ff9817564d9b3fc177d2aec0c0daea8ac33bbdc2066ad68a8967cf8857f4af3668b9a3e7d3bf SHA512 7a7791dfe4923c00987b924adcb1cd08c4d17af2b17b4c6c6c701856c6810cfda61f06821c39787339fc05293853c0ea61b9973fcf4495c7bf4f8054ecfae66f
23 DIST systemd-stable-249.7.tar.gz 10608252 BLAKE2B a5597c4973b24c962779622cae47dbf8351af49f8cd898d9c16a967c6f3600c6feb293e9b03eab0423b860eef5b04b287185fb9827cb323429d0ab9fc6d809b2 SHA512 4daf8570621fdcda5c94d982908c64eddfeef989005f4fd79a10f199dbc6f366354177bb59dff34bcb14764fb4423a870ffabac1163849ec53592e29760105fc
24 +DIST systemd-stable-250.1.tar.gz 11116731 BLAKE2B 9c0a8d02deb12a359c8665ba4d8d7e9d2ddee3f819f47b4598269e8ee8180e2e01ab774caeca7a19e98d118aebea5a38a07e916db4155efa0c19ce54a2b7e979 SHA512 a40a83dae353de8cf816f3408f91b9f72dfa1f4bae195fb48c2756c0c316bf6cb0def1be550c0322456e4940690d90ff324ca6d91126d9b13cfe9954c42e0216
25
26 diff --git a/sys-apps/systemd/systemd-250.1.ebuild b/sys-apps/systemd/systemd-250.1.ebuild
27 new file mode 100644
28 index 000000000000..d4624f9759b6
29 --- /dev/null
30 +++ b/sys-apps/systemd/systemd-250.1.ebuild
31 @@ -0,0 +1,520 @@
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="~AUTOFS4_FS ~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 -lt 5 10 20; then
230 + CONFIG_CHECK+=" ~CHECKPOINT_RESTORE"
231 + else
232 + CONFIG_CHECK+=" ~KCMP"
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 + # Do NOT add patches here
265 + local PATCHES=()
266 +
267 + [[ -d "${WORKDIR}"/patches ]] && PATCHES+=( "${WORKDIR}"/patches )
268 +
269 + # Add local patches here
270 + PATCHES+=(
271 + )
272 +
273 + if ! use vanilla; then
274 + PATCHES+=(
275 + "${FILESDIR}/gentoo-generator-path-r2.patch"
276 + "${FILESDIR}/gentoo-systemctl-disable-sysv-sync-r1.patch"
277 + "${FILESDIR}/gentoo-journald-audit.patch"
278 + )
279 + fi
280 +
281 + default
282 +}
283 +
284 +src_configure() {
285 + # Prevent conflicts with i686 cross toolchain, bug 559726
286 + tc-export AR CC NM OBJCOPY RANLIB
287 +
288 + python_setup
289 +
290 + multilib-minimal_src_configure
291 +}
292 +
293 +multilib_src_configure() {
294 + local myconf=(
295 + --localstatedir="${EPREFIX}/var"
296 + -Dsupport-url="https://gentoo.org/support/"
297 + -Dpamlibdir="$(getpam_mod_dir)"
298 + # avoid bash-completion dep
299 + -Dbashcompletiondir="$(get_bashcompdir)"
300 + # make sure we get /bin:/sbin in PATH
301 + $(meson_use split-usr)
302 + -Dsplit-bin=true
303 + -Drootprefix="$(usex split-usr "${EPREFIX:-/}" "${EPREFIX}/usr")"
304 + -Drootlibdir="${EPREFIX}/usr/$(get_libdir)"
305 + # Avoid infinite exec recursion, bug 642724
306 + -Dtelinit-path="${EPREFIX}/lib/sysvinit/telinit"
307 + # no deps
308 + -Dima=true
309 + -Ddefault-hierarchy=$(usex cgroup-hybrid hybrid unified)
310 + # Optional components/dependencies
311 + $(meson_native_use_bool acl)
312 + $(meson_native_use_bool apparmor)
313 + $(meson_native_use_bool audit)
314 + $(meson_native_use_bool cryptsetup libcryptsetup)
315 + $(meson_native_use_bool curl libcurl)
316 + $(meson_native_use_bool dns-over-tls dns-over-tls)
317 + $(meson_native_use_bool elfutils)
318 + $(meson_native_use_bool fido2 libfido2)
319 + $(meson_use gcrypt)
320 + $(meson_native_use_bool gnuefi gnu-efi)
321 + $(meson_native_use_bool gnutls)
322 + -Defi-includedir="${ESYSROOT}/usr/include/efi"
323 + -Defi-libdir="${ESYSROOT}/usr/$(get_libdir)"
324 + $(meson_native_use_bool homed)
325 + $(meson_native_use_bool http microhttpd)
326 + $(meson_native_use_bool idn)
327 + $(meson_native_use_bool importd)
328 + $(meson_native_use_bool importd bzip2)
329 + $(meson_native_use_bool importd zlib)
330 + $(meson_native_use_bool kmod)
331 + $(meson_use lz4)
332 + $(meson_use lzma xz)
333 + $(meson_use zstd)
334 + $(meson_native_use_bool nat libiptc)
335 + $(meson_native_use_bool openssl)
336 + $(meson_use pam)
337 + $(meson_native_use_bool pkcs11 p11kit)
338 + $(meson_native_use_bool pcre pcre2)
339 + $(meson_native_use_bool policykit polkit)
340 + $(meson_native_use_bool pwquality)
341 + $(meson_native_use_bool qrcode qrencode)
342 + $(meson_native_use_bool seccomp)
343 + $(meson_native_use_bool selinux)
344 + $(meson_native_use_bool tpm tpm2)
345 + $(meson_native_use_bool test dbus)
346 + $(meson_native_use_bool xkb xkbcommon)
347 + -Dntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
348 + # Breaks screen, tmux, etc.
349 + -Ddefault-kill-user-processes=false
350 + -Dcreate-log-dirs=false
351 +
352 + # multilib options
353 + $(meson_native_true backlight)
354 + $(meson_native_true binfmt)
355 + $(meson_native_true coredump)
356 + $(meson_native_true environment-d)
357 + $(meson_native_true firstboot)
358 + $(meson_native_true hibernate)
359 + $(meson_native_true hostnamed)
360 + $(meson_native_true ldconfig)
361 + $(meson_native_true localed)
362 + $(meson_native_true man)
363 + $(meson_native_true networkd)
364 + $(meson_native_true quotacheck)
365 + $(meson_native_true randomseed)
366 + $(meson_native_true rfkill)
367 + $(meson_native_true sysusers)
368 + $(meson_native_true timedated)
369 + $(meson_native_true timesyncd)
370 + $(meson_native_true tmpfiles)
371 + $(meson_native_true vconsole)
372 + )
373 +
374 + meson_src_configure "${myconf[@]}"
375 +}
376 +
377 +multilib_src_test() {
378 + unset DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR
379 + meson_src_test
380 +}
381 +
382 +multilib_src_install_all() {
383 + local rootprefix=$(usex split-usr '' /usr)
384 +
385 + # meson doesn't know about docdir
386 + mv "${ED}"/usr/share/doc/{systemd,${PF}} || die
387 +
388 + einstalldocs
389 + dodoc "${FILESDIR}"/nsswitch.conf
390 +
391 + if ! use resolvconf; then
392 + rm -f "${ED}${rootprefix}"/sbin/resolvconf || die
393 + fi
394 +
395 + rm "${ED}"/etc/init.d/README || die
396 + rm "${ED}${rootprefix}"/lib/systemd/system-generators/systemd-sysv-generator || die
397 +
398 + if ! use sysv-utils; then
399 + rm "${ED}${rootprefix}"/sbin/{halt,init,poweroff,reboot,runlevel,shutdown,telinit} || die
400 + rm "${ED}"/usr/share/man/man1/init.1 || die
401 + rm "${ED}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 || die
402 + fi
403 +
404 + if ! use resolvconf && ! use sysv-utils; then
405 + rmdir "${ED}${rootprefix}"/sbin || die
406 + fi
407 +
408 + # https://bugs.gentoo.org/761763
409 + rm -r "${ED}"/usr/lib/sysusers.d || die
410 +
411 + # Preserve empty dirs in /etc & /var, bug #437008
412 + keepdir /etc/{binfmt.d,modules-load.d,tmpfiles.d}
413 + keepdir /etc/kernel/install.d
414 + keepdir /etc/systemd/{network,system,user}
415 + keepdir /etc/udev/rules.d
416 +
417 + keepdir /etc/udev/hwdb.d
418 +
419 + keepdir "${rootprefix}"/lib/systemd/{system-sleep,system-shutdown}
420 + keepdir /usr/lib/{binfmt.d,modules-load.d}
421 + keepdir /usr/lib/systemd/user-generators
422 + keepdir /var/lib/systemd
423 + keepdir /var/log/journal
424 +
425 + # Symlink /etc/sysctl.conf for easy migration.
426 + dosym ../../../etc/sysctl.conf /usr/lib/sysctl.d/99-sysctl.conf
427 +
428 + if use pam; then
429 + newpamd "${FILESDIR}"/systemd-user.pam systemd-user
430 + fi
431 +
432 + if use split-usr; then
433 + # Avoid breaking boot/reboot
434 + dosym ../../../lib/systemd/systemd /usr/lib/systemd/systemd
435 + dosym ../../../lib/systemd/systemd-shutdown /usr/lib/systemd/systemd-shutdown
436 + fi
437 +
438 + # workaround for https://github.com/systemd/systemd/issues/13501
439 + if use hostnamed-fallback; then
440 + # this file requires dbus-broker
441 + insinto /usr/share/dbus-1/system.d/
442 + doins "${FILESDIR}/org.freedesktop.hostname1_no_polkit.conf"
443 +
444 + insinto "${rootprefix}/lib/systemd/system/systemd-hostnamed.service.d/"
445 + doins "${FILESDIR}/00-hostnamed-network-user.conf"
446 + fi
447 +
448 + gen_usr_ldscript -a systemd udev
449 +}
450 +
451 +migrate_locale() {
452 + local envd_locale_def="${EROOT}/etc/env.d/02locale"
453 + local envd_locale=( "${EROOT}"/etc/env.d/??locale )
454 + local locale_conf="${EROOT}/etc/locale.conf"
455 +
456 + if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
457 + # If locale.conf does not exist...
458 + if [[ -e ${envd_locale} ]]; then
459 + # ...either copy env.d/??locale if there's one
460 + ebegin "Moving ${envd_locale} to ${locale_conf}"
461 + mv "${envd_locale}" "${locale_conf}"
462 + eend ${?} || FAIL=1
463 + else
464 + # ...or create a dummy default
465 + ebegin "Creating ${locale_conf}"
466 + cat > "${locale_conf}" <<-EOF
467 + # This file has been created by the sys-apps/systemd ebuild.
468 + # See locale.conf(5) and localectl(1).
469 +
470 + # LANG=${LANG}
471 + EOF
472 + eend ${?} || FAIL=1
473 + fi
474 + fi
475 +
476 + if [[ ! -L ${envd_locale} ]]; then
477 + # now, if env.d/??locale is not a symlink (to locale.conf)...
478 + if [[ -e ${envd_locale} ]]; then
479 + # ...warn the user that he has duplicate locale settings
480 + ewarn
481 + ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
482 + ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
483 + ewarn "and create the symlink with the following command:"
484 + ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
485 + ewarn
486 + else
487 + # ...or just create the symlink if there's nothing here
488 + ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
489 + ln -n -s ../locale.conf "${envd_locale_def}"
490 + eend ${?} || FAIL=1
491 + fi
492 + fi
493 +}
494 +
495 +pkg_preinst() {
496 + if ! use split-usr; then
497 + local dir
498 + for dir in bin sbin lib; do
499 + if [[ ! ${EROOT}/${dir} -ef ${EROOT}/usr/${dir} ]]; then
500 + eerror "\"${EROOT}/${dir}\" and \"${EROOT}/usr/${dir}\" are not merged."
501 + eerror "One of them should be a symbolic link to the other one."
502 + FAIL=1
503 + fi
504 + done
505 + if [[ ${FAIL} ]]; then
506 + eerror "Migration to system layout with merged directories must be performed before"
507 + eerror "rebuilding ${CATEGORY}/${PN} with USE=\"-split-usr\" to avoid run-time breakage."
508 + die "System layout with split directories still used"
509 + fi
510 + fi
511 +}
512 +
513 +pkg_postinst() {
514 + systemd_update_catalog
515 +
516 + # Keep this here in case the database format changes so it gets updated
517 + # when required.
518 + systemd-hwdb --root="${ROOT}" update
519 +
520 + udev_reload || FAIL=1
521 +
522 + # Bug 465468, make sure locales are respected, and ensure consistency
523 + # between OpenRC & systemd
524 + migrate_locale
525 +
526 + if [[ -z ${REPLACING_VERSIONS} ]]; then
527 + if type systemctl &>/dev/null; then
528 + systemctl --root="${ROOT:-/}" enable getty@.service remote-fs.target || FAIL=1
529 + fi
530 + elog "To enable a useful set of services, run the following:"
531 + elog " systemctl preset-all --preset-mode=enable-only"
532 + fi
533 +
534 + if [[ -L ${EROOT}/var/lib/systemd/timesync ]]; then
535 + rm "${EROOT}/var/lib/systemd/timesync"
536 + fi
537 +
538 + if [[ ${FAIL} ]]; then
539 + eerror "One of the postinst commands failed. Please check the postinst output"
540 + eerror "for errors. You may need to clean up your system and/or try installing"
541 + eerror "systemd again."
542 + eerror
543 + fi
544 +}
545 +
546 +pkg_prerm() {
547 + # If removing systemd completely, remove the catalog database.
548 + if [[ ! ${REPLACED_BY_VERSION} ]]; then
549 + rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
550 + fi
551 +}