From 16e67eceb59974d7d12c0bd6c25e7c05bd8565a6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Diego=20Elio=20Petten=C3=B2?= Date: Sat, 8 Dec 2012 03:41:21 -0800 Subject: [PATCH] Move compress/install logic to Makefile. This basically moves the logic from the ebuild into the hwids package itself, since that should be shareable by other distributions as well. Now that udev has more complex installs, it's worth doing it. --- Makefile | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/Makefile b/Makefile index 346eafe..15d62de 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,18 @@ else Q= endif +ifeq "$(UDEV)" "yes" + ALL_TARGETS="compress udev-hwdb" + INSTALL_TARGETS="install-base install-hwdb" +else + ALL_TARGETS="compress" + INSTALL_TARGETS="install-base" +endif + +all: $(ALL_TARGETS) + +install: $(INSTALL_TARGETS) + fetch: $(Q)curl -z pci.ids -o pci.ids -R http://pci-ids.ucw.cz/v2.2/pci.ids $(Q)curl -z usb.ids -o usb.ids -R http://www.linux-usb.org/usb.ids @@ -23,3 +35,26 @@ tag: udev-hwdb: perl ./udev-hwdb-update.pl && mv *.hwdb udev/ + +compress: pci.ids.gz usb.ids.gz + +%.gz: % + gzip -c $< > $@ + +MISCDIR=/usr/share/misc +HWDBDIR=/usr/lib/udev/hwdb.d +DOCDIR=/usr/share/doc/hwids + +install-base: compress + mkdir -p $(DESTDIR)$(DOCDIR) + install -p README.md $(DESTDIR)$(DOCDIR) + mkdir -p $(DESTDIR)$(MISCDIR) + for file in {usb,pci}.ids{,.gz} {oui,iab}.txt; do \ + install -p $$file $(DESTDIR)$(MISCDIR) + done + +install-udev: + mkdir -p $(DESTDIR)$(HWDBDIR) + for file in udev/*.hwdb; do \ + install -p $$file $(DESTDIR)$(HWDBDIR) + done -- 2.25.1