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

Contents of /sys-apps/systemd/systemd-215-r3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.18 - (show annotations) (download)
Sat May 30 13:02:14 2015 UTC (5 years, 5 months ago) by pacho
Branch: MAIN
CVS Tags: HEAD
Changes since 1.17: +1 -1 lines
FILE REMOVED
Drop old

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

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-215-r3.ebuild,v 1.17 2015/04/08 18:27:32 mgorny Exp $
4
5 EAPI=5
6
7 AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
8 PYTHON_COMPAT=( python{2_7,3_3,3_4} )
9 inherit autotools-utils bash-completion-r1 linux-info multilib \
10 multilib-minimal pam python-single-r1 systemd toolchain-funcs udev \
11 user
12
13 DESCRIPTION="System and service manager for Linux"
14 HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
15 SRC_URI="http://www.freedesktop.org/software/systemd/${P}.tar.xz"
16
17 LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
18 SLOT="0/2"
19 KEYWORDS="alpha amd64 arm ia64 ppc ppc64 sparc x86"
20 IUSE="acl audit cryptsetup doc elfutils +firmware-loader gcrypt gudev http
21 introspection kdbus +kmod lzma pam policykit python qrcode +seccomp selinux
22 ssl test vanilla"
23
24 MINKV="3.8"
25
26 COMMON_DEPEND=">=sys-apps/util-linux-2.20:0=
27 sys-libs/libcap:0=
28 acl? ( sys-apps/acl:0= )
29 audit? ( >=sys-process/audit-2:0= )
30 cryptsetup? ( >=sys-fs/cryptsetup-1.6:0= )
31 elfutils? ( >=dev-libs/elfutils-0.158:0= )
32 gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
33 gudev? ( >=dev-libs/glib-2.34.3:2=[${MULTILIB_USEDEP}] )
34 http? (
35 >=net-libs/libmicrohttpd-0.9.33:0=
36 ssl? ( >=net-libs/gnutls-3.1.4:0= )
37 )
38 introspection? ( >=dev-libs/gobject-introspection-1.31.1:0= )
39 kmod? ( >=sys-apps/kmod-15:0= )
40 lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] )
41 pam? ( virtual/pam:= )
42 python? ( ${PYTHON_DEPS} )
43 qrcode? ( media-gfx/qrencode:0= )
44 seccomp? ( sys-libs/libseccomp:0= )
45 selinux? ( sys-libs/libselinux:0= )
46 abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r9
47 !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
48
49 # baselayout-2.2 has /run
50 RDEPEND="${COMMON_DEPEND}
51 >=sys-apps/baselayout-2.2
52 || (
53 >=sys-apps/util-linux-2.22
54 <sys-apps/sysvinit-2.88-r4
55 )
56 !sys-auth/nss-myhostname
57 !<sys-libs/glibc-2.14
58 !sys-fs/udev"
59
60 # sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
61 PDEPEND=">=sys-apps/dbus-1.6.8-r1:0[systemd]
62 >=sys-apps/hwids-20130717-r1[udev]
63 >=sys-fs/udev-init-scripts-25
64 policykit? ( sys-auth/polkit )
65 !vanilla? ( sys-apps/gentoo-systemd-integration )"
66
67 # Newer linux-headers needed by ia64, bug #480218
68 DEPEND="${COMMON_DEPEND}
69 app-arch/xz-utils:0
70 dev-util/gperf
71 >=dev-util/intltool-0.50
72 >=sys-apps/coreutils-8.16
73 >=sys-devel/binutils-2.23.1
74 >=sys-devel/gcc-4.6
75 >=sys-kernel/linux-headers-${MINKV}
76 ia64? ( >=sys-kernel/linux-headers-3.9 )
77 virtual/pkgconfig
78 doc? ( >=dev-util/gtk-doc-1.18 )
79 python? ( dev-python/lxml[${PYTHON_USEDEP}] )
80 test? ( >=sys-apps/dbus-1.6.8-r1:0 )"
81
82 src_prepare() {
83 local PATCHES=(
84 "${FILESDIR}/${PV}-0001-always-check-for-__BYTE_ORDER-__BIG_ENDIAN-when-chec.patch"
85 "${FILESDIR}/${PV}-0002-endian-explicitly-include-endian.h-wherever-we-want-.patch"
86 "${FILESDIR}/${PV}-0003-udev-exclude-MD-from-block-device-ownership-event-lo.patch"
87 )
88
89 # Bug 463376
90 sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
91
92 # http://thread.gmane.org/gmane.comp.sysutils.systemd.devel/20815
93 touch src/core/org.freedesktop.systemd1.policy.in.in || die
94
95 # http://thread.gmane.org/gmane.comp.sysutils.systemd.devel/21074
96 touch units/emergency.service.in || die
97
98 autotools-utils_src_prepare
99 }
100
101 pkg_pretend() {
102 local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS ~DEVTMPFS ~DMIID
103 ~EPOLL ~FANOTIFY ~FHANDLE ~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS
104 ~SECCOMP ~SIGNALFD ~SYSFS ~TIMERFD ~TMPFS_XATTR ~DEVPTS_MULTIPLE_INSTANCES
105 ~!IDE ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2
106 ~!GRKERNSEC_PROC"
107
108 use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
109 kernel_is -lt 3 7 && CONFIG_CHECK+=" ~HOTPLUG"
110 use firmware-loader || CONFIG_CHECK+=" ~!FW_LOADER_USER_HELPER"
111
112 if linux_config_exists; then
113 local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
114 if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
115 ewarn "It's recommended to set an empty value to the following kernel config option:"
116 ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
117 fi
118 fi
119
120 if [[ ${MERGE_TYPE} != binary ]]; then
121 if [[ $(gcc-major-version) -lt 4
122 || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 6 ) ]]
123 then
124 eerror "systemd requires at least gcc 4.6 to build. Please switch the active"
125 eerror "gcc version using gcc-config."
126 die "systemd requires at least gcc 4.6"
127 fi
128 fi
129
130 if [[ ${MERGE_TYPE} != buildonly ]]; then
131 if kernel_is -lt ${MINKV//./ }; then
132 ewarn "Kernel version at least ${MINKV} required"
133 fi
134
135 if ! use firmware-loader && kernel_is -lt 3 8; then
136 ewarn "You seem to be using kernel older than 3.8. Those kernel versions"
137 ewarn "require systemd with USE=firmware-loader to support loading"
138 ewarn "firmware. Missing this flag may cause some hardware not to work."
139 fi
140
141 check_extra_config
142 fi
143 }
144
145 pkg_setup() {
146 use python && python-single-r1_pkg_setup
147 }
148
149 src_configure() {
150 # Keep using the one where the rules were installed.
151 MY_UDEVDIR=$(get_udevdir)
152 # Fix systems broken by bug #509454.
153 [[ ${MY_UDEVDIR} ]] || MY_UDEVDIR=/lib/udev
154
155 multilib-minimal_src_configure
156 }
157
158 multilib_native_enable() {
159 if multilib_is_native_abi; then
160 echo "--enable-${1}"
161 else
162 echo "--disable-${1}"
163 fi
164 }
165
166 multilib_src_configure() {
167 local myeconfargs=(
168 # disable -flto since it is an optimization flag
169 # and makes distcc less effective
170 cc_cv_CFLAGS__flto=no
171
172 # Workaround for bug 516346
173 --enable-dependency-tracking
174
175 --disable-maintainer-mode
176 --localstatedir=/var
177 --with-pamlibdir=$(getpam_mod_dir)
178 # avoid bash-completion dep
179 --with-bashcompletiondir="$(get_bashcompdir)"
180 # make sure we get /bin:/sbin in $PATH
181 --enable-split-usr
182 # disable sysv compatibility
183 --with-sysvinit-path=
184 --with-sysvrcnd-path=
185 # no deps
186 --enable-efi
187 --enable-ima
188
189 # Optional components/dependencies
190 $(multilib_native_use_enable acl)
191 $(multilib_native_use_enable audit)
192 $(multilib_native_use_enable cryptsetup libcryptsetup)
193 $(multilib_native_use_enable doc gtk-doc)
194 $(multilib_native_use_enable elfutils)
195 $(use_enable gcrypt)
196 $(use_enable gudev)
197 $(multilib_native_use_enable http microhttpd)
198 $(usex http $(multilib_native_use_enable ssl gnutls) --disable-gnutls)
199 $(multilib_native_use_enable introspection)
200 $(use_enable kdbus)
201 $(multilib_native_use_enable kmod)
202 $(use_enable lzma xz)
203 $(multilib_native_use_enable pam)
204 $(multilib_native_use_enable policykit polkit)
205 $(multilib_native_use_with python)
206 $(multilib_native_use_enable python python-devel)
207 $(multilib_native_use_enable qrcode qrencode)
208 $(multilib_native_use_enable seccomp)
209 $(multilib_native_use_enable selinux)
210 $(multilib_native_use_enable test tests)
211 $(multilib_native_use_enable test dbus)
212
213 # Disable optional binaries for non-native abis
214 $(multilib_native_enable backlight)
215 $(multilib_native_enable binfmt)
216 $(multilib_native_enable bootchart)
217 $(multilib_native_enable coredump)
218 $(multilib_native_enable hostnamed)
219 $(multilib_native_enable localed)
220 $(multilib_native_enable logind)
221 $(multilib_native_enable machined)
222 $(multilib_native_enable networkd)
223 $(multilib_native_enable quotacheck)
224 $(multilib_native_enable randomseed)
225 $(multilib_native_enable readahead)
226 $(multilib_native_enable resolved)
227 $(multilib_native_enable rfkill)
228 $(multilib_native_enable sysusers)
229 $(multilib_native_enable timedated)
230 $(multilib_native_enable timesyncd)
231 $(multilib_native_enable tmpfiles)
232 $(multilib_native_enable vconsole)
233
234 # not supported (avoid automagic deps in the future)
235 --disable-apparmor
236 --disable-chkconfig
237
238 # hardcode a few paths to spare some deps
239 QUOTAON=/usr/sbin/quotaon
240 QUOTACHECK=/usr/sbin/quotacheck
241
242 # dbus paths
243 --with-dbuspolicydir="${EPREFIX}/etc/dbus-1/system.d"
244 --with-dbussessionservicedir="${EPREFIX}/usr/share/dbus-1/services"
245 --with-dbussystemservicedir="${EPREFIX}/usr/share/dbus-1/system-services"
246 --with-dbusinterfacedir="${EPREFIX}/usr/share/dbus-1/interfaces"
247
248 --with-ntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
249 )
250
251 if use firmware-loader; then
252 myeconfargs+=(
253 --with-firmware-path="/lib/firmware/updates:/lib/firmware"
254 )
255 fi
256
257 # Added for testing; this is UNSUPPORTED by the Gentoo systemd team!
258 if [[ -n ${ROOTPREFIX+set} ]]; then
259 myeconfargs+=(
260 --with-rootprefix="${ROOTPREFIX}"
261 --with-rootlibdir="${ROOTPREFIX}/$(get_libdir)"
262 )
263 fi
264
265 if ! multilib_is_native_abi; then
266 myeconfargs+=(
267 ac_cv_search_cap_init=
268 ac_cv_header_sys_capability_h=yes
269 )
270 fi
271
272 # Work around bug 463846.
273 tc-export CC
274
275 autotools-utils_src_configure
276 }
277
278 multilib_src_compile() {
279 local mymakeopts=(
280 udevlibexecdir="${MY_UDEVDIR}"
281 )
282
283 if multilib_is_native_abi; then
284 emake "${mymakeopts[@]}"
285 else
286 # prerequisites for gudev
287 use gudev && emake src/gudev/gudev{enumtypes,marshal}.{c,h}
288
289 echo 'gentoo: $(BUILT_SOURCES)' | \
290 emake "${mymakeopts[@]}" -f Makefile -f - gentoo
291 echo 'gentoo: $(lib_LTLIBRARIES) $(pkgconfiglib_DATA)' | \
292 emake "${mymakeopts[@]}" -f Makefile -f - gentoo
293 fi
294 }
295
296 multilib_src_test() {
297 multilib_is_native_abi || continue
298
299 default
300 }
301
302 multilib_src_install() {
303 local mymakeopts=(
304 # automake fails with parallel libtool relinking
305 # https://bugs.gentoo.org/show_bug.cgi?id=491398
306 -j1
307
308 udevlibexecdir="${MY_UDEVDIR}"
309 dist_udevhwdb_DATA=
310 DESTDIR="${D}"
311 )
312
313 if multilib_is_native_abi; then
314 emake "${mymakeopts[@]}" install
315 else
316 mymakeopts+=(
317 install-libLTLIBRARIES
318 install-pkgconfiglibDATA
319 install-includeHEADERS
320 # safe to call unconditionally, 'installs' empty list
321 install-libgudev_includeHEADERS
322 install-pkgincludeHEADERS
323 )
324
325 emake "${mymakeopts[@]}"
326 fi
327
328 # install compat pkg-config files
329 local pcfiles=( src/compat-libs/libsystemd-{daemon,id128,journal,login}.pc )
330 emake "${mymakeopts[@]}" install-pkgconfiglibDATA \
331 pkgconfiglib_DATA="${pcfiles[*]}"
332
333 # Create symlinks for old libs
334 dosym libsystemd.so "/usr/$(get_libdir)/libsystemd-daemon.so"
335 dosym libsystemd.so "/usr/$(get_libdir)/libsystemd-id128.so"
336 dosym libsystemd.so "/usr/$(get_libdir)/libsystemd-journal.so"
337 dosym libsystemd.so "/usr/$(get_libdir)/libsystemd-login.so"
338 }
339
340 multilib_src_install_all() {
341 prune_libtool_files --modules
342 einstalldocs
343
344 # we just keep sysvinit tools, so no need for the mans
345 rm "${D}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \
346 || die
347 rm "${D}"/usr/share/man/man1/init.1 || die
348
349 # Disable storing coredumps in journald, bug #433457
350 mv "${D}"/usr/lib/sysctl.d/50-coredump.conf{,.disabled} || die
351
352 # Preserve empty dirs in /etc & /var, bug #437008
353 keepdir /etc/binfmt.d /etc/modules-load.d /etc/tmpfiles.d \
354 /etc/systemd/ntp-units.d /etc/systemd/user /var/lib/systemd
355
356 # Symlink /etc/sysctl.conf for easy migration.
357 dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf
358
359 # If we install these symlinks, there is no way for the sysadmin to remove them
360 # permanently.
361 rm -f "${D}"/etc/systemd/system/multi-user.target.wants/systemd-networkd.service
362 rm -f "${D}"/etc/systemd/system/multi-user.target.wants/systemd-resolved.service
363 rm -f "${D}"/etc/systemd/system/multi-user.target.wants/systemd-timesyncd.service
364 rm -rf "${D}"/etc/systemd/system/network-online.target.wants
365 }
366
367 migrate_locale() {
368 local envd_locale_def="${EROOT%/}/etc/env.d/02locale"
369 local envd_locale=( "${EROOT%/}"/etc/env.d/??locale )
370 local locale_conf="${EROOT%/}/etc/locale.conf"
371
372 if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
373 # If locale.conf does not exist...
374 if [[ -e ${envd_locale} ]]; then
375 # ...either copy env.d/??locale if there's one
376 ebegin "Moving ${envd_locale} to ${locale_conf}"
377 mv "${envd_locale}" "${locale_conf}"
378 eend ${?} || FAIL=1
379 else
380 # ...or create a dummy default
381 ebegin "Creating ${locale_conf}"
382 cat > "${locale_conf}" <<-EOF
383 # This file has been created by the sys-apps/systemd ebuild.
384 # See locale.conf(5) and localectl(1).
385
386 # LANG=${LANG}
387 EOF
388 eend ${?} || FAIL=1
389 fi
390 fi
391
392 if [[ ! -L ${envd_locale} ]]; then
393 # now, if env.d/??locale is not a symlink (to locale.conf)...
394 if [[ -e ${envd_locale} ]]; then
395 # ...warn the user that he has duplicate locale settings
396 ewarn
397 ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
398 ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
399 ewarn "and create the symlink with the following command:"
400 ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
401 ewarn
402 else
403 # ...or just create the symlink if there's nothing here
404 ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
405 ln -n -s ../locale.conf "${envd_locale_def}"
406 eend ${?} || FAIL=1
407 fi
408 fi
409 }
410
411 migrate_net_name_slot() {
412 # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null,
413 # do the same for 80-net-setup-link.rules to keep the old behavior
414 local net_move=no
415 local net_name_slot_sym=no
416 local net_rules_path="${EROOT%/}"/etc/udev/rules.d
417 local net_name_slot="${net_rules_path}"/80-net-name-slot.rules
418 local net_setup_link="${net_rules_path}"/80-net-setup-link.rules
419 if [[ -e ${net_setup_link} ]]; then
420 net_move=no
421 elif [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]]; then
422 net_move=yes
423 elif [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
424 net_move=yes
425 net_name_slot_sym=yes
426 fi
427 if [[ ${net_move} == yes ]]; then
428 ebegin "Copying ${net_name_slot} to ${net_setup_link}"
429
430 if [[ ${net_name_slot_sym} == yes ]]; then
431 ln -nfs /dev/null "${net_setup_link}"
432 else
433 cp "${net_name_slot}" "${net_setup_link}"
434 fi
435 eend $? || FAIL=1
436 fi
437 }
438
439 pkg_postinst() {
440 newusergroup() {
441 enewgroup "$1"
442 enewuser "$1" -1 -1 -1 "$1"
443 }
444
445 enewgroup input
446 enewgroup systemd-journal
447 newusergroup systemd-bus-proxy
448 newusergroup systemd-network
449 newusergroup systemd-resolve
450 newusergroup systemd-timesync
451 use http && newusergroup systemd-journal-gateway
452
453 systemd_update_catalog
454
455 # Keep this here in case the database format changes so it gets updated
456 # when required. Despite that this file is owned by sys-apps/hwids.
457 if has_version "sys-apps/hwids[udev]"; then
458 udevadm hwdb --update --root="${ROOT%/}"
459 fi
460
461 udev_reload || FAIL=1
462
463 # Bug 465468, make sure locales are respect, and ensure consistency
464 # between OpenRC & systemd
465 migrate_locale
466
467 # Migrate 80-net-name-slot.rules -> 80-net-setup-link.rules
468 migrate_net_name_slot
469
470 if [[ ${FAIL} ]]; then
471 eerror "One of the postinst commands failed. Please check the postinst output"
472 eerror "for errors. You may need to clean up your system and/or try installing"
473 eerror "systemd again."
474 eerror
475 fi
476
477 if [[ ! -L "${ROOT}"/etc/mtab ]]; then
478 ewarn "Upstream mandates the /etc/mtab file should be a symlink to /proc/mounts."
479 ewarn "Not having it is not supported by upstream and will cause tools like 'df'"
480 ewarn "and 'mount' to not work properly. Please run:"
481 ewarn " # ln -sf '${ROOT}proc/self/mounts' '${ROOT}etc/mtab'"
482 ewarn
483 fi
484
485 if [[ $(readlink "${ROOT}"/etc/resolv.conf) == */run/systemd/network/resolv.conf ]]; then
486 ewarn "resolv.conf is now generated by systemd-resolved. To use it, enable"
487 ewarn "systemd-resolved.service, and create a symlink from /etc/resolv.conf"
488 ewarn "to /run/systemd/resolve/resolv.conf"
489 ewarn
490 fi
491
492 if ! has_version sys-apps/systemd-ui; then
493 elog "To get additional features, a number of optional runtime dependencies may"
494 elog "be installed:"
495 elog "- sys-apps/systemd-ui: for GTK+ systemadm UI and gnome-ask-password-agent"
496 fi
497
498 if has_version sys-apps/openrc &&
499 ! has_version sys-fs/udev-init-scripts; then
500 elog "If you plan to boot using OpenRC and udev or eudev, you"
501 elog "need to install the udev-init-scripts package."
502 fi
503 }
504
505 pkg_prerm() {
506 # If removing systemd completely, remove the catalog database.
507 if [[ ! ${REPLACED_BY_VERSION} ]]; then
508 rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
509 fi
510 }

  ViewVC Help
Powered by ViewVC 1.1.20