1 |
commit: f889099b9b77c7f879a107a8f59b480247673368 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jan 20 11:22:45 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 20 12:02:03 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f889099b |
7 |
|
8 |
sys-apps/systemd: add 250.3 |
9 |
|
10 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
11 |
|
12 |
sys-apps/systemd/Manifest | 1 + |
13 |
sys-apps/systemd/systemd-250.3.ebuild | 520 ++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 521 insertions(+) |
15 |
|
16 |
diff --git a/sys-apps/systemd/Manifest b/sys-apps/systemd/Manifest |
17 |
index 8d3466ae249a..65da4abb97c8 100644 |
18 |
--- a/sys-apps/systemd/Manifest |
19 |
+++ b/sys-apps/systemd/Manifest |
20 |
@@ -1,2 +1,3 @@ |
21 |
DIST systemd-stable-249.9.tar.gz 10613893 BLAKE2B fc7a14fa3b0cc3d05fa9f20fde2efedd3ef0f011d9dce53b0a418994b4257cf753b228cf98f749fb2028d81db55ef30a6e3d9b138d86239cad4fc730d845f9e2 SHA512 ce57bc6c522082e55649fc1886c4dc818c89607e175df2c92feffe288dbd38757f36b30abeebe153f5be6b664a49d729405040a952473cb2133a2e39cf9cc164 |
22 |
DIST systemd-stable-250.2.tar.gz 11121031 BLAKE2B ddbb33648dbf0442e4258bf23ace04eac6d5ab6a2434537395b900b7bd4113a86199d6d559f8d76dcbede88484240a6593439acdcc7b1801857d13840c389c6c SHA512 2f734c1d1ea98ee3f1beb00689a0d56603cd981aa938bee1655445ddd4af3b2bb6472249fa158741edcb2259ee302b625e124c38b7d2ec00c53760d6b362d5bb |
23 |
+DIST systemd-stable-250.3.tar.gz 11125151 BLAKE2B 659c39994e76f94407dd9079e28fc644981d3475a0ed440b9895e8f201c3ce1fc47aa8c4d599ad85ed89ddfb6ca8e514aee2a739e93640745cf46647f99efe56 SHA512 81847fb088ff271138b1ea318995a2ca2ee5d4c5d839c9dd81f0210d366198049199d59c49b25ef8783df2c6b8dd9fcdf2d916777788b1a6d42deec9da8e9da5 |
24 |
|
25 |
diff --git a/sys-apps/systemd/systemd-250.3.ebuild b/sys-apps/systemd/systemd-250.3.ebuild |
26 |
new file mode 100644 |
27 |
index 000000000000..d4624f9759b6 |
28 |
--- /dev/null |
29 |
+++ b/sys-apps/systemd/systemd-250.3.ebuild |
30 |
@@ -0,0 +1,520 @@ |
31 |
+# Copyright 2011-2022 Gentoo Authors |
32 |
+# Distributed under the terms of the GNU General Public License v2 |
33 |
+ |
34 |
+EAPI=7 |
35 |
+PYTHON_COMPAT=( python3_{8..10} ) |
36 |
+ |
37 |
+# Avoid QA warnings |
38 |
+TMPFILES_OPTIONAL=1 |
39 |
+ |
40 |
+if [[ ${PV} == 9999 ]]; then |
41 |
+ EGIT_REPO_URI="https://github.com/systemd/systemd.git" |
42 |
+ inherit git-r3 |
43 |
+else |
44 |
+ if [[ ${PV} == *.* ]]; then |
45 |
+ MY_PN=systemd-stable |
46 |
+ else |
47 |
+ MY_PN=systemd |
48 |
+ fi |
49 |
+ MY_PV=${PV/_/-} |
50 |
+ MY_P=${MY_PN}-${MY_PV} |
51 |
+ S=${WORKDIR}/${MY_P} |
52 |
+ SRC_URI="https://github.com/systemd/${MY_PN}/archive/v${MY_PV}/${MY_P}.tar.gz" |
53 |
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86" |
54 |
+fi |
55 |
+ |
56 |
+inherit bash-completion-r1 linux-info meson-multilib pam python-any-r1 systemd toolchain-funcs udev usr-ldscript |
57 |
+ |
58 |
+DESCRIPTION="System and service manager for Linux" |
59 |
+HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd" |
60 |
+ |
61 |
+LICENSE="GPL-2 LGPL-2.1 MIT public-domain" |
62 |
+SLOT="0/2" |
63 |
+IUSE=" |
64 |
+ acl apparmor audit build cgroup-hybrid cryptsetup curl +dns-over-tls elfutils |
65 |
+ fido2 +gcrypt gnuefi gnutls homed hostnamed-fallback http idn importd +kmod |
66 |
+ +lz4 lzma nat +openssl pam pcre pkcs11 policykit pwquality qrcode |
67 |
+ +resolvconf +seccomp selinux split-usr +sysv-utils test tpm vanilla xkb +zstd |
68 |
+" |
69 |
+REQUIRED_USE=" |
70 |
+ dns-over-tls? ( || ( gnutls openssl ) ) |
71 |
+ homed? ( cryptsetup pam openssl ) |
72 |
+ importd? ( curl lzma || ( gcrypt openssl ) ) |
73 |
+ policykit? ( !hostnamed-fallback ) |
74 |
+ pwquality? ( homed ) |
75 |
+" |
76 |
+RESTRICT="!test? ( test )" |
77 |
+ |
78 |
+MINKV="3.11" |
79 |
+ |
80 |
+COMMON_DEPEND=" |
81 |
+ >=sys-apps/util-linux-2.30:0=[${MULTILIB_USEDEP}] |
82 |
+ sys-libs/libcap:0=[${MULTILIB_USEDEP}] |
83 |
+ virtual/libcrypt:=[${MULTILIB_USEDEP}] |
84 |
+ acl? ( sys-apps/acl:0= ) |
85 |
+ apparmor? ( sys-libs/libapparmor:0= ) |
86 |
+ audit? ( >=sys-process/audit-2:0= ) |
87 |
+ cryptsetup? ( >=sys-fs/cryptsetup-2.0.1:0= ) |
88 |
+ curl? ( net-misc/curl:0= ) |
89 |
+ elfutils? ( >=dev-libs/elfutils-0.158:0= ) |
90 |
+ fido2? ( dev-libs/libfido2:0= ) |
91 |
+ gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] ) |
92 |
+ gnutls? ( >=net-libs/gnutls-3.6.0:0= ) |
93 |
+ http? ( >=net-libs/libmicrohttpd-0.9.33:0=[epoll(+)] ) |
94 |
+ idn? ( net-dns/libidn2:= ) |
95 |
+ importd? ( |
96 |
+ app-arch/bzip2:0= |
97 |
+ sys-libs/zlib:0= |
98 |
+ ) |
99 |
+ kmod? ( >=sys-apps/kmod-15:0= ) |
100 |
+ lz4? ( >=app-arch/lz4-0_p131:0=[${MULTILIB_USEDEP}] ) |
101 |
+ lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] ) |
102 |
+ nat? ( net-firewall/iptables:0= ) |
103 |
+ openssl? ( >=dev-libs/openssl-1.1.0:0= ) |
104 |
+ pam? ( sys-libs/pam:=[${MULTILIB_USEDEP}] ) |
105 |
+ pkcs11? ( app-crypt/p11-kit:0= ) |
106 |
+ pcre? ( dev-libs/libpcre2 ) |
107 |
+ pwquality? ( dev-libs/libpwquality:0= ) |
108 |
+ qrcode? ( media-gfx/qrencode:0= ) |
109 |
+ seccomp? ( >=sys-libs/libseccomp-2.3.3:0= ) |
110 |
+ selinux? ( sys-libs/libselinux:0= ) |
111 |
+ tpm? ( app-crypt/tpm2-tss:0= ) |
112 |
+ xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= ) |
113 |
+ zstd? ( >=app-arch/zstd-1.4.0:0=[${MULTILIB_USEDEP}] ) |
114 |
+" |
115 |
+ |
116 |
+# Newer linux-headers needed by ia64, bug #480218 |
117 |
+DEPEND="${COMMON_DEPEND} |
118 |
+ >=sys-kernel/linux-headers-${MINKV} |
119 |
+ gnuefi? ( >=sys-boot/gnu-efi-3.0.2 ) |
120 |
+" |
121 |
+ |
122 |
+# baselayout-2.2 has /run |
123 |
+RDEPEND="${COMMON_DEPEND} |
124 |
+ >=acct-group/adm-0-r1 |
125 |
+ >=acct-group/wheel-0-r1 |
126 |
+ >=acct-group/kmem-0-r1 |
127 |
+ >=acct-group/tty-0-r1 |
128 |
+ >=acct-group/utmp-0-r1 |
129 |
+ >=acct-group/audio-0-r1 |
130 |
+ >=acct-group/cdrom-0-r1 |
131 |
+ >=acct-group/dialout-0-r1 |
132 |
+ >=acct-group/disk-0-r1 |
133 |
+ >=acct-group/input-0-r1 |
134 |
+ >=acct-group/kvm-0-r1 |
135 |
+ >=acct-group/lp-0-r1 |
136 |
+ >=acct-group/render-0-r1 |
137 |
+ acct-group/sgx |
138 |
+ >=acct-group/tape-0-r1 |
139 |
+ acct-group/users |
140 |
+ >=acct-group/video-0-r1 |
141 |
+ >=acct-group/systemd-journal-0-r1 |
142 |
+ >=acct-user/root-0-r1 |
143 |
+ acct-user/nobody |
144 |
+ >=acct-user/systemd-journal-remote-0-r1 |
145 |
+ >=acct-user/systemd-coredump-0-r1 |
146 |
+ >=acct-user/systemd-network-0-r1 |
147 |
+ acct-user/systemd-oom |
148 |
+ >=acct-user/systemd-resolve-0-r1 |
149 |
+ >=acct-user/systemd-timesync-0-r1 |
150 |
+ >=sys-apps/baselayout-2.2 |
151 |
+ hostnamed-fallback? ( |
152 |
+ acct-group/systemd-hostname |
153 |
+ sys-apps/dbus-broker |
154 |
+ ) |
155 |
+ selinux? ( sec-policy/selinux-base-policy[systemd] ) |
156 |
+ sysv-utils? ( |
157 |
+ !sys-apps/openrc[sysv-utils(-)] |
158 |
+ !sys-apps/sysvinit |
159 |
+ ) |
160 |
+ !sysv-utils? ( sys-apps/sysvinit ) |
161 |
+ resolvconf? ( !net-dns/openresolv ) |
162 |
+ !build? ( || ( |
163 |
+ sys-apps/util-linux[kill(-)] |
164 |
+ sys-process/procps[kill(+)] |
165 |
+ sys-apps/coreutils[kill(-)] |
166 |
+ ) ) |
167 |
+ !sys-apps/hwids[udev] |
168 |
+ !sys-auth/nss-myhostname |
169 |
+ !sys-fs/eudev |
170 |
+ !sys-fs/udev |
171 |
+" |
172 |
+ |
173 |
+# sys-apps/dbus: the daemon only (+ build-time lib dep for tests) |
174 |
+PDEPEND=">=sys-apps/dbus-1.9.8[systemd] |
175 |
+ >=sys-fs/udev-init-scripts-34 |
176 |
+ policykit? ( sys-auth/polkit ) |
177 |
+ !vanilla? ( sys-apps/gentoo-systemd-integration )" |
178 |
+ |
179 |
+BDEPEND=" |
180 |
+ app-arch/xz-utils:0 |
181 |
+ dev-util/gperf |
182 |
+ >=dev-util/meson-0.46 |
183 |
+ >=sys-apps/coreutils-8.16 |
184 |
+ sys-devel/gettext |
185 |
+ virtual/pkgconfig |
186 |
+ test? ( |
187 |
+ app-text/tree |
188 |
+ dev-lang/perl |
189 |
+ sys-apps/dbus |
190 |
+ ) |
191 |
+ app-text/docbook-xml-dtd:4.2 |
192 |
+ app-text/docbook-xml-dtd:4.5 |
193 |
+ app-text/docbook-xsl-stylesheets |
194 |
+ dev-libs/libxslt:0 |
195 |
+ $(python_gen_any_dep 'dev-python/jinja[${PYTHON_USEDEP}]') |
196 |
+ $(python_gen_any_dep 'dev-python/lxml[${PYTHON_USEDEP}]') |
197 |
+" |
198 |
+ |
199 |
+python_check_deps() { |
200 |
+ has_version -b "dev-python/jinja[${PYTHON_USEDEP}]" && |
201 |
+ has_version -b "dev-python/lxml[${PYTHON_USEDEP}]" |
202 |
+} |
203 |
+ |
204 |
+QA_FLAGS_IGNORED="usr/lib/systemd/boot/efi/.*" |
205 |
+QA_EXECSTACK="usr/lib/systemd/boot/efi/*" |
206 |
+ |
207 |
+pkg_pretend() { |
208 |
+ if [[ ${MERGE_TYPE} != buildonly ]]; then |
209 |
+ if use test && has pid-sandbox ${FEATURES}; then |
210 |
+ ewarn "Tests are known to fail with PID sandboxing enabled." |
211 |
+ ewarn "See https://bugs.gentoo.org/674458." |
212 |
+ fi |
213 |
+ |
214 |
+ local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS |
215 |
+ ~DEVTMPFS ~EPOLL ~FANOTIFY ~FHANDLE |
216 |
+ ~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SIGNALFD ~SYSFS |
217 |
+ ~TIMERFD ~TMPFS_XATTR ~UNIX ~USER_NS |
218 |
+ ~CRYPTO_HMAC ~CRYPTO_SHA256 ~CRYPTO_USER_API_HASH |
219 |
+ ~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED |
220 |
+ ~!SYSFS_DEPRECATED_V2" |
221 |
+ |
222 |
+ use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL" |
223 |
+ use seccomp && CONFIG_CHECK+=" ~SECCOMP ~SECCOMP_FILTER" |
224 |
+ kernel_is -lt 3 7 && CONFIG_CHECK+=" ~HOTPLUG" |
225 |
+ kernel_is -lt 4 7 && CONFIG_CHECK+=" ~DEVPTS_MULTIPLE_INSTANCES" |
226 |
+ kernel_is -ge 4 10 && CONFIG_CHECK+=" ~CGROUP_BPF" |
227 |
+ |
228 |
+ if kernel_is -lt 5 10 20; then |
229 |
+ CONFIG_CHECK+=" ~CHECKPOINT_RESTORE" |
230 |
+ else |
231 |
+ CONFIG_CHECK+=" ~KCMP" |
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 |
+ 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 |
+ # make sure we get /bin:/sbin in PATH |
300 |
+ $(meson_use split-usr) |
301 |
+ -Dsplit-bin=true |
302 |
+ -Drootprefix="$(usex split-usr "${EPREFIX:-/}" "${EPREFIX}/usr")" |
303 |
+ -Drootlibdir="${EPREFIX}/usr/$(get_libdir)" |
304 |
+ # Avoid infinite exec recursion, bug 642724 |
305 |
+ -Dtelinit-path="${EPREFIX}/lib/sysvinit/telinit" |
306 |
+ # no deps |
307 |
+ -Dima=true |
308 |
+ -Ddefault-hierarchy=$(usex cgroup-hybrid hybrid unified) |
309 |
+ # Optional components/dependencies |
310 |
+ $(meson_native_use_bool acl) |
311 |
+ $(meson_native_use_bool apparmor) |
312 |
+ $(meson_native_use_bool audit) |
313 |
+ $(meson_native_use_bool cryptsetup libcryptsetup) |
314 |
+ $(meson_native_use_bool curl libcurl) |
315 |
+ $(meson_native_use_bool dns-over-tls dns-over-tls) |
316 |
+ $(meson_native_use_bool elfutils) |
317 |
+ $(meson_native_use_bool fido2 libfido2) |
318 |
+ $(meson_use gcrypt) |
319 |
+ $(meson_native_use_bool gnuefi gnu-efi) |
320 |
+ $(meson_native_use_bool gnutls) |
321 |
+ -Defi-includedir="${ESYSROOT}/usr/include/efi" |
322 |
+ -Defi-libdir="${ESYSROOT}/usr/$(get_libdir)" |
323 |
+ $(meson_native_use_bool homed) |
324 |
+ $(meson_native_use_bool http microhttpd) |
325 |
+ $(meson_native_use_bool idn) |
326 |
+ $(meson_native_use_bool importd) |
327 |
+ $(meson_native_use_bool importd bzip2) |
328 |
+ $(meson_native_use_bool importd zlib) |
329 |
+ $(meson_native_use_bool kmod) |
330 |
+ $(meson_use lz4) |
331 |
+ $(meson_use lzma xz) |
332 |
+ $(meson_use zstd) |
333 |
+ $(meson_native_use_bool nat libiptc) |
334 |
+ $(meson_native_use_bool openssl) |
335 |
+ $(meson_use pam) |
336 |
+ $(meson_native_use_bool pkcs11 p11kit) |
337 |
+ $(meson_native_use_bool pcre pcre2) |
338 |
+ $(meson_native_use_bool policykit polkit) |
339 |
+ $(meson_native_use_bool pwquality) |
340 |
+ $(meson_native_use_bool qrcode qrencode) |
341 |
+ $(meson_native_use_bool seccomp) |
342 |
+ $(meson_native_use_bool selinux) |
343 |
+ $(meson_native_use_bool tpm tpm2) |
344 |
+ $(meson_native_use_bool test dbus) |
345 |
+ $(meson_native_use_bool xkb xkbcommon) |
346 |
+ -Dntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org" |
347 |
+ # Breaks screen, tmux, etc. |
348 |
+ -Ddefault-kill-user-processes=false |
349 |
+ -Dcreate-log-dirs=false |
350 |
+ |
351 |
+ # multilib options |
352 |
+ $(meson_native_true backlight) |
353 |
+ $(meson_native_true binfmt) |
354 |
+ $(meson_native_true coredump) |
355 |
+ $(meson_native_true environment-d) |
356 |
+ $(meson_native_true firstboot) |
357 |
+ $(meson_native_true hibernate) |
358 |
+ $(meson_native_true hostnamed) |
359 |
+ $(meson_native_true ldconfig) |
360 |
+ $(meson_native_true localed) |
361 |
+ $(meson_native_true man) |
362 |
+ $(meson_native_true networkd) |
363 |
+ $(meson_native_true quotacheck) |
364 |
+ $(meson_native_true randomseed) |
365 |
+ $(meson_native_true rfkill) |
366 |
+ $(meson_native_true sysusers) |
367 |
+ $(meson_native_true timedated) |
368 |
+ $(meson_native_true timesyncd) |
369 |
+ $(meson_native_true tmpfiles) |
370 |
+ $(meson_native_true vconsole) |
371 |
+ ) |
372 |
+ |
373 |
+ meson_src_configure "${myconf[@]}" |
374 |
+} |
375 |
+ |
376 |
+multilib_src_test() { |
377 |
+ unset DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR |
378 |
+ meson_src_test |
379 |
+} |
380 |
+ |
381 |
+multilib_src_install_all() { |
382 |
+ local rootprefix=$(usex split-usr '' /usr) |
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; 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 |
+ # workaround for https://github.com/systemd/systemd/issues/13501 |
438 |
+ if use hostnamed-fallback; then |
439 |
+ # this file requires dbus-broker |
440 |
+ insinto /usr/share/dbus-1/system.d/ |
441 |
+ doins "${FILESDIR}/org.freedesktop.hostname1_no_polkit.conf" |
442 |
+ |
443 |
+ insinto "${rootprefix}/lib/systemd/system/systemd-hostnamed.service.d/" |
444 |
+ doins "${FILESDIR}/00-hostnamed-network-user.conf" |
445 |
+ fi |
446 |
+ |
447 |
+ gen_usr_ldscript -a systemd udev |
448 |
+} |
449 |
+ |
450 |
+migrate_locale() { |
451 |
+ local envd_locale_def="${EROOT}/etc/env.d/02locale" |
452 |
+ local envd_locale=( "${EROOT}"/etc/env.d/??locale ) |
453 |
+ local locale_conf="${EROOT}/etc/locale.conf" |
454 |
+ |
455 |
+ if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then |
456 |
+ # If locale.conf does not exist... |
457 |
+ if [[ -e ${envd_locale} ]]; then |
458 |
+ # ...either copy env.d/??locale if there's one |
459 |
+ ebegin "Moving ${envd_locale} to ${locale_conf}" |
460 |
+ mv "${envd_locale}" "${locale_conf}" |
461 |
+ eend ${?} || FAIL=1 |
462 |
+ else |
463 |
+ # ...or create a dummy default |
464 |
+ ebegin "Creating ${locale_conf}" |
465 |
+ cat > "${locale_conf}" <<-EOF |
466 |
+ # This file has been created by the sys-apps/systemd ebuild. |
467 |
+ # See locale.conf(5) and localectl(1). |
468 |
+ |
469 |
+ # LANG=${LANG} |
470 |
+ EOF |
471 |
+ eend ${?} || FAIL=1 |
472 |
+ fi |
473 |
+ fi |
474 |
+ |
475 |
+ if [[ ! -L ${envd_locale} ]]; then |
476 |
+ # now, if env.d/??locale is not a symlink (to locale.conf)... |
477 |
+ if [[ -e ${envd_locale} ]]; then |
478 |
+ # ...warn the user that he has duplicate locale settings |
479 |
+ ewarn |
480 |
+ ewarn "To ensure consistent behavior, you should replace ${envd_locale}" |
481 |
+ ewarn "with a symlink to ${locale_conf}. Please migrate your settings" |
482 |
+ ewarn "and create the symlink with the following command:" |
483 |
+ ewarn "ln -s -n -f ../locale.conf ${envd_locale}" |
484 |
+ ewarn |
485 |
+ else |
486 |
+ # ...or just create the symlink if there's nothing here |
487 |
+ ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink" |
488 |
+ ln -n -s ../locale.conf "${envd_locale_def}" |
489 |
+ eend ${?} || FAIL=1 |
490 |
+ fi |
491 |
+ fi |
492 |
+} |
493 |
+ |
494 |
+pkg_preinst() { |
495 |
+ if ! use split-usr; then |
496 |
+ local dir |
497 |
+ for dir in bin sbin lib; do |
498 |
+ if [[ ! ${EROOT}/${dir} -ef ${EROOT}/usr/${dir} ]]; then |
499 |
+ eerror "\"${EROOT}/${dir}\" and \"${EROOT}/usr/${dir}\" are not merged." |
500 |
+ eerror "One of them should be a symbolic link to the other one." |
501 |
+ FAIL=1 |
502 |
+ fi |
503 |
+ done |
504 |
+ if [[ ${FAIL} ]]; then |
505 |
+ eerror "Migration to system layout with merged directories must be performed before" |
506 |
+ eerror "rebuilding ${CATEGORY}/${PN} with USE=\"-split-usr\" to avoid run-time breakage." |
507 |
+ die "System layout with split directories still used" |
508 |
+ fi |
509 |
+ fi |
510 |
+} |
511 |
+ |
512 |
+pkg_postinst() { |
513 |
+ systemd_update_catalog |
514 |
+ |
515 |
+ # Keep this here in case the database format changes so it gets updated |
516 |
+ # when required. |
517 |
+ systemd-hwdb --root="${ROOT}" update |
518 |
+ |
519 |
+ udev_reload || FAIL=1 |
520 |
+ |
521 |
+ # Bug 465468, make sure locales are respected, and ensure consistency |
522 |
+ # between OpenRC & systemd |
523 |
+ migrate_locale |
524 |
+ |
525 |
+ if [[ -z ${REPLACING_VERSIONS} ]]; then |
526 |
+ if type systemctl &>/dev/null; then |
527 |
+ systemctl --root="${ROOT:-/}" enable getty@.service remote-fs.target || FAIL=1 |
528 |
+ fi |
529 |
+ elog "To enable a useful set of services, run the following:" |
530 |
+ elog " systemctl preset-all --preset-mode=enable-only" |
531 |
+ fi |
532 |
+ |
533 |
+ if [[ -L ${EROOT}/var/lib/systemd/timesync ]]; then |
534 |
+ rm "${EROOT}/var/lib/systemd/timesync" |
535 |
+ fi |
536 |
+ |
537 |
+ if [[ ${FAIL} ]]; then |
538 |
+ eerror "One of the postinst commands failed. Please check the postinst output" |
539 |
+ eerror "for errors. You may need to clean up your system and/or try installing" |
540 |
+ eerror "systemd again." |
541 |
+ eerror |
542 |
+ fi |
543 |
+} |
544 |
+ |
545 |
+pkg_prerm() { |
546 |
+ # If removing systemd completely, remove the catalog database. |
547 |
+ if [[ ! ${REPLACED_BY_VERSION} ]]; then |
548 |
+ rm -f -v "${EROOT}"/var/lib/systemd/catalog/database |
549 |
+ fi |
550 |
+} |