/[gentoo-x86]/sys-fs/udev/udev-191.ebuild
Gentoo

Contents of /sys-fs/udev/udev-191.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Sat Dec 1 14:46:46 2012 UTC (6 years ago) by williamh
Branch: MAIN
Changes since 1.2: +0 -0 lines
restore old versions so we do not break systemd

(Portage version: 2.2.0_alpha143/cvs/Linux i686, signed Manifest commit with key 0x30C46538)

1 williamh 1.1 # Copyright 1999-2012 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 williamh 1.2 # $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-191.ebuild,v 1.1 2012/09/22 15:21:42 williamh Exp $
4 williamh 1.1
5     EAPI=4
6    
7     KV_min=2.6.39
8    
9     inherit autotools eutils linux-info
10    
11     if [[ ${PV} = 9999* ]]
12     then
13     EGIT_REPO_URI="git://anongit.freedesktop.org/systemd/systemd"
14     inherit git-2
15     else
16     patchset=1
17     SRC_URI="http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz"
18     if [[ -n "${patchset}" ]]
19     then
20     SRC_URI="${SRC_URI}
21     http://dev.gentoo.org/~williamh/dist/${P}-patches-${patchset}.tar.bz2"
22     fi
23     KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
24     fi
25    
26     DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
27     HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
28    
29     LICENSE="LGPL-2.1 MIT GPL-2"
30     SLOT="0"
31     IUSE="acl doc gudev hwdb introspection keymap +openrc selinux static-libs"
32    
33     RESTRICT="test"
34    
35     COMMON_DEPEND="acl? ( sys-apps/acl )
36     gudev? ( dev-libs/glib:2 )
37     introspection? ( >=dev-libs/gobject-introspection-1.31.1 )
38     selinux? ( sys-libs/libselinux )
39     >=sys-apps/kmod-5
40     >=sys-apps/util-linux-2.20
41     !<sys-libs/glibc-2.11"
42    
43     DEPEND="${COMMON_DEPEND}
44     dev-util/gperf
45     >=dev-util/intltool-0.40.0
46     virtual/pkgconfig
47     virtual/os-headers
48     !<sys-kernel/linux-headers-${KV_min}
49     doc? ( dev-util/gtk-doc )"
50    
51     if [[ ${PV} = 9999* ]]
52     then
53     DEPEND="${DEPEND}
54     app-text/docbook-xsl-stylesheets
55     dev-libs/libxslt"
56     fi
57    
58     RDEPEND="${COMMON_DEPEND}
59     hwdb? ( sys-apps/hwids )
60     openrc? ( >=sys-fs/udev-init-scripts-16
61     !<sys-apps/openrc-0.9.9 )
62     !sys-apps/coldplug
63     !=sys-apps/systemd-188
64     !<sys-fs/lvm2-2.02.45
65     !sys-fs/device-mapper
66     !<sys-fs/udev-init-scripts-16
67     !<sys-kernel/dracut-017-r1
68     !<sys-kernel/genkernel-3.4.25"
69    
70     S="${WORKDIR}/systemd-${PV}"
71    
72     udev_check_KV()
73     {
74     if kernel_is lt ${KV_min//./ }
75     then
76     return 1
77     fi
78     return 0
79     }
80    
81     check_default_rules()
82     {
83     # Make sure there are no sudden changes to upstream rules file
84     # (more for my own needs than anything else ...)
85     local udev_rules_md5=18843fc4a8dd1d8074b98a583454cb9e
86     MD5=$(md5sum < "${S}/rules/50-udev-default.rules")
87     MD5=${MD5/ -/}
88     if [[ ${MD5} != ${udev_rules_md5} ]]
89     then
90     eerror "50-udev-default.rules has been updated, please validate!"
91     eerror "md5sum: ${MD5}"
92     die "50-udev-default.rules has been updated, please validate!"
93     fi
94     }
95    
96     pkg_setup()
97     {
98     # required kernel options
99     CONFIG_CHECK="~DEVTMPFS"
100     ERROR_DEVTMPFS="DEVTMPFS is not set in this kernel. Udev will not run."
101    
102     linux-info_pkg_setup
103    
104     if ! udev_check_KV
105     then
106     eerror "Your kernel version (${KV_FULL}) is too old to run ${P}"
107     eerror "It must be at least ${KV_min}!"
108     fi
109    
110     KV_FULL_SRC=${KV_FULL}
111     get_running_version
112     if ! udev_check_KV
113     then
114     eerror
115     eerror "Your running kernel version (${KV_FULL}) is too old"
116     eerror "for this version of udev."
117     eerror "You must upgrade your kernel or downgrade udev."
118     fi
119     }
120    
121     src_prepare()
122     {
123     # backport some patches
124     if [[ -n "${patchset}" ]]
125     then
126     EPATCH_SUFFIX=patch EPATCH_FORCE=yes epatch
127     fi
128    
129     # change rules back to group uucp instead of dialout for now
130     sed -e 's/GROUP="dialout"/GROUP="uucp"/' \
131     -i rules/*.rules \
132     || die "failed to change group dialout to uucp"
133    
134     if [[ ! -e configure ]]
135     then
136     if use doc
137     then
138     gtkdocize --docdir docs || die "gtkdocize failed"
139     else
140     echo 'EXTRA_DIST =' > docs/gtk-doc.make
141     fi
142     eautoreconf
143     else
144     check_default_rules
145     elibtoolize
146     fi
147     }
148    
149     src_configure()
150     {
151     local econf_args
152    
153     econf_args=(
154     ac_cv_search_cap_init=
155     ac_cv_header_sys_capability_h=yes
156     DBUS_CFLAGS=' '
157     DBUS_LIBS=' '
158     --docdir=/usr/share/doc/${PF}
159     --libdir=/usr/$(get_libdir)
160     --with-distro=gentoo
161     --with-firmware-path=/usr/lib/firmware/updates:/usr/lib/firmware:/lib/firmware/updates:/lib/firmware
162     --with-html-dir=/usr/share/doc/${PF}/html
163     --with-pci-ids-path=/usr/share/misc/pci.ids
164     --with-rootlibdir=/usr/$(get_libdir)
165     --with-rootprefix=/usr
166     --with-usb-ids-path=/usr/share/misc/usb.ids
167     --disable-audit
168     --disable-coredump
169     --disable-hostnamed
170     --disable-ima
171     --disable-libcryptsetup
172     --disable-localed
173     --disable-logind
174     --disable-nls
175     --disable-pam
176     --disable-quotacheck
177     --disable-readahead
178     --enable-split-usr
179     --disable-tcpwrap
180     --disable-timedated
181     --disable-xz
182     $(use_enable acl)
183     $(use_enable doc gtk-doc)
184     $(use_enable gudev)
185     $(use_enable introspection)
186     $(use_enable keymap)
187     $(use_enable selinux)
188     $(use_enable static-libs static)
189     )
190     econf "${econf_args[@]}"
191     }
192    
193     src_compile()
194     {
195     echo 'BUILT_SOURCES: $(BUILT_SOURCES)' > "${T}"/Makefile.extra
196     emake -f Makefile -f "${T}"/Makefile.extra BUILT_SOURCES
197     local targets=(
198     systemd-udevd
199     udevadm
200     libudev.la
201     ata_id
202     cdrom_id
203     collect
204     scsi_id
205     v4l_id
206     accelerometer
207     mtd_probe
208     man/udev.7
209     man/udevadm.8
210     man/systemd-udevd.8
211     man/systemd-udevd.service.8
212     )
213     use keymap && targets+=( keymap )
214     use gudev && targets+=( libgudev-1.0.la )
215    
216     emake "${targets[@]}"
217     if use doc
218     then
219     emake -C docs/libudev
220     use gudev && emake -C docs/gudev
221     fi
222     }
223    
224     src_install()
225     {
226     local lib_LTLIBRARIES=libudev.la \
227     pkgconfiglib_DATA=src/libudev/libudev.pc
228    
229     local targets=(
230     install-libLTLIBRARIES
231     install-includeHEADERS
232     install-libgudev_includeHEADERS
233     install-binPROGRAMS
234     install-rootlibexecPROGRAMS
235     install-udevlibexecPROGRAMS
236     install-dist_systemunitDATA
237     install-dist_udevconfDATA
238     install-dist_udevhomeSCRIPTS
239     install-dist_udevkeymapDATA
240     install-dist_udevkeymapforcerelDATA
241     install-dist_udevrulesDATA
242     install-girDATA
243     install-man7
244     install-man8
245     install-nodist_systemunitDATA
246     install-pkgconfiglibDATA
247     install-sharepkgconfigDATA
248     install-typelibsDATA
249     install-dist_docDATA
250     udev-confdirs
251     systemd-install-hook
252     )
253    
254     if use gudev
255     then
256     lib_LTLIBRARIES+=" libgudev-1.0.la"
257     pkgconfiglib_DATA+=" src/gudev/gudev-1.0.pc"
258     fi
259    
260     # add final values of variables:
261     targets+=(
262     rootlibexec_PROGRAMS=systemd-udevd
263     bin_PROGRAMS=udevadm
264     lib_LTLIBRARIES="${lib_LTLIBRARIES}"
265     MANPAGES="man/udev.7 man/udevadm.8 man/systemd-udevd.service.8"
266     MANPAGES_ALIAS="man/systemd-udevd.8"
267     dist_systemunit_DATA="units/systemd-udevd-control.socket \
268     units/systemd-udevd-kernel.socket"
269     nodist_systemunit_DATA="units/systemd-udevd.service \
270     units/systemd-udev-trigger.service \
271     units/systemd-udev-settle.service"
272     pkgconfiglib_DATA="${pkgconfiglib_DATA}"
273     )
274     emake DESTDIR="${D}" "${targets[@]}"
275     if use doc
276     then
277     emake -C docs/libudev DESTDIR="${D}" install
278     use gudev && emake -C docs/gudev DESTDIR="${D}" install
279     fi
280     dodoc TODO
281    
282     prune_libtool_files --all
283     rm -f "${D}"/usr/lib/udev/rules.d/99-systemd.rules
284     rm -rf "${D}"/usr/share/doc/${PF}/LICENSE.*
285    
286     # install gentoo-specific rules
287     insinto /usr/lib/udev/rules.d
288     doins "${FILESDIR}"/40-gentoo.rules
289    
290     # install udevadm symlink
291     dosym ../usr/bin/udevadm /sbin/udevadm
292     }
293    
294     pkg_preinst()
295     {
296     local htmldir
297     for htmldir in gudev libudev; do
298     if [[ -d ${ROOT}usr/share/gtk-doc/html/${htmldir} ]]
299     then
300     rm -rf "${ROOT}"usr/share/gtk-doc/html/${htmldir}
301     fi
302     if [[ -d ${D}/usr/share/doc/${PF}/html/${htmldir} ]]
303     then
304     dosym ../../doc/${PF}/html/${htmldir} \
305     /usr/share/gtk-doc/html/${htmldir}
306     fi
307     done
308     preserve_old_lib /$(get_libdir)/libudev.so.0
309     }
310    
311     # This function determines if a directory is a mount point.
312     # It was lifted from dracut.
313     ismounted()
314     {
315     while read a m a; do
316     [[ $m = $1 ]] && return 0
317     done < "${ROOT}"/proc/mounts
318     return 1
319     }
320    
321     pkg_postinst()
322     {
323     mkdir -p "${ROOT}"/run
324    
325     # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
326     # So try to remove it here (will only work if empty).
327     rmdir "${ROOT}"/dev/loop 2>/dev/null
328     if [[ -d ${ROOT}/dev/loop ]]
329     then
330     ewarn "Please make sure your remove /dev/loop,"
331     ewarn "else losetup may be confused when looking for unused devices."
332     fi
333    
334     # people want reminders, I'll give them reminders. Odds are they will
335     # just ignore them anyway...
336    
337     # 64-device-mapper.rules now gets installed by sys-fs/device-mapper
338     # remove it if user don't has sys-fs/device-mapper installed, 27 Jun 2007
339     if [[ -f ${ROOT}/etc/udev/rules.d/64-device-mapper.rules ]] &&
340     ! has_version sys-fs/device-mapper
341     then
342     rm -f "${ROOT}"/etc/udev/rules.d/64-device-mapper.rules
343     einfo "Removed unneeded file 64-device-mapper.rules"
344     fi
345    
346     ewarn
347     ewarn "If you build an initramfs including udev, please make sure the"
348     ewarn "/usr/bin/udevadm binary gets included, Also, change your scripts to"
349     ewarn "use it,as it replaces the old udevinfo and udevtrigger helpers."
350    
351     ewarn
352     ewarn "mount options for /dev are no longer set in /etc/udev/udev.conf."
353     ewarn "Instead, /etc/fstab should be used. This matches other mount points."
354    
355     ewarn
356     ewarn "Rules for /dev/hd* devices have been removed."
357     ewarn "Please migrate to libata."
358    
359     ewarn
360     ewarn "action_modeswitch has been removed by upstream."
361     ewarn "Please use sys-apps/usb_modeswitch."
362    
363     if ismounted /usr
364     then
365     ewarn
366     ewarn "Your system has /usr on a separate partition. This means"
367     ewarn "you will need to use an initramfs to pre-mount /usr before"
368     ewarn "udev runs."
369     ewarn "This must be set up before your next reboot, or you may"
370     ewarn "experience failures which are very difficult to troubleshoot."
371     ewarn "For a more detailed explanation, see the following URL:"
372     ewarn "http://www.freedesktop.org/wiki/Software/systemd/separate-usr-is-broken"
373     ewarn
374     ewarn "For more information on setting up an initramfs, see the"
375     ewarn "following URL:"
376     ewarn "http://www.gentoo.org/doc/en/initramfs-guide.xml"
377     fi
378    
379     if use acl; then
380     ewarn
381     ewarn "The udev-acl functionality has been moved."
382     ewarn "If you are not using systemd, this is handled by consolekit."
383     ewarn "Otherwise, you need to make sure that systemd is emerged with"
384     ewarn "the acl use flag active."
385     fi
386    
387     if [[ -d ${ROOT}lib/udev ]]
388     then
389     ewarn
390     ewarn "This version of udev moves the files which were installed in"
391     ewarn "/lib/udev to /usr/lib/udev. We include a backward compatibility"
392     ewarn "patch for gentoo to allow the rules in /lib/udev/rules.d to be"
393     ewarn "read; however, bugs should be filed against packages which are"
394     ewarn "installing things in /lib/udev so they can be fixed."
395     fi
396    
397     ewarn
398     ewarn "You need to restart udev as soon as possible to make the upgrade go"
399     ewarn "into affect."
400     ewarn "The method you use to do this depends on your init system."
401    
402     ewarn
403     ewarn "Upstream has removed the persistent-net and persistent-cd rules"
404     ewarn "generator. If you need persistent names for these devices,"
405     ewarn "place udev rules for them in ${ROOT}etc/udev/rules.d."
406     ewarn "Be aware that you cannot directly swap device names, so persistent"
407     ewarn "rules for network devices should be like the ones at the following"
408     ewarn "URL:"
409     ewarn "http://bugs.gentoo.org/show_bug.cgi?id=433746#C1"
410    
411     preserve_old_lib_notify /$(get_libdir)/libudev.so.0
412    
413     elog
414     elog "For more information on udev on Gentoo, writing udev rules, and"
415     elog " fixing known issues visit:"
416     elog " http://www.gentoo.org/doc/en/udev-guide.xml"
417     }

  ViewVC Help
Powered by ViewVC 1.1.20