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: Sat, 28 May 2016 15:27:19
Message-Id: 1464449231.9831af3ccaa00070d7faa8927f8c5beb78ac5cfc.floppym@gentoo
1 commit: 9831af3ccaa00070d7faa8927f8c5beb78ac5cfc
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Sat May 28 15:26:13 2016 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Sat May 28 15:27:11 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9831af3c
7
8 sys-apps/systemd: bump to 230
9
10 Package-Manager: portage-2.3.0_rc1_p14
11
12 sys-apps/systemd/Manifest | 2 +
13 sys-apps/systemd/systemd-230.ebuild | 482 ++++++++++++++++++++++++++++++++++++
14 2 files changed, 484 insertions(+)
15
16 diff --git a/sys-apps/systemd/Manifest b/sys-apps/systemd/Manifest
17 index 3c8ebde..d065f42 100644
18 --- a/sys-apps/systemd/Manifest
19 +++ b/sys-apps/systemd/Manifest
20 @@ -3,3 +3,5 @@ DIST systemd-226.tar.gz 3914162 SHA256 baff6a938c5579769330d0224280bf1a1ff592015
21 DIST systemd-228.tar.gz 4034401 SHA256 dd124ff561a07e6439ed2b3713f38ca914df7747f110ce86deea17b56d245ae6 SHA512 e54f282f550854dc082a4788709905e5767b75d2057e18d749b54821f2e44e0a8d1349b1a9180036cc854ecccaf5ff86b3b1dba4d3c2ce1b1fc766930ea4c0ea WHIRLPOOL 16b28367edc29a74f5b08691839da39a02d55bf5bcdffef55bfb1a2e8065eeecbe22a2b661e2d5f161f008d05baa000aff60d662d65db380d6c3fe0c1380eea1
22 DIST systemd-229-patches.tar.gz 10782 SHA256 bd688e614177903bbf0204a00afebcb39760c3c694e7a6dd71544290677bfb5a SHA512 b0a7be84827f1553dccc00a0100c2f79160cc5285ce1582e7093e790a373d34b2a94f2805df5ade37a17285ae2f7d02890a495c2cc57e3475a3bdc831f05db52 WHIRLPOOL 643daee4fd23a5a326419cc769f8735d82bffa5ae1d9e9019ed4adfb04aba343f1459761c1d9b6ab3482e1a50cd7b0976a77ecc0bfb7075839000551d35bcb3f
23 DIST systemd-229.tar.gz 4319173 SHA256 b51b0a48d1beb388d95bd6a98d62be05490335d4bb388aefecdcb576e91e0741 SHA512 d692c0c9fc82f2fce64a5ec1caa4a0f8cf9edaeb1bdaaa1c462669db8f78b3dd6b33c87ef926ff21823582d0460f7b63aa3755792f9ae2cd6fb813ba08a35c39 WHIRLPOOL aa44f7161d80cc680226f19755579ba72c52cfe7bd671aefb09c414981f3a5a5c852f07d3449ac6f96d4ca91120cfb1464225d995b1637f1e2c108baf3c4a392
24 +DIST systemd-230-patches.tar.gz 11858 SHA256 7a40071ffa2e43dda5ac2dfc91a263b0599b32dd5590d968e1077bebfce5654b SHA512 302420aabedd07b5a0b00b1f2e7500913586e867e548bde4ef6ee81cb3bd1682bdeac061111f9d8e120f4111cde2c709ed02922d56b0940d5603daff18003215 WHIRLPOOL 44f5ecaa5655e8eba3832b662fd30c7c6ca22f5d34f5d538587aa90b437457e149cd8f99bd83aec863991ec9fb5aef867218ad73a333580fe22f322ab4e3746f
25 +DIST systemd-230.tar.gz 4288027 SHA256 46b07568142adcd017c62e6230d39eb10d219ed3b2f13ffc12d9a3a6b1c840cd SHA512 a0057c5258055a6b4000eb762ab2ec3c5329361711540f7124ba5c4b1119a1b531ad336ddef3bbe5d08218c8d7f1fd175c86d61357ac72935a932921cff28a96 WHIRLPOOL 95404535eb85d3b8c20dc13b12427a9da1f92729eb9e66a58d7e990f09fee28762be00088897bf1bf485d9a34619799ff0171a161824cc8f135ac2438e978d1e
26
27 diff --git a/sys-apps/systemd/systemd-230.ebuild b/sys-apps/systemd/systemd-230.ebuild
28 new file mode 100644
29 index 0000000..4a5e23e
30 --- /dev/null
31 +++ b/sys-apps/systemd/systemd-230.ebuild
32 @@ -0,0 +1,482 @@
33 +# Copyright 1999-2016 Gentoo Foundation
34 +# Distributed under the terms of the GNU General Public License v2
35 +# $Id$
36 +
37 +EAPI=6
38 +
39 +if [[ ${PV} == 9999 ]]; then
40 + EGIT_REPO_URI="https://github.com/systemd/systemd.git"
41 + inherit git-r3
42 +else
43 + SRC_URI="https://github.com/systemd/systemd/archive/v${PV}.tar.gz -> ${P}.tar.gz
44 + https://dev.gentoo.org/~floppym/dist/${P}-patches.tar.gz"
45 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc ~x86"
46 +fi
47 +
48 +inherit autotools bash-completion-r1 linux-info \
49 + multilib-minimal pam systemd toolchain-funcs udev user
50 +
51 +DESCRIPTION="System and service manager for Linux"
52 +HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd"
53 +
54 +LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
55 +SLOT="0/2"
56 +IUSE="acl apparmor audit cryptsetup curl elfutils +gcrypt gnuefi http
57 + idn importd +kdbus +kmod +lz4 lzma nat pam policykit
58 + qrcode +seccomp selinux ssl sysv-utils test vanilla xkb"
59 +
60 +REQUIRED_USE="importd? ( curl gcrypt lzma )"
61 +
62 +MINKV="3.11"
63 +
64 +COMMON_DEPEND=">=sys-apps/util-linux-2.27.1:0=[${MULTILIB_USEDEP}]
65 + sys-libs/libcap:0=[${MULTILIB_USEDEP}]
66 + !<sys-libs/glibc-2.16
67 + acl? ( sys-apps/acl:0= )
68 + apparmor? ( sys-libs/libapparmor:0= )
69 + audit? ( >=sys-process/audit-2:0= )
70 + cryptsetup? ( >=sys-fs/cryptsetup-1.6:0= )
71 + curl? ( net-misc/curl:0= )
72 + elfutils? ( >=dev-libs/elfutils-0.158:0= )
73 + gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
74 + http? (
75 + >=net-libs/libmicrohttpd-0.9.33:0=
76 + ssl? ( >=net-libs/gnutls-3.1.4:0= )
77 + )
78 + idn? ( net-dns/libidn:0= )
79 + importd? (
80 + app-arch/bzip2:0=
81 + sys-libs/zlib:0=
82 + )
83 + kmod? ( >=sys-apps/kmod-15:0= )
84 + lz4? ( >=app-arch/lz4-0_p131:0=[${MULTILIB_USEDEP}] )
85 + lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] )
86 + nat? ( net-firewall/iptables:0= )
87 + pam? ( virtual/pam:= )
88 + qrcode? ( media-gfx/qrencode:0= )
89 + seccomp? ( sys-libs/libseccomp:0= )
90 + selinux? ( sys-libs/libselinux:0= )
91 + sysv-utils? (
92 + !sys-apps/systemd-sysv-utils
93 + !sys-apps/sysvinit )
94 + xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )
95 + abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r9
96 + !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
97 +
98 +# baselayout-2.2 has /run
99 +# laptop-mode-tools: https://github.com/systemd/systemd/issues/2684
100 +RDEPEND="${COMMON_DEPEND}
101 + >=sys-apps/baselayout-2.2
102 + selinux? ( sec-policy/selinux-systemd )
103 + !sys-auth/nss-myhostname
104 + !sys-fs/eudev
105 + !sys-fs/udev
106 + !app-laptop/laptop-mode-tools"
107 +
108 +# sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
109 +PDEPEND=">=sys-apps/dbus-1.8.8:0[systemd]
110 + >=sys-apps/hwids-20150417[udev]
111 + >=sys-fs/udev-init-scripts-25
112 + policykit? ( sys-auth/polkit )
113 + !vanilla? ( sys-apps/gentoo-systemd-integration )"
114 +
115 +# Newer linux-headers needed by ia64, bug #480218
116 +DEPEND="${COMMON_DEPEND}
117 + app-arch/xz-utils:0
118 + dev-util/gperf
119 + >=dev-util/intltool-0.50
120 + >=sys-apps/coreutils-8.16
121 + >=sys-devel/binutils-2.23.1
122 + >=sys-devel/gcc-4.6
123 + >=sys-kernel/linux-headers-${MINKV}
124 + virtual/pkgconfig
125 + gnuefi? ( >=sys-boot/gnu-efi-3.0.2 )
126 + test? ( >=sys-apps/dbus-1.6.8-r1:0 )
127 + app-text/docbook-xml-dtd:4.2
128 + app-text/docbook-xml-dtd:4.5
129 + app-text/docbook-xsl-stylesheets
130 + dev-libs/libxslt:0
131 +"
132 +
133 +pkg_pretend() {
134 + local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS
135 + ~DEVPTS_MULTIPLE_INSTANCES ~DEVTMPFS ~DMIID ~EPOLL ~FANOTIFY ~FHANDLE
136 + ~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SECCOMP ~SIGNALFD ~SYSFS
137 + ~TIMERFD ~TMPFS_XATTR
138 + ~!FW_LOADER_USER_HELPER ~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED
139 + ~!SYSFS_DEPRECATED_V2"
140 +
141 + use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
142 + kernel_is -lt 3 7 && CONFIG_CHECK+=" ~HOTPLUG"
143 +
144 + if linux_config_exists; then
145 + local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
146 + if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
147 + ewarn "It's recommended to set an empty value to the following kernel config option:"
148 + ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
149 + fi
150 + fi
151 +
152 + if [[ ${MERGE_TYPE} != binary ]]; then
153 + if [[ $(gcc-major-version) -lt 4
154 + || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 6 ) ]]
155 + then
156 + eerror "systemd requires at least gcc 4.6 to build. Please switch the active"
157 + eerror "gcc version using gcc-config."
158 + die "systemd requires at least gcc 4.6"
159 + fi
160 + fi
161 +
162 + if [[ ${MERGE_TYPE} != buildonly ]]; then
163 + if kernel_is -lt ${MINKV//./ }; then
164 + ewarn "Kernel version at least ${MINKV} required"
165 + fi
166 +
167 + check_extra_config
168 + fi
169 +}
170 +
171 +pkg_setup() {
172 + :
173 +}
174 +
175 +src_unpack() {
176 + default
177 + [[ ${PV} != 9999 ]] || git-r3_src_unpack
178 +}
179 +
180 +src_prepare() {
181 + # Bug 463376
182 + sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
183 +
184 + local PATCHES=(
185 + "${FILESDIR}/218-Dont-enable-audit-by-default.patch"
186 + "${FILESDIR}/228-noclean-tmp.patch"
187 + )
188 + [[ -d "${WORKDIR}"/patches ]] && PATCHES+=( "${WORKDIR}"/patches )
189 +
190 + default
191 +
192 + eautoreconf
193 +}
194 +
195 +src_configure() {
196 + # Keep using the one where the rules were installed.
197 + MY_UDEVDIR=$(get_udevdir)
198 + # Fix systems broken by bug #509454.
199 + [[ ${MY_UDEVDIR} ]] || MY_UDEVDIR=/lib/udev
200 +
201 + # Prevent conflicts with i686 cross toolchain, bug 559726
202 + tc-export AR CC NM OBJCOPY RANLIB
203 +
204 + multilib-minimal_src_configure
205 +}
206 +
207 +multilib_src_configure() {
208 + local myeconfargs=(
209 + # disable -flto since it is an optimization flag
210 + # and makes distcc less effective
211 + cc_cv_CFLAGS__flto=no
212 + # disable -fuse-ld=gold since Gentoo supports explicit linker
213 + # choice and forcing gold is undesired, #539998
214 + # ld.gold may collide with user's LDFLAGS, #545168
215 + # ld.gold breaks sparc, #573874
216 + cc_cv_LDFLAGS__Wl__fuse_ld_gold=no
217 +
218 + # Workaround for gcc-4.7, bug 554454.
219 + cc_cv_CFLAGS__Werror_shadow=no
220 +
221 + # Workaround for bug 516346
222 + --enable-dependency-tracking
223 +
224 + --disable-maintainer-mode
225 + --localstatedir=/var
226 + --with-pamlibdir=$(getpam_mod_dir)
227 + # avoid bash-completion dep
228 + --with-bashcompletiondir="$(get_bashcompdir)"
229 + # make sure we get /bin:/sbin in $PATH
230 + --enable-split-usr
231 + # For testing.
232 + --with-rootprefix="${ROOTPREFIX-/usr}"
233 + --with-rootlibdir="${ROOTPREFIX-/usr}/$(get_libdir)"
234 + # disable sysv compatibility
235 + --with-sysvinit-path=
236 + --with-sysvrcnd-path=
237 + # no deps
238 + --enable-efi
239 + --enable-ima
240 + --without-python
241 +
242 + # Optional components/dependencies
243 + $(multilib_native_use_enable acl)
244 + $(multilib_native_use_enable apparmor)
245 + $(multilib_native_use_enable audit)
246 + $(multilib_native_use_enable cryptsetup libcryptsetup)
247 + $(multilib_native_use_enable curl libcurl)
248 + $(multilib_native_use_enable elfutils)
249 + $(use_enable gcrypt)
250 + $(multilib_native_use_enable gnuefi)
251 + $(multilib_native_use_enable http microhttpd)
252 + $(usex http $(multilib_native_use_enable ssl gnutls) --disable-gnutls)
253 + $(multilib_native_use_enable idn libidn)
254 + $(multilib_native_use_enable importd)
255 + $(multilib_native_use_enable importd bzip2)
256 + $(multilib_native_use_enable importd zlib)
257 + $(use_enable kdbus)
258 + $(multilib_native_use_enable kmod)
259 + $(use_enable lz4)
260 + $(use_enable lzma xz)
261 + $(multilib_native_use_enable nat libiptc)
262 + $(multilib_native_use_enable pam)
263 + $(multilib_native_use_enable policykit polkit)
264 + $(multilib_native_use_enable qrcode qrencode)
265 + $(multilib_native_use_enable seccomp)
266 + $(multilib_native_use_enable selinux)
267 + $(multilib_native_use_enable test tests)
268 + $(multilib_native_use_enable test dbus)
269 + $(multilib_native_use_enable xkb xkbcommon)
270 +
271 + # hardcode a few paths to spare some deps
272 + KILL=/bin/kill
273 + QUOTAON=/usr/sbin/quotaon
274 + QUOTACHECK=/usr/sbin/quotacheck
275 +
276 + # TODO: we may need to restrict this to gcc
277 + EFI_CC="$(tc-getCC)"
278 +
279 + # dbus paths
280 + --with-dbuspolicydir="${EPREFIX}/etc/dbus-1/system.d"
281 + --with-dbussessionservicedir="${EPREFIX}/usr/share/dbus-1/services"
282 + --with-dbussystemservicedir="${EPREFIX}/usr/share/dbus-1/system-services"
283 +
284 + --with-ntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
285 + )
286 +
287 + # Work around bug 463846.
288 + tc-export CC
289 +
290 + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
291 +}
292 +
293 +multilib_src_compile() {
294 + local mymakeopts=(
295 + udevlibexecdir="${MY_UDEVDIR}"
296 + )
297 +
298 + if multilib_is_native_abi; then
299 + emake "${mymakeopts[@]}"
300 + else
301 + echo 'gentoo: $(BUILT_SOURCES)' | \
302 + emake "${mymakeopts[@]}" -f Makefile -f - gentoo
303 + echo 'gentoo: $(lib_LTLIBRARIES) $(pkgconfiglib_DATA)' | \
304 + emake "${mymakeopts[@]}" -f Makefile -f - gentoo
305 + fi
306 +}
307 +
308 +multilib_src_test() {
309 + multilib_is_native_abi || continue
310 +
311 + # Needed for bus-related tests
312 + local -x SANDBOX_WRITE=${SANDBOX_WRITE}
313 + addwrite /sys/fs/kdbus
314 +
315 + default
316 +}
317 +
318 +multilib_src_install() {
319 + local mymakeopts=(
320 + # automake fails with parallel libtool relinking
321 + # https://bugs.gentoo.org/show_bug.cgi?id=491398
322 + -j1
323 +
324 + udevlibexecdir="${MY_UDEVDIR}"
325 + dist_udevhwdb_DATA=
326 + DESTDIR="${D}"
327 + )
328 +
329 + if multilib_is_native_abi; then
330 + emake "${mymakeopts[@]}" install
331 + else
332 + mymakeopts+=(
333 + install-libLTLIBRARIES
334 + install-pkgconfiglibDATA
335 + install-includeHEADERS
336 + # safe to call unconditionally, 'installs' empty list
337 + install-pkgincludeHEADERS
338 + )
339 +
340 + emake "${mymakeopts[@]}"
341 + fi
342 +}
343 +
344 +multilib_src_install_all() {
345 + prune_libtool_files --modules
346 + einstalldocs
347 +
348 + if use sysv-utils; then
349 + for app in halt poweroff reboot runlevel shutdown telinit; do
350 + dosym "..${ROOTPREFIX-/usr}/bin/systemctl" /sbin/${app}
351 + done
352 + dosym "..${ROOTPREFIX-/usr}/lib/systemd/systemd" /sbin/init
353 + else
354 + # we just keep sysvinit tools, so no need for the mans
355 + rm "${D}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \
356 + || die
357 + rm "${D}"/usr/share/man/man1/init.1 || die
358 + fi
359 +
360 + # Preserve empty dirs in /etc & /var, bug #437008
361 + keepdir /etc/binfmt.d /etc/modules-load.d /etc/tmpfiles.d \
362 + /etc/systemd/ntp-units.d /etc/systemd/user /var/lib/systemd \
363 + /var/log/journal/remote
364 +
365 + # Symlink /etc/sysctl.conf for easy migration.
366 + dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf
367 +
368 + # If we install these symlinks, there is no way for the sysadmin to remove them
369 + # permanently.
370 + rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-networkd.service || die
371 + rm -f "${D}"/etc/systemd/system/multi-user.target.wants/systemd-resolved.service || die
372 + rm -r "${D}"/etc/systemd/system/network-online.target.wants || die
373 + rm -r "${D}"/etc/systemd/system/sockets.target.wants || die
374 + rm -r "${D}"/etc/systemd/system/sysinit.target.wants || die
375 +}
376 +
377 +migrate_locale() {
378 + local envd_locale_def="${EROOT%/}/etc/env.d/02locale"
379 + local envd_locale=( "${EROOT%/}"/etc/env.d/??locale )
380 + local locale_conf="${EROOT%/}/etc/locale.conf"
381 +
382 + if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
383 + # If locale.conf does not exist...
384 + if [[ -e ${envd_locale} ]]; then
385 + # ...either copy env.d/??locale if there's one
386 + ebegin "Moving ${envd_locale} to ${locale_conf}"
387 + mv "${envd_locale}" "${locale_conf}"
388 + eend ${?} || FAIL=1
389 + else
390 + # ...or create a dummy default
391 + ebegin "Creating ${locale_conf}"
392 + cat > "${locale_conf}" <<-EOF
393 + # This file has been created by the sys-apps/systemd ebuild.
394 + # See locale.conf(5) and localectl(1).
395 +
396 + # LANG=${LANG}
397 + EOF
398 + eend ${?} || FAIL=1
399 + fi
400 + fi
401 +
402 + if [[ ! -L ${envd_locale} ]]; then
403 + # now, if env.d/??locale is not a symlink (to locale.conf)...
404 + if [[ -e ${envd_locale} ]]; then
405 + # ...warn the user that he has duplicate locale settings
406 + ewarn
407 + ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
408 + ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
409 + ewarn "and create the symlink with the following command:"
410 + ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
411 + ewarn
412 + else
413 + # ...or just create the symlink if there's nothing here
414 + ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
415 + ln -n -s ../locale.conf "${envd_locale_def}"
416 + eend ${?} || FAIL=1
417 + fi
418 + fi
419 +}
420 +
421 +migrate_net_name_slot() {
422 + # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null,
423 + # do the same for 80-net-setup-link.rules to keep the old behavior
424 + local net_move=no
425 + local net_name_slot_sym=no
426 + local net_rules_path="${EROOT%/}"/etc/udev/rules.d
427 + local net_name_slot="${net_rules_path}"/80-net-name-slot.rules
428 + local net_setup_link="${net_rules_path}"/80-net-setup-link.rules
429 + if [[ -e ${net_setup_link} ]]; then
430 + net_move=no
431 + elif [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]]; then
432 + net_move=yes
433 + elif [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
434 + net_move=yes
435 + net_name_slot_sym=yes
436 + fi
437 + if [[ ${net_move} == yes ]]; then
438 + ebegin "Copying ${net_name_slot} to ${net_setup_link}"
439 +
440 + if [[ ${net_name_slot_sym} == yes ]]; then
441 + ln -nfs /dev/null "${net_setup_link}"
442 + else
443 + cp "${net_name_slot}" "${net_setup_link}"
444 + fi
445 + eend $? || FAIL=1
446 + fi
447 +}
448 +
449 +reenable_unit() {
450 + if systemctl is-enabled --root="${ROOT}" "$1" &> /dev/null; then
451 + ebegin "Re-enabling $1"
452 + systemctl reenable --root="${ROOT}" "$1"
453 + eend $? || FAIL=1
454 + fi
455 +}
456 +
457 +pkg_postinst() {
458 + newusergroup() {
459 + enewgroup "$1"
460 + enewuser "$1" -1 -1 -1 "$1"
461 + }
462 +
463 + enewgroup input
464 + enewgroup systemd-journal
465 + newusergroup systemd-bus-proxy
466 + newusergroup systemd-coredump
467 + newusergroup systemd-journal-gateway
468 + newusergroup systemd-journal-remote
469 + newusergroup systemd-journal-upload
470 + newusergroup systemd-network
471 + newusergroup systemd-resolve
472 + newusergroup systemd-timesync
473 +
474 + systemd_update_catalog
475 +
476 + # Keep this here in case the database format changes so it gets updated
477 + # when required. Despite that this file is owned by sys-apps/hwids.
478 + if has_version "sys-apps/hwids[udev]"; then
479 + udevadm hwdb --update --root="${ROOT%/}"
480 + fi
481 +
482 + udev_reload || FAIL=1
483 +
484 + # Bug 465468, make sure locales are respect, and ensure consistency
485 + # between OpenRC & systemd
486 + migrate_locale
487 +
488 + # Migrate 80-net-name-slot.rules -> 80-net-setup-link.rules
489 + migrate_net_name_slot
490 +
491 + # Re-enable systemd-networkd for socket activation
492 + reenable_unit systemd-networkd.service
493 +
494 + if [[ ${FAIL} ]]; then
495 + eerror "One of the postinst commands failed. Please check the postinst output"
496 + eerror "for errors. You may need to clean up your system and/or try installing"
497 + eerror "systemd again."
498 + eerror
499 + fi
500 +
501 + if [[ $(readlink "${ROOT}"/etc/resolv.conf) == */run/systemd/network/resolv.conf ]]; then
502 + ewarn "resolv.conf is now generated by systemd-resolved. To use it, enable"
503 + ewarn "systemd-resolved.service, and create a symlink from /etc/resolv.conf"
504 + ewarn "to /run/systemd/resolve/resolv.conf"
505 + ewarn
506 + fi
507 +}
508 +
509 +pkg_prerm() {
510 + # If removing systemd completely, remove the catalog database.
511 + if [[ ! ${REPLACED_BY_VERSION} ]]; then
512 + rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
513 + fi
514 +}