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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Fri Aug 3 15:41:07 2012 UTC (9 months, 2 weeks ago) by williamh
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +1 -1 lines
FILE REMOVED
remove old versions

(Portage version: 2.2.0_alpha120/cvs/Linux i686, signed Manifest commit with key williamh@gentoo.org)

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

  ViewVC Help
Powered by ViewVC 1.1.13