summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/hwids/hwids-99999999.ebuild')
-rw-r--r--sys-apps/hwids/hwids-99999999.ebuild28
1 files changed, 23 insertions, 5 deletions
diff --git a/sys-apps/hwids/hwids-99999999.ebuild b/sys-apps/hwids/hwids-99999999.ebuild
index 7a597ad81286..b94cbccd5c86 100644
--- a/sys-apps/hwids/hwids-99999999.ebuild
+++ b/sys-apps/hwids/hwids-99999999.ebuild
@@ -1,8 +1,9 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/hwids/hwids-99999999.ebuild,v 1.4 2012/12/02 06:47:35 ssuominen Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/hwids/hwids-99999999.ebuild,v 1.5 2012/12/02 07:21:00 ssuominen Exp $
-EAPI="4"
+EAPI=5
+inherit udev
DESCRIPTION="Hardware (PCI, USB) IDs databases"
HOMEPAGE="https://github.com/gentoo/hwids"
@@ -11,11 +12,12 @@ HOMEPAGE="https://github.com/gentoo/hwids"
LICENSE="|| ( GPL-2 BSD ) freedist"
SLOT="0"
KEYWORDS=""
-IUSE=""
+IUSE="+udev"
-S="${WORKDIR}"
+S=${WORKDIR}
-DEPEND="net-misc/wget"
+DEPEND="net-misc/wget
+ udev? ( dev-lang/perl !=sys-fs/udev-196 )"
RDEPEND="!<sys-apps/pciutils-3.1.9-r2
!<sys-apps/usbutils-005-r1"
@@ -25,9 +27,25 @@ src_compile() {
for file in {usb,pci}.ids; do
zcat ${file}.gz > ${file} || die
done
+
+ if use udev; then
+ wget http://cgit.freedesktop.org/systemd/systemd/plain/hwdb/ids-update.pl -O ids-update-${PV}.pl || die
+ perl "${DISTDIR}"/ids-update-${PV}.pl &>/dev/null || die
+ fi
}
src_install() {
insinto /usr/share/misc
doins {usb,pci}.ids{,.gz} oui.txt
+
+ if use udev; then
+ insinto "$(udev_get_udevdir)"/hwdb.d
+ doins *.hwdb
+ fi
+}
+
+pkg_postinst() {
+ if use udev && has_version '>=virtual/udev-180'; then
+ udevadm hwdb --update
+ fi
}