/[gentoo-x86]/sys-apps/systemd/systemd-9999.ebuild
Gentoo

Contents of /sys-apps/systemd/systemd-9999.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.184 - (show annotations) (download)
Sat Aug 1 15:10:12 2015 UTC (5 years, 2 months ago) by floppym
Branch: MAIN
CVS Tags: HEAD
Changes since 1.183: +14 -19 lines
Remove code for defunct terminal USE flag. Re-enable networkd to support socket activation.

(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 0BBEEA1FEA4843A4)

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

  ViewVC Help
Powered by ViewVC 1.1.20