Gentoo Archives: gentoo-commits

From: "Mike Gilbert (floppym)" <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-apps/systemd: systemd-9999.ebuild systemd-221.ebuild ChangeLog
Date: Sat, 27 Jun 2015 18:00:59
Message-Id: 20150627180047.CC234737@oystercatcher.gentoo.org
1 floppym 15/06/27 18:00:47
2
3 Modified: systemd-9999.ebuild ChangeLog
4 Added: systemd-221.ebuild
5 Log:
6 Bump. Require python at build time for the live ebuild. Resolve build issue without python enabled, bug 552790.
7
8 (Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 0BBEEA1FEA4843A4)
9
10 Revision Changes Path
11 1.174 sys-apps/systemd/systemd-9999.ebuild
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/systemd/systemd-9999.ebuild?rev=1.174&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/systemd/systemd-9999.ebuild?rev=1.174&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/systemd/systemd-9999.ebuild?r1=1.173&r2=1.174
16
17 Index: systemd-9999.ebuild
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/sys-apps/systemd/systemd-9999.ebuild,v
20 retrieving revision 1.173
21 retrieving revision 1.174
22 diff -u -r1.173 -r1.174
23 --- systemd-9999.ebuild 21 Jun 2015 15:29:53 -0000 1.173
24 +++ systemd-9999.ebuild 27 Jun 2015 18:00:47 -0000 1.174
25 @@ -1,6 +1,6 @@
26 # Copyright 1999-2015 Gentoo Foundation
27 # Distributed under the terms of the GNU General Public License v2
28 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/systemd/systemd-9999.ebuild,v 1.173 2015/06/21 15:29:53 floppym Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/systemd/systemd-9999.ebuild,v 1.174 2015/06/27 18:00:47 floppym Exp $
30
31 EAPI=5
32
33 @@ -28,7 +28,9 @@
34 IUSE="acl apparmor audit cryptsetup curl elfutils gcrypt gnuefi http
35 idn importd +kdbus +kmod +lz4 lzma nat pam policykit python
36 qrcode +seccomp selinux ssl sysv-utils terminal test vanilla xkb"
37 -REQUIRED_USE="importd? ( curl gcrypt lzma )"
38 +
39 +REQUIRED_USE="importd? ( curl gcrypt lzma )
40 + python? ( ${PYTHON_REQUIRED_USE} )"
41
42 MINKV="3.8"
43
44 @@ -101,7 +103,7 @@
45 test? ( >=sys-apps/dbus-1.6.8-r1:0 )"
46
47 if [[ -n ${AUTOTOOLS_AUTORECONF} ]]; then
48 - DEPEND="${DEPEND}
49 + DEPEND+="
50 app-text/docbook-xml-dtd:4.2
51 app-text/docbook-xml-dtd:4.5
52 app-text/docbook-xsl-stylesheets
53 @@ -109,6 +111,11 @@
54 >=dev-libs/libgcrypt-1.4.5:0"
55 fi
56
57 +if [[ ${PV} == 9999 ]]; then
58 + DEPEND+=" ${PYTHON_DEPS}"
59 + REQUIRED_USE+=" ${PYTHON_REQUIRED_USE}"
60 +fi
61 +
62 pkg_pretend() {
63 local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS
64 ~DEVPTS_MULTIPLE_INSTANCES ~DEVTMPFS ~DMIID ~EPOLL ~FANOTIFY ~FHANDLE
65 @@ -148,13 +155,19 @@
66 }
67
68 pkg_setup() {
69 - use python && python-single-r1_pkg_setup
70 + :
71 }
72
73 src_prepare() {
74 # Bug 463376
75 sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
76
77 + if [[ ${PV} != 9999 ]]; then
78 + # Update the timestamp on this to avoid rebuilding it.
79 + [[ -e src/libsystemd-terminal/unifont-glyph-array.bin ]] || die "File missing from tarball"
80 + touch src/libsystemd-terminal/unifont-glyph-array.bin || die
81 + fi
82 +
83 autotools-utils_src_prepare
84 }
85
86 @@ -164,6 +177,10 @@
87 # Fix systems broken by bug #509454.
88 [[ ${MY_UDEVDIR} ]] || MY_UDEVDIR=/lib/udev
89
90 + if [[ ${PV} == 9999 ]] || use python; then
91 + python_setup
92 + fi
93 +
94 multilib-minimal_src_configure
95 }
96
97
98
99
100 1.380 sys-apps/systemd/ChangeLog
101
102 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/systemd/ChangeLog?rev=1.380&view=markup
103 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/systemd/ChangeLog?rev=1.380&content-type=text/plain
104 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/systemd/ChangeLog?r1=1.379&r2=1.380
105
106 Index: ChangeLog
107 ===================================================================
108 RCS file: /var/cvsroot/gentoo-x86/sys-apps/systemd/ChangeLog,v
109 retrieving revision 1.379
110 retrieving revision 1.380
111 diff -u -r1.379 -r1.380
112 --- ChangeLog 21 Jun 2015 15:29:53 -0000 1.379
113 +++ ChangeLog 27 Jun 2015 18:00:47 -0000 1.380
114 @@ -1,6 +1,13 @@
115 # ChangeLog for sys-apps/systemd
116 # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
117 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/systemd/ChangeLog,v 1.379 2015/06/21 15:29:53 floppym Exp $
118 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/systemd/ChangeLog,v 1.380 2015/06/27 18:00:47 floppym Exp $
119 +
120 +*systemd-221 (27 Jun 2015)
121 +
122 + 27 Jun 2015; Mike Gilbert <floppym@g.o> +systemd-221.ebuild,
123 + systemd-9999.ebuild:
124 + Bump. Require python at build time for the live ebuild. Resolve build issue
125 + without python enabled, bug 552790.
126
127 21 Jun 2015; Mike Gilbert <floppym@g.o> systemd-9999.ebuild:
128 Enable kdbus by default.
129
130
131
132 1.1 sys-apps/systemd/systemd-221.ebuild
133
134 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/systemd/systemd-221.ebuild?rev=1.1&view=markup
135 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/systemd/systemd-221.ebuild?rev=1.1&content-type=text/plain
136
137 Index: systemd-221.ebuild
138 ===================================================================
139 # Copyright 1999-2015 Gentoo Foundation
140 # Distributed under the terms of the GNU General Public License v2
141 # $Header: /var/cvsroot/gentoo-x86/sys-apps/systemd/systemd-221.ebuild,v 1.1 2015/06/27 18:00:47 floppym Exp $
142
143 EAPI=5
144
145 AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
146 PYTHON_COMPAT=( python{2_7,3_3,3_4} )
147
148 if [[ ${PV} == 9999 ]]; then
149 AUTOTOOLS_AUTORECONF=yes
150 EGIT_REPO_URI="https://github.com/systemd/systemd.git"
151 inherit git-r3
152 else
153 SRC_URI="http://www.freedesktop.org/software/systemd/${P}.tar.xz"
154 KEYWORDS="~amd64 ~arm ~ia64 ~x86"
155 fi
156
157 inherit autotools-utils bash-completion-r1 linux-info multilib \
158 multilib-minimal pam python-single-r1 systemd toolchain-funcs udev \
159 user
160
161 DESCRIPTION="System and service manager for Linux"
162 HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
163
164 LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
165 SLOT="0/2"
166 IUSE="acl apparmor audit cryptsetup curl elfutils gcrypt gnuefi http
167 idn importd +kdbus +kmod +lz4 lzma nat pam policykit python
168 qrcode +seccomp selinux ssl sysv-utils terminal test vanilla xkb"
169
170 REQUIRED_USE="importd? ( curl gcrypt lzma )
171 python? ( ${PYTHON_REQUIRED_USE} )"
172
173 MINKV="3.8"
174
175 COMMON_DEPEND=">=sys-apps/util-linux-2.26:0=
176 sys-libs/libcap:0=
177 !<sys-libs/glibc-2.16
178 acl? ( sys-apps/acl:0= )
179 apparmor? ( sys-libs/libapparmor:0= )
180 audit? ( >=sys-process/audit-2:0= )
181 cryptsetup? ( >=sys-fs/cryptsetup-1.6:0= )
182 curl? ( net-misc/curl:0= )
183 elfutils? ( >=dev-libs/elfutils-0.158:0= )
184 gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
185 http? (
186 >=net-libs/libmicrohttpd-0.9.33:0=
187 ssl? ( >=net-libs/gnutls-3.1.4:0= )
188 )
189 idn? ( net-dns/libidn:0= )
190 importd? (
191 app-arch/bzip2:0=
192 sys-libs/zlib:0=
193 )
194 kmod? ( >=sys-apps/kmod-15:0= )
195 lz4? ( >=app-arch/lz4-0_p119:0=[${MULTILIB_USEDEP}] )
196 lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] )
197 nat? ( net-firewall/iptables:0= )
198 pam? ( virtual/pam:= )
199 python? ( ${PYTHON_DEPS} )
200 qrcode? ( media-gfx/qrencode:0= )
201 seccomp? ( sys-libs/libseccomp:0= )
202 selinux? ( sys-libs/libselinux:0= )
203 sysv-utils? (
204 !sys-apps/systemd-sysv-utils
205 !sys-apps/sysvinit )
206 terminal? ( >=dev-libs/libevdev-1.2:0=
207 >=x11-libs/libxkbcommon-0.5:0=
208 >=x11-libs/libdrm-2.4:0= )
209 xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )
210 abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r9
211 !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
212
213 # baselayout-2.2 has /run
214 RDEPEND="${COMMON_DEPEND}
215 >=sys-apps/baselayout-2.2
216 !sys-auth/nss-myhostname
217 !sys-fs/eudev
218 !sys-fs/udev"
219
220 # sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
221 PDEPEND=">=sys-apps/dbus-1.6.8-r1:0[systemd]
222 >=sys-apps/hwids-20130717-r1[udev]
223 >=sys-fs/udev-init-scripts-25
224 policykit? ( sys-auth/polkit )
225 !vanilla? ( sys-apps/gentoo-systemd-integration )"
226
227 # Newer linux-headers needed by ia64, bug #480218
228 DEPEND="${COMMON_DEPEND}
229 app-arch/xz-utils:0
230 dev-util/gperf
231 >=dev-util/intltool-0.50
232 >=sys-apps/coreutils-8.16
233 >=sys-devel/binutils-2.23.1
234 >=sys-devel/gcc-4.6
235 >=sys-kernel/linux-headers-${MINKV}
236 ia64? ( >=sys-kernel/linux-headers-3.9 )
237 virtual/pkgconfig
238 gnuefi? ( >=sys-boot/gnu-efi-3.0.2 )
239 python? ( dev-python/lxml[${PYTHON_USEDEP}] )
240 terminal? ( media-fonts/unifont[utils(+)] )
241 test? ( >=sys-apps/dbus-1.6.8-r1:0 )"
242
243 if [[ -n ${AUTOTOOLS_AUTORECONF} ]]; then
244 DEPEND+="
245 app-text/docbook-xml-dtd:4.2
246 app-text/docbook-xml-dtd:4.5
247 app-text/docbook-xsl-stylesheets
248 dev-libs/libxslt:0
249 >=dev-libs/libgcrypt-1.4.5:0"
250 fi
251
252 if [[ ${PV} == 9999 ]]; then
253 DEPEND+=" ${PYTHON_DEPS}"
254 REQUIRED_USE+=" ${PYTHON_REQUIRED_USE}"
255 fi
256
257 pkg_pretend() {
258 local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS
259 ~DEVPTS_MULTIPLE_INSTANCES ~DEVTMPFS ~DMIID ~EPOLL ~FANOTIFY ~FHANDLE
260 ~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SECCOMP ~SIGNALFD ~SYSFS
261 ~TIMERFD ~TMPFS_XATTR
262 ~!FW_LOADER_USER_HELPER ~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED
263 ~!SYSFS_DEPRECATED_V2"
264
265 use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
266 kernel_is -lt 3 7 && CONFIG_CHECK+=" ~HOTPLUG"
267
268 if linux_config_exists; then
269 local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
270 if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
271 ewarn "It's recommended to set an empty value to the following kernel config option:"
272 ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
273 fi
274 fi
275
276 if [[ ${MERGE_TYPE} != binary ]]; then
277 if [[ $(gcc-major-version) -lt 4
278 || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 6 ) ]]
279 then
280 eerror "systemd requires at least gcc 4.6 to build. Please switch the active"
281 eerror "gcc version using gcc-config."
282 die "systemd requires at least gcc 4.6"
283 fi
284 fi
285
286 if [[ ${MERGE_TYPE} != buildonly ]]; then
287 if kernel_is -lt ${MINKV//./ }; then
288 ewarn "Kernel version at least ${MINKV} required"
289 fi
290
291 check_extra_config
292 fi
293 }
294
295 pkg_setup() {
296 :
297 }
298
299 src_prepare() {
300 # Bug 463376
301 sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
302
303 if [[ ${PV} != 9999 ]]; then
304 # Update the timestamp on this to avoid rebuilding it.
305 [[ -e src/libsystemd-terminal/unifont-glyph-array.bin ]] || die "File missing from tarball"
306 touch src/libsystemd-terminal/unifont-glyph-array.bin || die
307 fi
308
309 autotools-utils_src_prepare
310 }
311
312 src_configure() {
313 # Keep using the one where the rules were installed.
314 MY_UDEVDIR=$(get_udevdir)
315 # Fix systems broken by bug #509454.
316 [[ ${MY_UDEVDIR} ]] || MY_UDEVDIR=/lib/udev
317
318 if [[ ${PV} == 9999 ]] || use python; then
319 python_setup
320 fi
321
322 multilib-minimal_src_configure
323 }
324
325 multilib_src_configure() {
326 local myeconfargs=(
327 # disable -flto since it is an optimization flag
328 # and makes distcc less effective
329 cc_cv_CFLAGS__flto=no
330
331 # Workaround for bug 516346
332 --enable-dependency-tracking
333
334 --disable-maintainer-mode
335 --localstatedir=/var
336 --with-pamlibdir=$(getpam_mod_dir)
337 # avoid bash-completion dep
338 --with-bashcompletiondir="$(get_bashcompdir)"
339 # make sure we get /bin:/sbin in $PATH
340 --enable-split-usr
341 # For testing.
342 --with-rootprefix="${ROOTPREFIX-/usr}"
343 --with-rootlibdir="${ROOTPREFIX-/usr}/$(get_libdir)"
344 # disable sysv compatibility
345 --with-sysvinit-path=
346 --with-sysvrcnd-path=
347 # no deps
348 --enable-efi
349 --enable-ima
350
351 # Optional components/dependencies
352 $(multilib_native_use_enable acl)
353 $(multilib_native_use_enable apparmor)
354 $(multilib_native_use_enable audit)
355 $(multilib_native_use_enable cryptsetup libcryptsetup)
356 $(multilib_native_use_enable curl libcurl)
357 $(multilib_native_use_enable elfutils)
358 $(use_enable gcrypt)
359 $(multilib_native_use_enable gnuefi)
360 $(multilib_native_use_enable http microhttpd)
361 $(usex http $(multilib_native_use_enable ssl gnutls) --disable-gnutls)
362 $(multilib_native_use_enable idn libidn)
363 $(multilib_native_use_enable importd)
364 $(multilib_native_use_enable importd bzip2)
365 $(multilib_native_use_enable importd zlib)
366 $(use_enable kdbus)
367 $(multilib_native_use_enable kmod)
368 $(use_enable lz4)
369 $(use_enable lzma xz)
370 $(multilib_native_use_enable nat libiptc)
371 $(multilib_native_use_enable pam)
372 $(multilib_native_use_enable policykit polkit)
373 $(multilib_native_use_with python)
374 $(multilib_native_use_enable python python-devel)
375 $(multilib_native_use_enable qrcode qrencode)
376 $(multilib_native_use_enable seccomp)
377 $(multilib_native_use_enable selinux)
378 $(multilib_native_use_enable terminal)
379 $(multilib_native_use_enable test tests)
380 $(multilib_native_use_enable test dbus)
381 $(multilib_native_use_enable xkb xkbcommon)
382
383 # hardcode a few paths to spare some deps
384 QUOTAON=/usr/sbin/quotaon
385 QUOTACHECK=/usr/sbin/quotacheck
386
387 # TODO: we may need to restrict this to gcc
388 EFI_CC="$(tc-getCC)"
389
390 # dbus paths
391 --with-dbuspolicydir="${EPREFIX}/etc/dbus-1/system.d"
392 --with-dbussessionservicedir="${EPREFIX}/usr/share/dbus-1/services"
393 --with-dbussystemservicedir="${EPREFIX}/usr/share/dbus-1/system-services"
394
395 --with-ntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
396 )
397
398 if ! multilib_is_native_abi; then
399 myeconfargs+=(
400 MOUNT_{CFLAGS,LIBS}=' '
401
402 ac_cv_search_cap_init=
403 ac_cv_header_sys_capability_h=yes
404 )
405 fi
406
407 # Work around bug 463846.
408 tc-export CC
409
410 autotools-utils_src_configure
411 }
412
413 multilib_src_compile() {
414 local mymakeopts=(
415 udevlibexecdir="${MY_UDEVDIR}"
416 )
417
418 if multilib_is_native_abi; then
419 emake "${mymakeopts[@]}"
420 else
421 echo 'gentoo: $(BUILT_SOURCES)' | \
422 emake "${mymakeopts[@]}" -f Makefile -f - gentoo
423 echo 'gentoo: $(lib_LTLIBRARIES) $(pkgconfiglib_DATA)' | \
424 emake "${mymakeopts[@]}" -f Makefile -f - gentoo
425 fi
426 }
427
428 multilib_src_test() {
429 multilib_is_native_abi || continue
430
431 default
432 }
433
434 multilib_src_install() {
435 local mymakeopts=(
436 # automake fails with parallel libtool relinking
437 # https://bugs.gentoo.org/show_bug.cgi?id=491398
438 -j1
439
440 udevlibexecdir="${MY_UDEVDIR}"
441 dist_udevhwdb_DATA=
442 DESTDIR="${D}"
443 )
444
445 if multilib_is_native_abi; then
446 emake "${mymakeopts[@]}" install
447 else
448 mymakeopts+=(
449 install-libLTLIBRARIES
450 install-pkgconfiglibDATA
451 install-includeHEADERS
452 # safe to call unconditionally, 'installs' empty list
453 install-pkgincludeHEADERS
454 )
455
456 emake "${mymakeopts[@]}"
457 fi
458
459 # install compat pkg-config files
460 # Change dbus to >=sys-apps/dbus-1.8.8 if/when this is dropped.
461 local pcfiles=( src/compat-libs/libsystemd-{daemon,id128,journal,login}.pc )
462 emake "${mymakeopts[@]}" install-pkgconfiglibDATA \
463 pkgconfiglib_DATA="${pcfiles[*]}"
464 }
465
466 multilib_src_install_all() {
467 prune_libtool_files --modules
468 einstalldocs
469
470 if use sysv-utils; then
471 for app in halt poweroff reboot runlevel shutdown telinit; do
472 dosym "..${ROOTPREFIX-/usr}/bin/systemctl" /sbin/${app}
473 done
474 dosym "..${ROOTPREFIX-/usr}/lib/systemd/systemd" /sbin/init
475 else
476 # we just keep sysvinit tools, so no need for the mans
477 rm "${D}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \
478 || die
479 rm "${D}"/usr/share/man/man1/init.1 || die
480 fi
481
482 # Disable storing coredumps in journald, bug #433457
483 mv "${D}"/usr/lib/sysctl.d/50-coredump.conf{,.disabled} || die
484
485 # Preserve empty dirs in /etc & /var, bug #437008
486 keepdir /etc/binfmt.d /etc/modules-load.d /etc/tmpfiles.d \
487 /etc/systemd/ntp-units.d /etc/systemd/user /var/lib/systemd \
488 /var/log/journal/remote
489
490 # Symlink /etc/sysctl.conf for easy migration.
491 dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf
492
493 # If we install these symlinks, there is no way for the sysadmin to remove them
494 # permanently.
495 rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-networkd.service || die
496 rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-resolved.service || die
497 rm -r "${D}"/etc/systemd/system/network-online.target.wants || die
498 rm -r "${D}"/etc/systemd/system/sysinit.target.wants || die
499 }
500
501 migrate_locale() {
502 local envd_locale_def="${EROOT%/}/etc/env.d/02locale"
503 local envd_locale=( "${EROOT%/}"/etc/env.d/??locale )
504 local locale_conf="${EROOT%/}/etc/locale.conf"
505
506 if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
507 # If locale.conf does not exist...
508 if [[ -e ${envd_locale} ]]; then
509 # ...either copy env.d/??locale if there's one
510 ebegin "Moving ${envd_locale} to ${locale_conf}"
511 mv "${envd_locale}" "${locale_conf}"
512 eend ${?} || FAIL=1
513 else
514 # ...or create a dummy default
515 ebegin "Creating ${locale_conf}"
516 cat > "${locale_conf}" <<-EOF
517 # This file has been created by the sys-apps/systemd ebuild.
518 # See locale.conf(5) and localectl(1).
519
520 # LANG=${LANG}
521 EOF
522 eend ${?} || FAIL=1
523 fi
524 fi
525
526 if [[ ! -L ${envd_locale} ]]; then
527 # now, if env.d/??locale is not a symlink (to locale.conf)...
528 if [[ -e ${envd_locale} ]]; then
529 # ...warn the user that he has duplicate locale settings
530 ewarn
531 ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
532 ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
533 ewarn "and create the symlink with the following command:"
534 ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
535 ewarn
536 else
537 # ...or just create the symlink if there's nothing here
538 ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
539 ln -n -s ../locale.conf "${envd_locale_def}"
540 eend ${?} || FAIL=1
541 fi
542 fi
543 }
544
545 migrate_net_name_slot() {
546 # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null,
547 # do the same for 80-net-setup-link.rules to keep the old behavior
548 local net_move=no
549 local net_name_slot_sym=no
550 local net_rules_path="${EROOT%/}"/etc/udev/rules.d
551 local net_name_slot="${net_rules_path}"/80-net-name-slot.rules
552 local net_setup_link="${net_rules_path}"/80-net-setup-link.rules
553 if [[ -e ${net_setup_link} ]]; then
554 net_move=no
555 elif [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]]; then
556 net_move=yes
557 elif [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
558 net_move=yes
559 net_name_slot_sym=yes
560 fi
561 if [[ ${net_move} == yes ]]; then
562 ebegin "Copying ${net_name_slot} to ${net_setup_link}"
563
564 if [[ ${net_name_slot_sym} == yes ]]; then
565 ln -nfs /dev/null "${net_setup_link}"
566 else
567 cp "${net_name_slot}" "${net_setup_link}"
568 fi
569 eend $? || FAIL=1
570 fi
571 }
572
573 pkg_postinst() {
574 newusergroup() {
575 enewgroup "$1"
576 enewuser "$1" -1 -1 -1 "$1"
577 }
578
579 enewgroup input
580 enewgroup systemd-journal
581 newusergroup systemd-bus-proxy
582 newusergroup systemd-journal-gateway
583 newusergroup systemd-journal-remote
584 newusergroup systemd-journal-upload
585 newusergroup systemd-network
586 newusergroup systemd-resolve
587 newusergroup systemd-timesync
588 use http && newusergroup systemd-journal-gateway
589
590 systemd_update_catalog
591
592 # Keep this here in case the database format changes so it gets updated
593 # when required. Despite that this file is owned by sys-apps/hwids.
594 if has_version "sys-apps/hwids[udev]"; then
595 udevadm hwdb --update --root="${ROOT%/}"
596 fi
597
598 udev_reload || FAIL=1
599
600 # Bug 465468, make sure locales are respect, and ensure consistency
601 # between OpenRC & systemd
602 migrate_locale
603
604 # Migrate 80-net-name-slot.rules -> 80-net-setup-link.rules
605 migrate_net_name_slot
606
607 if [[ ${FAIL} ]]; then
608 eerror "One of the postinst commands failed. Please check the postinst output"
609 eerror "for errors. You may need to clean up your system and/or try installing"
610 eerror "systemd again."
611 eerror
612 fi
613
614 if [[ $(readlink "${ROOT}"/etc/resolv.conf) == */run/systemd/network/resolv.conf ]]; then
615 ewarn "resolv.conf is now generated by systemd-resolved. To use it, enable"
616 ewarn "systemd-resolved.service, and create a symlink from /etc/resolv.conf"
617 ewarn "to /run/systemd/resolve/resolv.conf"
618 ewarn
619 fi
620 }
621
622 pkg_prerm() {
623 # If removing systemd completely, remove the catalog database.
624 if [[ ! ${REPLACED_BY_VERSION} ]]; then
625 rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
626 fi
627 }