--- udev-200.ebuild 2013-03-29 16:10:30.555805836 +0100 +++ udev-202.ebuild 2013-04-19 16:37:11.384467708 +0200 @@ -11,13 +11,13 @@ KV_min=2.6.32 fi -inherit autotools eutils linux-info multilib systemd toolchain-funcs versionator flag-o-matic +inherit autotools eutils linux-info multilib toolchain-funcs versionator flag-o-matic if [[ ${PV} = 9999* ]]; then EGIT_REPO_URI="git://anongit.freedesktop.org/systemd/systemd" inherit git-2 else - patchset= #3 + patchset= #1 SRC_URI="http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz" if [[ -n "${patchset}" ]]; then SRC_URI="${SRC_URI} @@ -32,7 +32,7 @@ LICENSE="LGPL-2.1 MIT GPL-2" SLOT="0" -IUSE="acl doc firmware-loader gudev hwdb introspection keymap +kmod +openrc selinux static-libs logind" +IUSE="acl doc +firmware-loader gudev hwdb introspection keymap +kmod +openrc selinux static-libs logind" RESTRICT="test" @@ -40,12 +40,15 @@ acl? ( sys-apps/acl ) gudev? ( >=dev-libs/glib-2 ) introspection? ( >=dev-libs/gobject-introspection-1.31.1 ) - kmod? ( >=sys-apps/kmod-12 ) + kmod? ( >=sys-apps/kmod-13 ) selinux? ( >=sys-libs/libselinux-2.1.9 ) !=dev-util/intltool-0.50" fi @@ -119,13 +120,13 @@ src_prepare() { if ! [[ ${PV} = 9999* ]]; then # secure_getenv() disable for non-glibc systems wrt bug #443030 - if ! [[ $(grep -r secure_getenv * | wc -l) -eq 16 ]]; then + if ! [[ $(grep -r secure_getenv * | wc -l) -eq 19 ]]; then eerror "The line count for secure_getenv() failed, see bug #443030" die fi # gperf disable if keymaps are not requested wrt bug #452760 - if ! [[ $(grep -i gperf Makefile.am | wc -l) -eq 27 ]]; then + if ! [[ $(grep -i gperf Makefile.am | wc -l) -eq 27 ]]; then eerror "The line count for gperf references failed, see bug 452760" die fi @@ -138,7 +139,7 @@ # These are missing from upstream 50-udev-default.rules cat <<-EOF > "${T}"/40-gentoo.rules - # see src_prepare() for content of these files + # Gentoo specific usb group SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb" # Keep this for Linux 2.6.32 kernels with accept4() support like .60 wrt #457868 SUBSYSTEM=="mem", KERNEL=="null|zero|full|random|urandom", MODE="0666" @@ -169,18 +170,17 @@ #epatch "${FILESDIR}/${P}"-run-to-var.patch || die epatch "${FILESDIR}/${PN}"-198-logind.patch || die - epatch "${FILESDIR}/${PN}"-198-nosystemd-daemon-makefile.patch || die + # :g/^Ilibsystemd-daemon.la \\/d + # :%s/ \\\n^Ilibsystemd-daemon.la// + sed -i '/\slibsystemd-daemon.la \\/d' Makefile.am + sed -e :a -i -e '/\\$/N; s/\\\n\slibsystemd-daemon.la//; ta' Makefile.am + #epatch "${FILESDIR}/${PN}"-202-nosystemd-daemon-makefile.patch || die # change rules back to group uucp instead of dialout for now wrt #454556 sed -e 's/GROUP="dialout"/GROUP="uucp"/' \ -i rules/*.rules \ || die "failed to change group dialout to uucp" - if ! use elibc_glibc; then #443030 - echo '#define secure_getenv(x) NULL' >> config.h.in - sed -i -e '/error.*secure_getenv/s:.*:#define secure_getenv(x) NULL:' src/shared/missing.h || die - fi - if [ ! -e configure ]; then if use doc; then gtkdocize --docdir docs || die "gtkdocize failed" @@ -194,12 +194,18 @@ eautomake fi + if ! use elibc_glibc; then #443030 + echo '#define secure_getenv(x) NULL' >> config.h.in + sed -i -e '/error.*secure_getenv/s:.*:#define secure_getenv(x) NULL:' src/shared/missing.h || die + fi + # link udevd(8) to systemd-udevd.service(8) manpage #echo '.so systemd-udevd.service.8' > "${T}"/udevd.8 } src_configure() { - use keymap || export ac_cv_path_GPERF=true #452760 + tc-export CC #463846 + use keymap || export ac_cv_prog_ac_ct_GPERF=true #452760 # alternative: systemd daemon NOPs when -DDISABLE_SYSTEMD is set # also not for logind, but does not harm. @@ -263,7 +269,6 @@ $(use_enable selinux) $(use_enable static-libs static) ) - if use introspection; then econf_args+=( --enable-introspection=$(usex introspection) @@ -272,7 +277,7 @@ if use firmware-loader; then econf_args+=( - --with-firmware-path=/lib/firmware/updates:/lib/firmware + --with-firmware-path="/lib/firmware/updates:/lib/firmware" ) fi @@ -292,9 +297,9 @@ emake -f Makefile -f "${T}"/Makefile.extra BUILT_SOURCES local targets=( libudev-private.la + libudev.la systemd-udevd udevadm - libudev.la ata_id cdrom_id collect @@ -393,7 +398,6 @@ INSTALL_DIRS='$(sysconfdir)/udev/rules.d \ $(sysconfdir)/udev/hwdb.d' dist_bashcompletion_DATA="shell-completion/bash/udevadm" - ) if use logind; then targets+=( @@ -404,7 +408,6 @@ ) fi emake -j1 DESTDIR="${D}" "${targets[@]}" - if use doc; then emake -C docs/libudev DESTDIR="${D}" install use gudev && emake -C docs/gudev DESTDIR="${D}" install @@ -416,9 +419,10 @@ "${D}"/lib/udev/rules.d/99-systemd.rules \ "${D}"/usr/share/doc/${PF}/LICENSE.* - # install gentoo-specific rules + # see src_prepare() for content of these files insinto /lib/udev/rules.d doins "${T}"/40-gentoo.rules +# doman "${T}"/udevd.8 dodir /usr/$(get_libdir) mv ${D:-:}/$(get_libdir)/pkgconfig ${D}/usr/$(get_libdir) @@ -438,7 +442,6 @@ # move udevd where it should be and remove unlogical /lib/systemd mv "${ED}"/lib/systemd/systemd-udevd "${ED}"/sbin/udevd || die rm -r "${ED}"/lib/systemd - rm -r "${ED}"/usr/lib/systemd # create symlinks for these utilities to /sbin # where multipath-tools expect them to be (Bug #168588) @@ -455,18 +458,16 @@ fi local man - for man in man7/udevd.7 man8/udevd.8 man8/udevadm.8 ${manuals}; do + for man in man7/udev.7 man8/udevd.8 man8/udevadm.8 ${manuals}; do sed -i 's:\\fBsystem.*\\fR(1),::' ${D}/usr/share/man/${man} sed -i 's:systemd-\([^\.]*\)\.service:\1:g' ${D}/usr/share/man/${man} + sed -i 's:systemd-\([^\.]*\.socket\):\1:g' ${D}/usr/share/man/${man} sed -i 's:systemd\\-::g' ${D}/usr/share/man/${man} sed -i '/^\.TH/s:systemd:version:' ${D}/usr/share/man/${man} + sed -i '/^\.TH/s:SYSTEMD\\-::' ${D}/usr/share/man/${man} done - # see src_prepare() where this is created - #doman "${T}"/udevd.8 - if use logind; then -# rm -f "${D}"/usr/dbus-1/system.d/org.freedesktop.systemd1.conf exeinto /$(get_libdir)/udev doexe ./.libs/systemd-logind mv ${D}/$(get_libdir)/udev/systemd-logind ${D}/sbin/logind @@ -478,8 +479,8 @@ pkg_preinst() { local htmldir for htmldir in gudev libudev; do - if [[ -d ${ROOT}usr/share/gtk-doc/html/${htmldir} ]]; then - rm -rf "${ROOT}"usr/share/gtk-doc/html/${htmldir} + if [[ -d ${ROOT}/usr/share/gtk-doc/html/${htmldir} ]]; then + rm -rf "${ROOT}"/usr/share/gtk-doc/html/${htmldir} fi if [[ -d ${D}/usr/share/doc/${PF}/html/${htmldir} ]]; then dosym ../../doc/${PF}/html/${htmldir} \ @@ -489,15 +490,6 @@ preserve_old_lib /{,usr/}$(get_libdir)/libudev$(get_libname 0) } -# This function determines if a directory is a mount point. -# It was lifted from dracut. -ismounted() { - while read a m a; do - [[ $m = $1 ]] && return 0 - done < "${ROOT}"/proc/mounts - return 1 -} - pkg_postinst() { mkdir -p "${ROOT}"/run @@ -520,24 +512,6 @@ einfo "Removed unneeded file ${old_dm_rules}" fi - if ismounted /usr; then - ewarn - ewarn "Your system has /usr on a separate partition. This means" - ewarn "you will need to use an initramfs to pre-mount /usr before" - ewarn "udev runs." - ewarn - ewarn "If this is not set up before your next reboot, udev may work;" - ewarn "However, you also may experience failures which are very" - ewarn "difficult to troubleshoot." - ewarn - ewarn "For a more detailed explanation, see the following URL:" - ewarn "http://www.freedesktop.org/wiki/Software/systemd/separate-usr-is-broken" - ewarn - ewarn "For more information on setting up an initramfs, see the" - ewarn "following URL:" - ewarn "http://www.gentoo.org/doc/en/initramfs-guide.xml" - fi - local fstab="${ROOT}"/etc/fstab dev path fstype rest while read -r dev path fstype rest; do if [[ ${path} == /dev && ${fstype} != devtmpfs ]]; then @@ -595,7 +569,7 @@ ewarn "(replace with, for example, eth0):" ewarn "# udevadm test-builtin net_id /sys/class/net/ 2> /dev/null" ewarn - ewarn "You can use kernel command net.ifnames= to control this feature." + ewarn "You can use kernel commandline net.ifnames=0 to disable this feature." ewarn ewarn "You need to restart udev as soon as possible to make the upgrade go" @@ -605,13 +579,13 @@ preserve_old_lib_notify /{,usr/}$(get_libdir)/libudev$(get_libname 0) elog - elog "For more information on udev on Gentoo, writing udev rules, and" + elog "For more information on udev on Gentoo, upgrading, writing udev rules, and" elog " fixing known issues visit:" + elog " http://wiki.gentoo.org/wiki/Udev/upgrade" elog " http://www.gentoo.org/doc/en/udev-guide.xml" - # Keep this here in case the database format changes so it gets updated - # when required. Despite that this file is owned by sys-apps/hwids. - if use hwdb && has_version sys-apps/hwids; then + # Update hwdb database in case the format is changed by udev version. + if use hwdb && has_version 'sys-apps/hwids[udev]'; then udevadm hwdb --update --root="${ROOT%/}" fi }