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/, sys-apps/systemd/files/
Date: Sat, 26 Sep 2015 01:53:42
Message-Id: 1443232405.8595c126a7159621855791860b74f7d40b7eeed0.floppym@gentoo
1 commit: 8595c126a7159621855791860b74f7d40b7eeed0
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 26 01:52:46 2015 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 26 01:53:25 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8595c126
7
8 sys-apps/systemd: Fix noclean-tmp patch for 218
9
10 Package-Manager: portage-2.2.21_p119
11
12 sys-apps/systemd/files/218-noclean-tmp.patch | 4 +-
13 sys-apps/systemd/systemd-218-r5.ebuild | 463 +++++++++++++++++++++++++++
14 2 files changed, 465 insertions(+), 2 deletions(-)
15
16 diff --git a/sys-apps/systemd/files/218-noclean-tmp.patch b/sys-apps/systemd/files/218-noclean-tmp.patch
17 index 5dcc4b9..b02e5c8 100644
18 --- a/sys-apps/systemd/files/218-noclean-tmp.patch
19 +++ b/sys-apps/systemd/files/218-noclean-tmp.patch
20 @@ -18,8 +18,8 @@ index b80dab4..241fad5 100644
21 # Clear tmp directories separately, to make them easier to override
22 -d /tmp 1777 root root 10d
23 -d /var/tmp 1777 root root 30d
24 -+v /tmp 1777 root root
25 -+v /var/tmp 1777 root root
26 ++d /tmp 1777 root root
27 ++d /var/tmp 1777 root root
28
29 # Exclude namespace mountpoints created with PrivateTmp=yes
30 x /tmp/systemd-private-%b-*
31
32 diff --git a/sys-apps/systemd/systemd-218-r5.ebuild b/sys-apps/systemd/systemd-218-r5.ebuild
33 new file mode 100644
34 index 0000000..7be421d
35 --- /dev/null
36 +++ b/sys-apps/systemd/systemd-218-r5.ebuild
37 @@ -0,0 +1,463 @@
38 +# Copyright 1999-2015 Gentoo Foundation
39 +# Distributed under the terms of the GNU General Public License v2
40 +# $Id$
41 +
42 +EAPI=5
43 +
44 +AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
45 +PYTHON_COMPAT=( python{2_7,3_3,3_4} )
46 +inherit autotools-utils bash-completion-r1 linux-info multilib \
47 + multilib-minimal pam python-single-r1 systemd toolchain-funcs udev \
48 + user
49 +
50 +DESCRIPTION="System and service manager for Linux"
51 +HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
52 +SRC_URI="http://www.freedesktop.org/software/systemd/${P}.tar.xz"
53 +
54 +LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
55 +SLOT="0/2"
56 +KEYWORDS="alpha amd64 arm ia64 ppc ppc64 sparc x86"
57 +IUSE="acl apparmor audit cryptsetup curl doc elfutils gcrypt gudev http
58 + idn introspection kdbus +kmod +lz4 lzma pam policykit python qrcode +seccomp
59 + selinux ssl sysv-utils terminal test vanilla xkb"
60 +
61 +MINKV="3.8"
62 +
63 +COMMON_DEPEND=">=sys-apps/util-linux-2.25:0=
64 + sys-libs/libcap:0=
65 + !<sys-libs/glibc-2.16
66 + acl? ( sys-apps/acl:0= )
67 + apparmor? ( sys-libs/libapparmor:0= )
68 + audit? ( >=sys-process/audit-2:0= )
69 + cryptsetup? ( >=sys-fs/cryptsetup-1.6:0= )
70 + curl? ( net-misc/curl:0= )
71 + elfutils? ( >=dev-libs/elfutils-0.158:0= )
72 + gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
73 + gudev? ( >=dev-libs/glib-2.34.3:2=[${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 + introspection? ( >=dev-libs/gobject-introspection-1.31.1:0= )
80 + kmod? ( >=sys-apps/kmod-15:0= )
81 + lz4? ( >=app-arch/lz4-0_p119:0=[${MULTILIB_USEDEP}] )
82 + lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] )
83 + pam? ( virtual/pam:= )
84 + python? ( ${PYTHON_DEPS} )
85 + qrcode? ( media-gfx/qrencode:0= )
86 + seccomp? ( sys-libs/libseccomp:0= )
87 + selinux? ( sys-libs/libselinux:0= )
88 + sysv-utils? (
89 + !sys-apps/systemd-sysv-utils
90 + !sys-apps/sysvinit )
91 + terminal? ( >=dev-libs/libevdev-1.2:0=
92 + >=x11-libs/libxkbcommon-0.5:0=
93 + >=x11-libs/libdrm-2.4:0= )
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 +RDEPEND="${COMMON_DEPEND}
100 + >=sys-apps/baselayout-2.2
101 + !sys-auth/nss-myhostname
102 + !sys-fs/eudev
103 + !sys-fs/udev
104 + gudev? ( !dev-libs/libgudev )"
105 +
106 +# sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
107 +PDEPEND=">=sys-apps/dbus-1.6.8-r1:0[systemd]
108 + >=sys-apps/hwids-20130717-r1[udev]
109 + >=sys-fs/udev-init-scripts-25
110 + policykit? ( sys-auth/polkit )
111 + !vanilla? ( sys-apps/gentoo-systemd-integration )"
112 +
113 +# Newer linux-headers needed by ia64, bug #480218
114 +DEPEND="${COMMON_DEPEND}
115 + app-arch/xz-utils:0
116 + dev-util/gperf
117 + >=dev-util/intltool-0.50
118 + >=sys-apps/coreutils-8.16
119 + >=sys-devel/binutils-2.23.1
120 + >=sys-devel/gcc-4.6
121 + >=sys-kernel/linux-headers-${MINKV}
122 + ia64? ( >=sys-kernel/linux-headers-3.9 )
123 + virtual/pkgconfig
124 + doc? ( >=dev-util/gtk-doc-1.18 )
125 + python? ( dev-python/lxml[${PYTHON_USEDEP}] )
126 + test? ( >=sys-apps/dbus-1.6.8-r1:0 )"
127 +
128 +PATCHES=(
129 + "${FILESDIR}/218-Dont-enable-audit-by-default.patch"
130 + "${FILESDIR}/218-noclean-tmp.patch"
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 + use python && python-single-r1_pkg_setup
173 +}
174 +
175 +src_prepare() {
176 + # Bug 463376
177 + sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
178 +
179 + # missing in tarball
180 + cp "${FILESDIR}"/217-systemd-consoled.service.in \
181 + units/user/systemd-consoled.service.in || die
182 +
183 + autotools-utils_src_prepare
184 +}
185 +
186 +src_configure() {
187 + # Keep using the one where the rules were installed.
188 + MY_UDEVDIR=$(get_udevdir)
189 + # Fix systems broken by bug #509454.
190 + [[ ${MY_UDEVDIR} ]] || MY_UDEVDIR=/lib/udev
191 +
192 + multilib-minimal_src_configure
193 +}
194 +
195 +multilib_src_configure() {
196 + local myeconfargs=(
197 + # disable -flto since it is an optimization flag
198 + # and makes distcc less effective
199 + cc_cv_CFLAGS__flto=no
200 +
201 + # Workaround for bug 516346
202 + --enable-dependency-tracking
203 +
204 + --disable-maintainer-mode
205 + --localstatedir=/var
206 + --with-pamlibdir=$(getpam_mod_dir)
207 + # avoid bash-completion dep
208 + --with-bashcompletiondir="$(get_bashcompdir)"
209 + # make sure we get /bin:/sbin in $PATH
210 + --enable-split-usr
211 + # For testing.
212 + --with-rootprefix="${ROOTPREFIX-/usr}"
213 + --with-rootlibdir="${ROOTPREFIX-/usr}/$(get_libdir)"
214 + # disable sysv compatibility
215 + --with-sysvinit-path=
216 + --with-sysvrcnd-path=
217 + # no deps
218 + --enable-efi
219 + --enable-ima
220 +
221 + # Optional components/dependencies
222 + $(multilib_native_use_enable acl)
223 + $(multilib_native_use_enable apparmor)
224 + $(multilib_native_use_enable audit)
225 + $(multilib_native_use_enable cryptsetup libcryptsetup)
226 + $(multilib_native_use_enable curl libcurl)
227 + $(multilib_native_use_enable doc gtk-doc)
228 + $(multilib_native_use_enable elfutils)
229 + $(use_enable gcrypt)
230 + $(use_enable gudev)
231 + $(multilib_native_use_enable http microhttpd)
232 + $(usex http $(multilib_native_use_enable ssl gnutls) --disable-gnutls)
233 + $(multilib_native_use_enable idn libidn)
234 + $(multilib_native_use_enable introspection)
235 + $(use_enable kdbus)
236 + $(multilib_native_use_enable kmod)
237 + $(use_enable lz4)
238 + $(use_enable lzma xz)
239 + $(multilib_native_use_enable pam)
240 + $(multilib_native_use_enable policykit polkit)
241 + $(multilib_native_use_with python)
242 + $(multilib_native_use_enable python python-devel)
243 + $(multilib_native_use_enable qrcode qrencode)
244 + $(multilib_native_use_enable seccomp)
245 + $(multilib_native_use_enable selinux)
246 + $(multilib_native_use_enable terminal)
247 + $(multilib_native_use_enable test tests)
248 + $(multilib_native_use_enable test dbus)
249 + $(multilib_native_use_enable xkb xkbcommon)
250 +
251 + # not supported (avoid automagic deps in the future)
252 + --disable-chkconfig
253 +
254 + # hardcode a few paths to spare some deps
255 + QUOTAON=/usr/sbin/quotaon
256 + QUOTACHECK=/usr/sbin/quotacheck
257 +
258 + # dbus paths
259 + --with-dbuspolicydir="${EPREFIX}/etc/dbus-1/system.d"
260 + --with-dbussessionservicedir="${EPREFIX}/usr/share/dbus-1/services"
261 + --with-dbussystemservicedir="${EPREFIX}/usr/share/dbus-1/system-services"
262 + --with-dbusinterfacedir="${EPREFIX}/usr/share/dbus-1/interfaces"
263 +
264 + --with-ntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
265 + )
266 +
267 + if ! multilib_is_native_abi; then
268 + myeconfargs+=(
269 + MOUNT_{CFLAGS,LIBS}=' '
270 +
271 + ac_cv_search_cap_init=
272 + ac_cv_header_sys_capability_h=yes
273 + )
274 + fi
275 +
276 + # Work around bug 463846.
277 + tc-export CC
278 +
279 + autotools-utils_src_configure
280 +}
281 +
282 +multilib_src_compile() {
283 + local mymakeopts=(
284 + udevlibexecdir="${MY_UDEVDIR}"
285 + )
286 +
287 + if multilib_is_native_abi; then
288 + emake "${mymakeopts[@]}"
289 + else
290 + # prerequisites for gudev
291 + use gudev && emake src/gudev/gudev{enumtypes,marshal}.{c,h}
292 +
293 + echo 'gentoo: $(BUILT_SOURCES)' | \
294 + emake "${mymakeopts[@]}" -f Makefile -f - gentoo
295 + echo 'gentoo: $(lib_LTLIBRARIES) $(pkgconfiglib_DATA)' | \
296 + emake "${mymakeopts[@]}" -f Makefile -f - gentoo
297 + fi
298 +}
299 +
300 +multilib_src_test() {
301 + multilib_is_native_abi || continue
302 +
303 + default
304 +}
305 +
306 +multilib_src_install() {
307 + local mymakeopts=(
308 + # automake fails with parallel libtool relinking
309 + # https://bugs.gentoo.org/show_bug.cgi?id=491398
310 + -j1
311 +
312 + udevlibexecdir="${MY_UDEVDIR}"
313 + dist_udevhwdb_DATA=
314 + DESTDIR="${D}"
315 + )
316 +
317 + if multilib_is_native_abi; then
318 + emake "${mymakeopts[@]}" install
319 + else
320 + mymakeopts+=(
321 + install-libLTLIBRARIES
322 + install-pkgconfiglibDATA
323 + install-includeHEADERS
324 + # safe to call unconditionally, 'installs' empty list
325 + install-libgudev_includeHEADERS
326 + install-pkgincludeHEADERS
327 + )
328 +
329 + emake "${mymakeopts[@]}"
330 + fi
331 +
332 + # install compat pkg-config files
333 + # Change dbus to >=sys-apps/dbus-1.8.8 if/when this is dropped.
334 + local pcfiles=( src/compat-libs/libsystemd-{daemon,id128,journal,login}.pc )
335 + emake "${mymakeopts[@]}" install-pkgconfiglibDATA \
336 + pkgconfiglib_DATA="${pcfiles[*]}"
337 +}
338 +
339 +multilib_src_install_all() {
340 + prune_libtool_files --modules
341 + einstalldocs
342 +
343 + if use sysv-utils; then
344 + for app in halt poweroff reboot runlevel shutdown telinit; do
345 + dosym "..${ROOTPREFIX-/usr}/bin/systemctl" /sbin/${app}
346 + done
347 + dosym "..${ROOTPREFIX-/usr}/lib/systemd/systemd" /sbin/init
348 + else
349 + # we just keep sysvinit tools, so no need for the mans
350 + rm "${D}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \
351 + || die
352 + rm "${D}"/usr/share/man/man1/init.1 || die
353 + fi
354 +
355 + # Disable storing coredumps in journald, bug #433457
356 + mv "${D}"/usr/lib/sysctl.d/50-coredump.conf{,.disabled} || die
357 +
358 + # Preserve empty dirs in /etc & /var, bug #437008
359 + keepdir /etc/binfmt.d /etc/modules-load.d /etc/tmpfiles.d \
360 + /etc/systemd/ntp-units.d /etc/systemd/user /var/lib/systemd \
361 + /var/log/journal/remote
362 +
363 + # Symlink /etc/sysctl.conf for easy migration.
364 + dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf
365 +
366 + # If we install these symlinks, there is no way for the sysadmin to remove them
367 + # permanently.
368 + rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-networkd.service || die
369 + rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-resolved.service || die
370 + rm -r "${D}"/etc/systemd/system/network-online.target.wants || die
371 + rm -r "${D}"/etc/systemd/system/sysinit.target.wants || die
372 +}
373 +
374 +migrate_locale() {
375 + local envd_locale_def="${EROOT%/}/etc/env.d/02locale"
376 + local envd_locale=( "${EROOT%/}"/etc/env.d/??locale )
377 + local locale_conf="${EROOT%/}/etc/locale.conf"
378 +
379 + if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
380 + # If locale.conf does not exist...
381 + if [[ -e ${envd_locale} ]]; then
382 + # ...either copy env.d/??locale if there's one
383 + ebegin "Moving ${envd_locale} to ${locale_conf}"
384 + mv "${envd_locale}" "${locale_conf}"
385 + eend ${?} || FAIL=1
386 + else
387 + # ...or create a dummy default
388 + ebegin "Creating ${locale_conf}"
389 + cat > "${locale_conf}" <<-EOF
390 + # This file has been created by the sys-apps/systemd ebuild.
391 + # See locale.conf(5) and localectl(1).
392 +
393 + # LANG=${LANG}
394 + EOF
395 + eend ${?} || FAIL=1
396 + fi
397 + fi
398 +
399 + if [[ ! -L ${envd_locale} ]]; then
400 + # now, if env.d/??locale is not a symlink (to locale.conf)...
401 + if [[ -e ${envd_locale} ]]; then
402 + # ...warn the user that he has duplicate locale settings
403 + ewarn
404 + ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
405 + ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
406 + ewarn "and create the symlink with the following command:"
407 + ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
408 + ewarn
409 + else
410 + # ...or just create the symlink if there's nothing here
411 + ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
412 + ln -n -s ../locale.conf "${envd_locale_def}"
413 + eend ${?} || FAIL=1
414 + fi
415 + fi
416 +}
417 +
418 +migrate_net_name_slot() {
419 + # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null,
420 + # do the same for 80-net-setup-link.rules to keep the old behavior
421 + local net_move=no
422 + local net_name_slot_sym=no
423 + local net_rules_path="${EROOT%/}"/etc/udev/rules.d
424 + local net_name_slot="${net_rules_path}"/80-net-name-slot.rules
425 + local net_setup_link="${net_rules_path}"/80-net-setup-link.rules
426 + if [[ -e ${net_setup_link} ]]; then
427 + net_move=no
428 + elif [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]]; then
429 + net_move=yes
430 + elif [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
431 + net_move=yes
432 + net_name_slot_sym=yes
433 + fi
434 + if [[ ${net_move} == yes ]]; then
435 + ebegin "Copying ${net_name_slot} to ${net_setup_link}"
436 +
437 + if [[ ${net_name_slot_sym} == yes ]]; then
438 + ln -nfs /dev/null "${net_setup_link}"
439 + else
440 + cp "${net_name_slot}" "${net_setup_link}"
441 + fi
442 + eend $? || FAIL=1
443 + fi
444 +}
445 +
446 +pkg_postinst() {
447 + newusergroup() {
448 + enewgroup "$1"
449 + enewuser "$1" -1 -1 -1 "$1"
450 + }
451 +
452 + enewgroup input
453 + enewgroup systemd-journal
454 + newusergroup systemd-bus-proxy
455 + newusergroup systemd-journal-gateway
456 + newusergroup systemd-journal-remote
457 + newusergroup systemd-journal-upload
458 + newusergroup systemd-network
459 + newusergroup systemd-resolve
460 + newusergroup systemd-timesync
461 + use http && newusergroup systemd-journal-gateway
462 +
463 + systemd_update_catalog
464 +
465 + # Keep this here in case the database format changes so it gets updated
466 + # when required. Despite that this file is owned by sys-apps/hwids.
467 + if has_version "sys-apps/hwids[udev]"; then
468 + udevadm hwdb --update --root="${ROOT%/}"
469 + fi
470 +
471 + udev_reload || FAIL=1
472 +
473 + # Bug 465468, make sure locales are respect, and ensure consistency
474 + # between OpenRC & systemd
475 + migrate_locale
476 +
477 + # Migrate 80-net-name-slot.rules -> 80-net-setup-link.rules
478 + migrate_net_name_slot
479 +
480 + if [[ ${FAIL} ]]; then
481 + eerror "One of the postinst commands failed. Please check the postinst output"
482 + eerror "for errors. You may need to clean up your system and/or try installing"
483 + eerror "systemd again."
484 + eerror
485 + fi
486 +
487 + if [[ $(readlink "${ROOT}"/etc/resolv.conf) == */run/systemd/network/resolv.conf ]]; then
488 + ewarn "resolv.conf is now generated by systemd-resolved. To use it, enable"
489 + ewarn "systemd-resolved.service, and create a symlink from /etc/resolv.conf"
490 + ewarn "to /run/systemd/resolve/resolv.conf"
491 + ewarn
492 + fi
493 +}
494 +
495 +pkg_prerm() {
496 + # If removing systemd completely, remove the catalog database.
497 + if [[ ! ${REPLACED_BY_VERSION} ]]; then
498 + rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
499 + fi
500 +}