Gentoo Archives: gentoo-commits

From: "William Hubbs (williamh)" <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-fs/udev: ChangeLog udev-187.ebuild udev-9999.ebuild
Date: Wed, 01 Aug 2012 17:13:58
Message-Id: 20120801171347.75C1D2004B@flycatcher.gentoo.org
1 williamh 12/08/01 17:13:47
2
3 Modified: ChangeLog udev-9999.ebuild
4 Added: udev-187.ebuild
5 Log:
6 version bump and sync live ebuild
7
8 (Portage version: 2.2.0_alpha120/cvs/Linux i686)
9
10 Revision Changes Path
11 1.701 sys-fs/udev/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/udev/ChangeLog?rev=1.701&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/udev/ChangeLog?rev=1.701&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/udev/ChangeLog?r1=1.700&r2=1.701
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v
20 retrieving revision 1.700
21 retrieving revision 1.701
22 diff -u -r1.700 -r1.701
23 --- ChangeLog 31 Jul 2012 04:43:38 -0000 1.700
24 +++ ChangeLog 1 Aug 2012 17:13:47 -0000 1.701
25 @@ -1,6 +1,12 @@
26 # ChangeLog for sys-fs/udev
27 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.700 2012/07/31 04:43:38 ssuominen Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.701 2012/08/01 17:13:47 williamh Exp $
30 +
31 +*udev-187 (01 Aug 2012)
32 +
33 + 01 Aug 2012; William Hubbs <williamh@g.o> +udev-187.ebuild,
34 + udev-9999.ebuild:
35 + version bump and sync live ebuild
36
37 31 Jul 2012; Samuli Suominen <ssuominen@g.o>
38 -files/move_tmp_persistent_rules-112-r1.sh, -files/136/udev.confd,
39
40
41
42 1.99 sys-fs/udev/udev-9999.ebuild
43
44 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/udev/udev-9999.ebuild?rev=1.99&view=markup
45 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/udev/udev-9999.ebuild?rev=1.99&content-type=text/plain
46 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/udev/udev-9999.ebuild?r1=1.98&r2=1.99
47
48 Index: udev-9999.ebuild
49 ===================================================================
50 RCS file: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-9999.ebuild,v
51 retrieving revision 1.98
52 retrieving revision 1.99
53 diff -u -r1.98 -r1.99
54 --- udev-9999.ebuild 4 May 2012 19:09:16 -0000 1.98
55 +++ udev-9999.ebuild 1 Aug 2012 17:13:47 -0000 1.99
56 @@ -1,74 +1,73 @@
57 # Copyright 1999-2012 Gentoo Foundation
58 # Distributed under the terms of the GNU General Public License v2
59 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-9999.ebuild,v 1.98 2012/05/04 19:09:16 jdhore Exp $
60 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-9999.ebuild,v 1.99 2012/08/01 17:13:47 williamh Exp $
61
62 EAPI=4
63
64 -KV_min=2.6.34
65 -# patchversion=1
66 -udev_rules_md5=ebc2cf422aa9e46cf7d9a555670412ba
67 +KV_min=2.6.39
68
69 -EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/hotplug/udev.git"
70 +inherit autotools eutils linux-info
71
72 -[[ ${PV} == 9999 ]] && vcs="git-2 autotools"
73 -inherit ${vcs} eutils flag-o-matic multilib toolchain-funcs linux-info systemd libtool
74 -
75 -if [[ ${PV} != 9999 ]]
76 +if [[ ${PV} = 9999* ]]
77 then
78 + EGIT_REPO_URI="git://anongit.freedesktop.org/systemd/systemd"
79 + inherit git-2
80 +else
81 + patchversion=1
82 + SRC_URI="http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz"
83 + if [[ -n "${patchversion}" ]]
84 + then
85 + SRC_URI="${SRC_URI}
86 + mirror://gentoo/${P}-patches-${patchversion}.tar.bz2"
87 + fi
88 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
89 - SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2"
90 - if [[ -n ${patchversion} ]]
91 - then
92 - patchset=${P}-patchset-${patchversion}
93 - SRC_URI="${SRC_URI} mirror://gentoo/${patchset}.tar.bz2"
94 - fi
95 fi
96
97 DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
98 -HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev/udev.html http://git.kernel.org/?p=linux/hotplug/udev.git;a=summary"
99 +HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
100
101 -LICENSE="GPL-2"
102 +LICENSE="LGPL-2.1 MIT GPL-2"
103 SLOT="0"
104 -IUSE="build selinux debug +rule_generator hwdb gudev introspection
105 - keymap floppy doc static-libs +openrc"
106 +IUSE="doc gudev hwdb introspection keymap +openrc selinux static-libs"
107 +
108 +RESTRICT="test"
109
110 -COMMON_DEPEND="selinux? ( sys-libs/libselinux )
111 - gudev? ( dev-libs/glib:2 )
112 +COMMON_DEPEND="gudev? ( dev-libs/glib:2 )
113 introspection? ( dev-libs/gobject-introspection )
114 + selinux? ( sys-libs/libselinux )
115 >=sys-apps/kmod-5
116 >=sys-apps/util-linux-2.20
117 !<sys-libs/glibc-2.10"
118
119 DEPEND="${COMMON_DEPEND}
120 - keymap? ( dev-util/gperf )
121 + dev-util/gperf
122 + >=dev-util/intltool-0.40.0
123 virtual/pkgconfig
124 virtual/os-headers
125 - !<sys-kernel/linux-headers-2.6.34"
126 + !<sys-kernel/linux-headers-${KV_min}
127 + doc? ( dev-util/gtk-doc )"
128
129 -if [[ $PV == 9999 ]]
130 +if [[ ${PV} = 9999* ]]
131 then
132 - RESTRICT="test? ( userpriv )"
133 - IUSE="${IUSE} test"
134 DEPEND="${DEPEND}
135 - dev-util/gtk-doc
136 - test? ( app-text/tree )"
137 -else
138 - DEPEND="${DEPEND}
139 - doc? ( dev-util/gtk-doc )"
140 + app-text/docbook-xsl-stylesheets
141 + dev-libs/libxslt"
142 fi
143
144 RDEPEND="${COMMON_DEPEND}
145 hwdb? ( sys-apps/hwids )
146 - openrc? ( >=sys-fs/udev-init-scripts-10
147 + openrc? ( >=sys-fs/udev-init-scripts-14
148 !<sys-apps/openrc-0.9.9 )
149 !sys-apps/coldplug
150 !<sys-fs/lvm2-2.02.45
151 !sys-fs/device-mapper
152 - !<sys-fs/udev-init-scripts-10
153 + !<sys-fs/udev-init-scripts-14
154 !<sys-kernel/dracut-017-r1
155 !<sys-kernel/genkernel-3.4.25"
156
157 -udev_check_KV()
158 +S="${WORKDIR}/systemd-${PV}"
159 +
160 +check_KV()
161 {
162 if kernel_is lt ${KV_min//./ }
163 then
164 @@ -77,43 +76,52 @@
165 return 0
166 }
167
168 +check_default_rules()
169 +{
170 + # Make sure there are no sudden changes to upstream rules file
171 + # (more for my own needs than anything else ...)
172 + local udev_rules_md5=18843fc4a8dd1d8074b98a583454cb9e
173 + MD5=$(md5sum < "${S}/rules/50-udev-default.rules")
174 + MD5=${MD5/ -/}
175 + if [[ ${MD5} != ${udev_rules_md5} ]]
176 + then
177 + eerror "50-udev-default.rules has been updated, please validate!"
178 + eerror "md5sum: ${MD5}"
179 + die "50-udev-default.rules has been updated, please validate!"
180 + fi
181 +}
182 +
183 pkg_setup()
184 {
185 # required kernel options
186 - CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~HOTPLUG ~INOTIFY_USER ~NET ~PROC_FS
187 - ~SIGNALFD ~SYSFS
188 - ~!IDE ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2"
189 + CONFIG_CHECK="~DEVTMPFS"
190 + ERROR_DEVTMPFS="DEVTMPFS is not set in this kernel. Udev will not run."
191
192 linux-info_pkg_setup
193
194 - # always print kernel version requirements
195 - ewarn
196 - ewarn "${P} does not support Linux kernel before version ${KV_min}!"
197 -
198 - if ! udev_check_KV
199 + if ! check_KV
200 then
201 eerror "Your kernel version (${KV_FULL}) is too old to run ${P}"
202 + eerror "It must be at least ${KV_min}!"
203 fi
204
205 KV_FULL_SRC=${KV_FULL}
206 get_running_version
207 - if ! udev_check_KV
208 + if ! check_KV
209 then
210 eerror
211 - eerror "udev cannot be restarted after emerging,"
212 - eerror "as your running kernel version (${KV_FULL}) is too old."
213 - eerror "You really need to use a newer kernel after a reboot!"
214 - NO_RESTART=1
215 + eerror "Your running kernel version (${KV_FULL}) is too old"
216 + eerror "for this version of udev."
217 + eerror "You must upgrade your kernel or downgrade udev."
218 fi
219 }
220
221 src_prepare()
222 {
223 # backport some patches
224 - if [[ -n ${patchset} ]]
225 + if [[ -n "${patchversion}" ]]
226 then
227 - EPATCH_SOURCE="${WORKDIR}"/${patchset} EPATCH_SUFFIX=patch \
228 - EPATCH_FORCE=yes epatch
229 + EPATCH_SUFFIX=patch EPATCH_FORCE=yes epatch
230 fi
231
232 # change rules back to group uucp instead of dialout for now
233 @@ -121,121 +129,181 @@
234 -i rules/*.rules \
235 || die "failed to change group dialout to uucp"
236
237 - if [[ ! -e configure ]]
238 + if [ ! -e configure ]
239 then
240 - gtkdocize --copy || die "gtkdocize failed"
241 - eautoreconf
242 - else
243 - # Make sure there are no sudden changes to upstream rules file
244 - # (more for my own needs than anything else ...)
245 - MD5=$(md5sum < "${S}/rules/50-udev-default.rules")
246 - MD5=${MD5/ -/}
247 - if [[ ${MD5} != ${udev_rules_md5} ]]
248 + if use doc
249 then
250 - eerror "50-udev-default.rules has been updated, please validate!"
251 - eerror "md5sum: ${MD5}"
252 - die "50-udev-default.rules has been updated, please validate!"
253 + gtkdocize --docdir docs || die "gtkdocize failed"
254 + else
255 + echo 'EXTRA_DIST =' > docs/gtk-doc.make
256 fi
257 + eautoreconf
258 + else
259 + check_default_rules
260 elibtoolize
261 fi
262 }
263
264 src_configure()
265 {
266 - filter-flags -fprefetch-loop-arrays
267 - econf \
268 - --libexecdir=/lib \
269 - --libdir=/usr/$(get_libdir) \
270 - --docdir=/usr/share/doc/${PF} \
271 - $(use_enable static-libs static) \
272 - $(use_enable doc gtk-doc) \
273 - $(use_enable debug) \
274 - $(use_enable gudev) \
275 - $(use_enable introspection) \
276 - $(use_enable keymap) \
277 - $(use_enable rule_generator) \
278 - $(use_enable floppy) \
279 - --with-html-dir=/usr/share/doc/${PF}/html \
280 - --with-rootprefix=/ \
281 - $(use_with selinux) \
282 - --with-usb-ids-path=/usr/share/misc/usb.ids \
283 - --with-pci-ids-path=/usr/share/misc/pci.ids \
284 - "$(systemd_with_unitdir)"
285 + local econf_args
286 +
287 + econf_args=(
288 + ac_cv_search_cap_init=
289 + ac_cv_header_sys_capability_h=yes
290 + DBUS_CFLAGS=' '
291 + DBUS_LIBS=' '
292 + --docdir=/usr/share/doc/${PF}
293 + --libdir=/usr/$(get_libdir)
294 + --libexecdir=/usr/lib
295 + --with-distro=gentoo
296 + --with-html-dir=/usr/share/doc/${PF}/html
297 + --with-pci-ids-path=/usr/share/misc/pci.ids
298 + --with-usb-ids-path=/usr/share/misc/usb.ids
299 + --with-rootprefix=/usr
300 + --with-rootlibdir=/usr/$(get_libdir)
301 + --disable-acl
302 + --disable-audit
303 + --disable-coredump
304 + --disable-hostnamed
305 + --disable-ima
306 + --disable-libcryptsetup
307 + --disable-localed
308 + --disable-logind
309 + --disable-nls
310 + --disable-pam
311 + --disable-quotacheck
312 + --disable-readahead
313 + --enable-split-usr
314 + --disable-tcpwrap
315 + --disable-timedated
316 + --disable-xz
317 + $(use_enable doc gtk-doc)
318 + $(use_enable gudev)
319 + $(use_enable introspection)
320 + $(use_enable keymap)
321 + $(use_enable selinux)
322 + $(use_enable static-libs static)
323 + )
324 + econf "${econf_args[@]}"
325 }
326
327 -src_install()
328 +src_compile()
329 {
330 - emake DESTDIR="${D}" install
331 -
332 - find "${D}" -type f -name '*.la' -exec rm -f {} +
333 + echo 'BUILT_SOURCES: $(BUILT_SOURCES)' > "${T}"/Makefile.extra
334 + emake -f Makefile -f "${T}"/Makefile.extra BUILT_SOURCES
335 + local targets=(
336 + systemd-udevd
337 + udevadm
338 + libudev.la
339 + ata_id
340 + cdrom_id
341 + collect
342 + scsi_id
343 + v4l_id
344 + accelerometer
345 + mtd_probe
346 + man/udev.7
347 + man/udevadm.8
348 + man/systemd-udevd.8
349 + man/systemd-udevd.service.8
350 + )
351 + use keymap && targets+=( keymap )
352 + use gudev && targets+=( libgudev-1.0.la )
353
354 - dodoc ChangeLog NEWS README TODO
355 - use keymap && dodoc src/keymap/README.keymap.txt
356 + emake "${targets[@]}"
357 + if use doc
358 + then
359 + emake -C docs/libudev
360 + use gudev && emake -C docs/gudev
361 + fi
362 +}
363
364 - # udevadm is now in /usr/bin.
365 - dosym /usr/bin/udevadm /sbin/udevadm
366 +src_install()
367 +{
368 + local lib_LTLIBRARIES=libudev.la \
369 + pkgconfiglib_DATA=src/libudev/libudev.pc
370
371 - # create symlinks for these utilities to /sbin
372 - # where multipath-tools expect them to be (Bug #168588)
373 - dosym /lib/udev/scsi_id /sbin/scsi_id
374 + local targets=(
375 + install-libLTLIBRARIES
376 + install-includeHEADERS
377 + install-libgudev_includeHEADERS
378 + install-binPROGRAMS
379 + install-rootlibexecPROGRAMS
380 + install-udevlibexecPROGRAMS
381 + install-dist_systemunitDATA
382 + install-dist_udevconfDATA
383 + install-dist_udevhomeSCRIPTS
384 + install-dist_udevkeymapDATA
385 + install-dist_udevkeymapforcerelDATA
386 + install-dist_udevrulesDATA
387 + install-girDATA
388 + install-man7
389 + install-man8
390 + install-nodist_systemunitDATA
391 + install-pkgconfiglibDATA
392 + install-sharepkgconfigDATA
393 + install-typelibsDATA
394 + install-dist_docDATA
395 + udev-confdirs
396 + systemd-install-hook
397 + )
398 +
399 + if use gudev
400 + then
401 + lib_LTLIBRARIES+=" libgudev-1.0.la"
402 + pkgconfiglib_DATA+=" src/gudev/gudev-1.0.pc"
403 + fi
404 +
405 + # add final values of variables:
406 + targets+=(
407 + rootlibexec_PROGRAMS=systemd-udevd
408 + bin_PROGRAMS=udevadm
409 + lib_LTLIBRARIES="${lib_LTLIBRARIES}"
410 + MANPAGES="man/udev.7 man/udevadm.8 man/systemd-udevd.service.8"
411 + MANPAGES_ALIAS="man/systemd-udevd.8"
412 + dist_systemunit_DATA="units/systemd-udevd-control.socket \
413 + units/systemd-udevd-kernel.socket"
414 + nodist_systemunit_DATA="units/systemd-udevd.service \
415 + units/systemd-udev-trigger.service \
416 + units/systemd-udev-settle.service"
417 + pkgconfiglib_DATA="${pkgconfiglib_DATA}"
418 + )
419 + emake DESTDIR="${D}" "${targets[@]}"
420 + if use doc
421 + then
422 + emake -C docs/libudev DESTDIR="${D}" install
423 + use gudev && emake -C docs/gudev DESTDIR="${D}" install
424 + fi
425 + dodoc TODO
426 +
427 + prune_libtool_files --all
428 + rm -f "${D}"/usr/lib/udev/rules.d/99-systemd.rules
429 + rm -rf "${D}"/usr/share/doc/${PF}/LICENSE.*
430
431 - # Now install rules
432 - insinto /lib/udev/rules.d
433 + # install gentoo-specific rules
434 + insinto /usr/lib/udev/rules.d
435 doins "${FILESDIR}"/40-gentoo.rules
436 +
437 + # install udevadm symlink
438 + dosym ../usr/bin/udevadm /sbin/udevadm
439 }
440
441 pkg_preinst()
442 {
443 local htmldir
444 for htmldir in gudev libudev; do
445 - if [[ -d ${ROOT}usr/share/gtk-doc/html/${htmldir} ]]; then
446 + if [[ -d ${ROOT}usr/share/gtk-doc/html/${htmldir} ]]
447 + then
448 rm -rf "${ROOT}"usr/share/gtk-doc/html/${htmldir}
449 fi
450 - if [[ -d ${D}/usr/share/doc/${PF}/html/${htmldir} ]]; then
451 - dosym /usr/share/doc/${PF}/html/${htmldir} \
452 + if [[ -d ${D}/usr/share/doc/${PF}/html/${htmldir} ]]
453 + then
454 + dosym ../../doc/${PF}/html/${htmldir} \
455 /usr/share/gtk-doc/html/${htmldir}
456 fi
457 done
458 -}
459 -
460 -# See Bug #129204 for a discussion about restarting udevd
461 -restart_udevd()
462 -{
463 - if [[ ${NO_RESTART} = 1 ]]
464 - then
465 - ewarn "Not restarting udevd, as your kernel is too old!"
466 - return
467 - fi
468 -
469 - # need to merge to our system
470 - [[ ${ROOT} = / ]] || return
471 -
472 - # check if root of init-process is identical to ours (not in chroot)
473 - [[ -r /proc/1/root && /proc/1/root/ -ef /proc/self/root/ ]] || return
474 -
475 - # abort if there is no udevd running
476 - [[ -n $(pidof udevd) ]] || return
477 -
478 - # abort if no /run/udev exists
479 - [[ -e /run/udev ]] || return
480 -
481 - elog
482 - elog "restarting udevd now."
483 -
484 - killall -15 udevd &>/dev/null
485 - sleep 1
486 - killall -9 udevd &>/dev/null
487 -
488 - /lib/udev/udevd --daemon
489 - sleep 3
490 - if [[ ! -n $(pidof udevd) ]]
491 - then
492 - eerror "FATAL: udev died, please check your kernel is"
493 - eerror "new enough and configured correctly for ${P}."
494 - eerror
495 - eerror "Please have a look at this before rebooting."
496 - eerror "If in doubt, please downgrade udev back to your old version"
497 - fi
498 + preserve_old_lib libudev.so.0
499 }
500
501 # This function determines if a directory is a mount point.
502 @@ -261,8 +329,6 @@
503 ewarn "else losetup may be confused when looking for unused devices."
504 fi
505
506 - restart_udevd
507 -
508 # people want reminders, I'll give them reminders. Odds are they will
509 # just ignore them anyway...
510
511 @@ -275,19 +341,9 @@
512 einfo "Removed unneeded file 64-device-mapper.rules"
513 fi
514
515 - # requested in Bug #225033:
516 - elog
517 - elog "persistent-net assigns fixed names to network devices."
518 - elog "If you have problems with the persistent-net rules,"
519 - elog "just delete the rules file"
520 - elog "\trm ${ROOT}etc/udev/rules.d/70-persistent-net.rules"
521 - elog "then reboot."
522 - elog
523 - elog "This may however number your devices in a different way than they are now."
524 -
525 ewarn
526 ewarn "If you build an initramfs including udev, then please"
527 - ewarn "make sure that the /usr/bin/udevadm binary gets included,"
528 + ewarn "make sure the /usr/bin/udevadm binary gets included,"
529 ewarn "and your scripts changed to use it,as it replaces the"
530 ewarn "old helper apps udevinfo, udevtrigger, ..."
531
532 @@ -314,11 +370,28 @@
533 ewarn "experience failures which are very difficult to troubleshoot."
534 ewarn "For a more detailed explanation, see the following URL:"
535 ewarn "http://www.freedesktop.org/wiki/Software/systemd/separate-usr-is-broken"
536 + ewarn
537 + ewarn "For more information on setting up an initramfs, see the"
538 + ewarn "following URL:"
539 + ewarn "http://www.gentoo.org/doc/en/initramfs-guide.xml"
540 fi
541
542 ewarn
543 - ewarn "The udev-acl functionality has been removed from udev."
544 - ewarn "This functionality will appear in a future version of consolekit."
545 + ewarn "The udev-acl functionality has been removed from standalone udev."
546 + ewarn "If you are using standalone udev, consolekithandles this"
547 + ewarn "functionality."
548 +
549 + ewarn
550 + ewarn "You need to restart udev as soon as possible to make the upgrade go"
551 + ewarn "into affect."
552 + ewarn "The method you use to do this depends on your init system."
553 +
554 + ewarn
555 + ewarn "Upstream has removed the persistent-net and persistent-cd rules"
556 + ewarn "generator. If you need persistent names for these devices,"
557 + ewarn "place udev rules for them in ${ROOT}etc/udev/rules.d."
558 +
559 + preserve_old_lib_notify libudev.so.0
560
561 elog
562 elog "For more information on udev on Gentoo, writing udev rules, and"
563
564
565
566 1.1 sys-fs/udev/udev-187.ebuild
567
568 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/udev/udev-187.ebuild?rev=1.1&view=markup
569 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/udev/udev-187.ebuild?rev=1.1&content-type=text/plain
570
571 Index: udev-187.ebuild
572 ===================================================================
573 # Copyright 1999-2012 Gentoo Foundation
574 # Distributed under the terms of the GNU General Public License v2
575 # $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-187.ebuild,v 1.1 2012/08/01 17:13:47 williamh Exp $
576
577 EAPI=4
578
579 KV_min=2.6.39
580
581 inherit autotools eutils linux-info
582
583 if [[ ${PV} = 9999* ]]
584 then
585 EGIT_REPO_URI="git://anongit.freedesktop.org/systemd/systemd"
586 inherit git-2
587 else
588 patchversion=1
589 SRC_URI="http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz"
590 if [[ -n "${patchversion}" ]]
591 then
592 SRC_URI="${SRC_URI}
593 mirror://gentoo/${P}-patches-${patchversion}.tar.bz2"
594 fi
595 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
596 fi
597
598 DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
599 HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
600
601 LICENSE="LGPL-2.1 MIT GPL-2"
602 SLOT="0"
603 IUSE="doc gudev hwdb introspection keymap +openrc selinux static-libs"
604
605 RESTRICT="test"
606
607 COMMON_DEPEND="gudev? ( dev-libs/glib:2 )
608 introspection? ( dev-libs/gobject-introspection )
609 selinux? ( sys-libs/libselinux )
610 >=sys-apps/kmod-5
611 >=sys-apps/util-linux-2.20
612 !<sys-libs/glibc-2.10"
613
614 DEPEND="${COMMON_DEPEND}
615 dev-util/gperf
616 >=dev-util/intltool-0.40.0
617 virtual/pkgconfig
618 virtual/os-headers
619 !<sys-kernel/linux-headers-${KV_min}
620 doc? ( dev-util/gtk-doc )"
621
622 if [[ ${PV} = 9999* ]]
623 then
624 DEPEND="${DEPEND}
625 app-text/docbook-xsl-stylesheets
626 dev-libs/libxslt"
627 fi
628
629 RDEPEND="${COMMON_DEPEND}
630 hwdb? ( sys-apps/hwids )
631 openrc? ( >=sys-fs/udev-init-scripts-14
632 !<sys-apps/openrc-0.9.9 )
633 !sys-apps/coldplug
634 !<sys-fs/lvm2-2.02.45
635 !sys-fs/device-mapper
636 !<sys-fs/udev-init-scripts-14
637 !<sys-kernel/dracut-017-r1
638 !<sys-kernel/genkernel-3.4.25"
639
640 S="${WORKDIR}/systemd-${PV}"
641
642 check_KV()
643 {
644 if kernel_is lt ${KV_min//./ }
645 then
646 return 1
647 fi
648 return 0
649 }
650
651 check_default_rules()
652 {
653 # Make sure there are no sudden changes to upstream rules file
654 # (more for my own needs than anything else ...)
655 local udev_rules_md5=18843fc4a8dd1d8074b98a583454cb9e
656 MD5=$(md5sum < "${S}/rules/50-udev-default.rules")
657 MD5=${MD5/ -/}
658 if [[ ${MD5} != ${udev_rules_md5} ]]
659 then
660 eerror "50-udev-default.rules has been updated, please validate!"
661 eerror "md5sum: ${MD5}"
662 die "50-udev-default.rules has been updated, please validate!"
663 fi
664 }
665
666 pkg_setup()
667 {
668 # required kernel options
669 CONFIG_CHECK="~DEVTMPFS"
670 ERROR_DEVTMPFS="DEVTMPFS is not set in this kernel. Udev will not run."
671
672 linux-info_pkg_setup
673
674 if ! check_KV
675 then
676 eerror "Your kernel version (${KV_FULL}) is too old to run ${P}"
677 eerror "It must be at least ${KV_min}!"
678 fi
679
680 KV_FULL_SRC=${KV_FULL}
681 get_running_version
682 if ! check_KV
683 then
684 eerror
685 eerror "Your running kernel version (${KV_FULL}) is too old"
686 eerror "for this version of udev."
687 eerror "You must upgrade your kernel or downgrade udev."
688 fi
689 }
690
691 src_prepare()
692 {
693 # backport some patches
694 if [[ -n "${patchversion}" ]]
695 then
696 EPATCH_SUFFIX=patch EPATCH_FORCE=yes epatch
697 fi
698
699 # change rules back to group uucp instead of dialout for now
700 sed -e 's/GROUP="dialout"/GROUP="uucp"/' \
701 -i rules/*.rules \
702 || die "failed to change group dialout to uucp"
703
704 if [ ! -e configure ]
705 then
706 if use doc
707 then
708 gtkdocize --docdir docs || die "gtkdocize failed"
709 else
710 echo 'EXTRA_DIST =' > docs/gtk-doc.make
711 fi
712 eautoreconf
713 else
714 check_default_rules
715 elibtoolize
716 fi
717 }
718
719 src_configure()
720 {
721 local econf_args
722
723 econf_args=(
724 ac_cv_search_cap_init=
725 ac_cv_header_sys_capability_h=yes
726 DBUS_CFLAGS=' '
727 DBUS_LIBS=' '
728 --docdir=/usr/share/doc/${PF}
729 --libdir=/usr/$(get_libdir)
730 --libexecdir=/usr/lib
731 --with-distro=gentoo
732 --with-html-dir=/usr/share/doc/${PF}/html
733 --with-pci-ids-path=/usr/share/misc/pci.ids
734 --with-usb-ids-path=/usr/share/misc/usb.ids
735 --with-rootprefix=/usr
736 --with-rootlibdir=/usr/$(get_libdir)
737 --disable-acl
738 --disable-audit
739 --disable-coredump
740 --disable-hostnamed
741 --disable-ima
742 --disable-libcryptsetup
743 --disable-localed
744 --disable-logind
745 --disable-nls
746 --disable-pam
747 --disable-quotacheck
748 --disable-readahead
749 --enable-split-usr
750 --disable-tcpwrap
751 --disable-timedated
752 --disable-xz
753 $(use_enable doc gtk-doc)
754 $(use_enable gudev)
755 $(use_enable introspection)
756 $(use_enable keymap)
757 $(use_enable selinux)
758 $(use_enable static-libs static)
759 )
760 econf "${econf_args[@]}"
761 }
762
763 src_compile()
764 {
765 echo 'BUILT_SOURCES: $(BUILT_SOURCES)' > "${T}"/Makefile.extra
766 emake -f Makefile -f "${T}"/Makefile.extra BUILT_SOURCES
767 local targets=(
768 systemd-udevd
769 udevadm
770 libudev.la
771 ata_id
772 cdrom_id
773 collect
774 scsi_id
775 v4l_id
776 accelerometer
777 mtd_probe
778 man/udev.7
779 man/udevadm.8
780 man/systemd-udevd.8
781 man/systemd-udevd.service.8
782 )
783 use keymap && targets+=( keymap )
784 use gudev && targets+=( libgudev-1.0.la )
785
786 emake "${targets[@]}"
787 if use doc
788 then
789 emake -C docs/libudev
790 use gudev && emake -C docs/gudev
791 fi
792 }
793
794 src_install()
795 {
796 local lib_LTLIBRARIES=libudev.la \
797 pkgconfiglib_DATA=src/libudev/libudev.pc
798
799 local targets=(
800 install-libLTLIBRARIES
801 install-includeHEADERS
802 install-libgudev_includeHEADERS
803 install-binPROGRAMS
804 install-rootlibexecPROGRAMS
805 install-udevlibexecPROGRAMS
806 install-dist_systemunitDATA
807 install-dist_udevconfDATA
808 install-dist_udevhomeSCRIPTS
809 install-dist_udevkeymapDATA
810 install-dist_udevkeymapforcerelDATA
811 install-dist_udevrulesDATA
812 install-girDATA
813 install-man7
814 install-man8
815 install-nodist_systemunitDATA
816 install-pkgconfiglibDATA
817 install-sharepkgconfigDATA
818 install-typelibsDATA
819 install-dist_docDATA
820 udev-confdirs
821 systemd-install-hook
822 )
823
824 if use gudev
825 then
826 lib_LTLIBRARIES+=" libgudev-1.0.la"
827 pkgconfiglib_DATA+=" src/gudev/gudev-1.0.pc"
828 fi
829
830 # add final values of variables:
831 targets+=(
832 rootlibexec_PROGRAMS=systemd-udevd
833 bin_PROGRAMS=udevadm
834 lib_LTLIBRARIES="${lib_LTLIBRARIES}"
835 MANPAGES="man/udev.7 man/udevadm.8 man/systemd-udevd.service.8"
836 MANPAGES_ALIAS="man/systemd-udevd.8"
837 dist_systemunit_DATA="units/systemd-udevd-control.socket \
838 units/systemd-udevd-kernel.socket"
839 nodist_systemunit_DATA="units/systemd-udevd.service \
840 units/systemd-udev-trigger.service \
841 units/systemd-udev-settle.service"
842 pkgconfiglib_DATA="${pkgconfiglib_DATA}"
843 )
844 emake DESTDIR="${D}" "${targets[@]}"
845 if use doc
846 then
847 emake -C docs/libudev DESTDIR="${D}" install
848 use gudev && emake -C docs/gudev DESTDIR="${D}" install
849 fi
850 dodoc TODO
851
852 prune_libtool_files --all
853 rm -f "${D}"/usr/lib/udev/rules.d/99-systemd.rules
854 rm -rf "${D}"/usr/share/doc/${PF}/LICENSE.*
855
856 # install gentoo-specific rules
857 insinto /usr/lib/udev/rules.d
858 doins "${FILESDIR}"/40-gentoo.rules
859
860 # install udevadm symlink
861 dosym ../usr/bin/udevadm /sbin/udevadm
862 }
863
864 pkg_preinst()
865 {
866 local htmldir
867 for htmldir in gudev libudev; do
868 if [[ -d ${ROOT}usr/share/gtk-doc/html/${htmldir} ]]
869 then
870 rm -rf "${ROOT}"usr/share/gtk-doc/html/${htmldir}
871 fi
872 if [[ -d ${D}/usr/share/doc/${PF}/html/${htmldir} ]]
873 then
874 dosym ../../doc/${PF}/html/${htmldir} \
875 /usr/share/gtk-doc/html/${htmldir}
876 fi
877 done
878 preserve_old_lib libudev.so.0
879 }
880
881 # This function determines if a directory is a mount point.
882 # It was lifted from dracut.
883 ismounted()
884 {
885 while read a m a; do
886 [[ $m = $1 ]] && return 0
887 done < "${ROOT}"/proc/mounts
888 return 1
889 }
890
891 pkg_postinst()
892 {
893 mkdir -p "${ROOT}"/run
894
895 # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
896 # So try to remove it here (will only work if empty).
897 rmdir "${ROOT}"/dev/loop 2>/dev/null
898 if [[ -d ${ROOT}/dev/loop ]]
899 then
900 ewarn "Please make sure your remove /dev/loop,"
901 ewarn "else losetup may be confused when looking for unused devices."
902 fi
903
904 # people want reminders, I'll give them reminders. Odds are they will
905 # just ignore them anyway...
906
907 # 64-device-mapper.rules now gets installed by sys-fs/device-mapper
908 # remove it if user don't has sys-fs/device-mapper installed, 27 Jun 2007
909 if [[ -f ${ROOT}/etc/udev/rules.d/64-device-mapper.rules ]] &&
910 ! has_version sys-fs/device-mapper
911 then
912 rm -f "${ROOT}"/etc/udev/rules.d/64-device-mapper.rules
913 einfo "Removed unneeded file 64-device-mapper.rules"
914 fi
915
916 ewarn
917 ewarn "If you build an initramfs including udev, then please"
918 ewarn "make sure the /usr/bin/udevadm binary gets included,"
919 ewarn "and your scripts changed to use it,as it replaces the"
920 ewarn "old helper apps udevinfo, udevtrigger, ..."
921
922 ewarn
923 ewarn "mount options for directory /dev are no longer"
924 ewarn "set in /etc/udev/udev.conf, but in /etc/fstab"
925 ewarn "as for other directories."
926
927 ewarn
928 ewarn "Rules for /dev/hd* devices have been removed"
929 ewarn "Please migrate to libata."
930
931 ewarn
932 ewarn "action_modeswitch has been removed by upstream."
933 ewarn "Please use sys-apps/usb_modeswitch."
934
935 if ismounted /usr
936 then
937 ewarn
938 ewarn "Your system has /usr on a separate partition. This means"
939 ewarn "you will need to use an initramfs to pre-mount /usr before"
940 ewarn "udev runs."
941 ewarn "This must be set up before your next reboot, or you may"
942 ewarn "experience failures which are very difficult to troubleshoot."
943 ewarn "For a more detailed explanation, see the following URL:"
944 ewarn "http://www.freedesktop.org/wiki/Software/systemd/separate-usr-is-broken"
945 ewarn
946 ewarn "For more information on setting up an initramfs, see the"
947 ewarn "following URL:"
948 ewarn "http://www.gentoo.org/doc/en/initramfs-guide.xml"
949 fi
950
951 ewarn
952 ewarn "The udev-acl functionality has been removed from standalone udev."
953 ewarn "If you are using standalone udev, consolekithandles this"
954 ewarn "functionality."
955
956 ewarn
957 ewarn "You need to restart udev as soon as possible to make the upgrade go"
958 ewarn "into affect."
959 ewarn "The method you use to do this depends on your init system."
960
961 ewarn
962 ewarn "Upstream has removed the persistent-net and persistent-cd rules"
963 ewarn "generator. If you need persistent names for these devices,"
964 ewarn "place udev rules for them in ${ROOT}etc/udev/rules.d."
965
966 preserve_old_lib_notify libudev.so.0
967
968 elog
969 elog "For more information on udev on Gentoo, writing udev rules, and"
970 elog " fixing known issues visit:"
971 elog " http://www.gentoo.org/doc/en/udev-guide.xml"
972 }