summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2013-02-26 09:53:01 +0100
committerChristophe Fergeau <cfergeau@redhat.com>2013-03-05 18:29:39 +0100
commitd895dc43702717deb4022f0896469ba6ac8646a5 (patch)
tree4d37f0af2a02b0cbc0882389dfac8aa3d1503ee0 /data
parent56eb7986520cae806159a6ada4652b93307a83d3 (diff)
Allow to use system pci.ids/usb.ids files
Most distros already ship copies of pci.ids/usb.ids. This commit allows to make use of these rather than the ones shipped with libosinfo. This is achieved through the use of --with-usb-ids-path and --with-pci-ids-path configure flags.
Diffstat (limited to 'data')
-rw-r--r--data/Makefile.am37
1 files changed, 26 insertions, 11 deletions
diff --git a/data/Makefile.am b/data/Makefile.am
index 747f0e9..77ad889 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,10 +1,30 @@
+INSTALL_DATA_HOOK_DEPS =
SUBDIRS = datamaps devices oses hypervisors install-scripts schemas
-
EXTRA_DIST = usb.ids pci.ids 95-osinfo.rules.in
+CLEANFILES = usb.ids pci.ids
+
+if USE_INTERNAL_USB_IDS
+usb_database_DATA = usb.ids
+usb_databasedir = $(pkgdatadir)/db/
+usb.ids:
+ -wget -q -O $@ http://www.linux-usb.org/usb.ids
+else
+usb_ids_install:
+ $(LN_S) $(USB_IDS) $(pkgdatadir)/db/usb.ids
+INSTALL_DATA_HOOK_DEPS += usb_ids_install
+endif
-databasedir = $(pkgdatadir)/db/
-database_DATA = usb.ids pci.ids
+if USE_INTERNAL_PCI_IDS
+pci_database_DATA = pci.ids
+pci_databasedir = $(pkgdatadir)/db/
+pci.ids:
+ -wget -q -O $@ http://pciids.sourceforge.net/v2.2/pci.ids
+else
+pci_ids_install:
+ $(LN_S) $(PCI_IDS) $(pkgdatadir)/db/pci.ids
+INSTALL_DATA_HOOK_DEPS += pci_ids_install
+endif
if WITH_UDEV
BUILT_SOURCES = 95-osinfo.rules
@@ -12,16 +32,11 @@ BUILT_SOURCES = 95-osinfo.rules
95-osinfo.rules: 95-osinfo.rules.in
sed 's,\@bindir\@,$(exec_prefix)/bin,' $< > $@
-install-data-hook: 95-osinfo.rules
+95-osinfo.rules-install: 95-osinfo.rules
mkdir -p $(DESTDIR)$(UDEV_RULESDIR)
$(INSTALL) -m 0644 95-osinfo.rules $(DESTDIR)$(UDEV_RULESDIR)
+INSTALL_DATA_HOOK_DEPS += 95-osinfo.rules-install
endif
-CLEANFILES = usb.ids pci.ids
-
-usb.ids:
- -wget -q -O $@ http://www.linux-usb.org/usb.ids
-
-pci.ids:
- -wget -q -O $@ http://pciids.sourceforge.net/v2.2/pci.ids
+install-data-hook: $(INSTALL_DATA_HOOK_DEPS)