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