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