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