2 VERSION=$(shell awk '/Version:/ { print $$2 }' hwdata.spec)
3 RELEASE=$(shell rpm -q --define 'dist %{nil}' --specfile --qf "%{release}" hwdata.spec)
4 ifeq ($(shell git rev-parse --abbrev-ref HEAD | sed -n 's/^\([^0-9-]\+\).*/\L\1/p'), rhel)
5 # add revision to tag name for rhel branches
6 TAGNAME := $(NAME)-$(VERSION)-$(RELEASE)
8 TAGNAME := $(NAME)-$(VERSION)
10 SOURCEDIR := $(shell pwd)
11 ARCHIVE := $(TAGNAME).tar.bz2
13 CVSROOT = $(shell cat CVS/Root 2>/dev/null || :)
15 CVSTAG = $(NAME)-r$(subst .,-,$(VERSION))
17 FILES = pci.ids usb.ids oui.txt iab.txt pnp.ids
19 .PHONY: all install tag force-tag check commit create-archive archive srpm-x \
20 clean clog new-pci-ids new-usb-ids new-oui new-iab new-pnp-ids
26 Makefile.inc: configure
28 @echo "$@ generated. Run the make again."
32 mkdir -p -m 755 $(DESTDIR)$(datadir)/$(NAME)
33 for foo in $(FILES) ; do \
34 install -m 644 $$foo $(DESTDIR)$(datadir)/$(NAME) ;\
36 mkdir -p -m 755 $(DESTDIR)$(libdir)/modprobe.d
37 install -m 644 -T blacklist.conf $(DESTDIR)$(libdir)/modprobe.d/dist-blacklist.conf
43 @git tag -s -m "Tag as $(TAGNAME)" $(TAGNAME)
44 @echo "Tagged as $(TAGNAME)"
47 @git tag -s -f $(TAGNAME)
48 @echo "Tag forced as $(TAGNAME)"
52 @(GIT_DIR=.git git log > .changelog.tmp && mv .changelog.tmp ChangeLog || rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
55 @[ -x /sbin/lspci ] && /sbin/lspci -i pci.ids > /dev/null || { echo "FAILURE: /sbin/lspci -i pci.ids"; exit 1; } && echo "OK: /sbin/lspci -i pci.ids"
56 @./check-pci-ids.py || { echo "FAILURE: ./check-pci-ids.py"; exit 1; } && echo "OK: ./check-pci-ids.py"
57 @echo -n "CHECK date of pci.ids: "; grep "Date:" pci.ids | cut -d ' ' -f 5
58 @echo -n "CHECK date of usb.ids: "; grep "Date:" usb.ids | cut -d ' ' -f 6
61 @rm -rf $(TAGNAME) $(TAGNAME).tar* 2>/dev/null
63 @git archive --format=tar --prefix=$(TAGNAME)/ HEAD > $(TAGNAME).tar
65 @cp ChangeLog $(TAGNAME)/
66 @tar --append -f $(TAGNAME).tar $(TAGNAME)
67 @bzip2 -f $(TAGNAME).tar
70 @echo "The final archive is in $(ARCHIVE)"
72 archive: check clean commit tag create-archive
75 @scp $(ARCHIVE) fedorahosted.org:$(NAME)
79 srpm-x: create-archive
80 @echo Creating $(NAME) src.rpm
81 @rpmbuild --nodeps -bs --define "_sourcedir $(SOURCEDIR)" --define "_srcrpmdir $(SOURCEDIR)" $(NAME).spec
82 @echo SRPM is: $(NAME)-$(VERSION)-$(RELEASE).src.rpm
85 @rm -f $(NAME)-*.gz $(NAME)-*.src.rpm new-pnp.xlsx pnp.ids.txt
88 @sed -n '/^%changelog/,/^$$/{/^%/d;/^$$/d;s/%%/%/g;p}' $< | tee $@
90 download: new-usb-ids new-pci-ids new-oui new-iab new-pnp-ids
93 @curl -O http://www.linux-usb.org/usb.ids
96 @curl -O http://pciids.sourceforge.net/pci.ids
99 @curl -O http://standards.ieee.org/develop/regauth/oui/oui.txt
102 @curl -O http://standards.ieee.org/develop/regauth/iab/iab.txt
106 pnp.ids: pnp.ids.txt pnp.ids.patch
107 patch -o $@ <pnp.ids.patch
109 pnp.ids.txt: new-pnp.xlsx
110 @unoconv --stdout -f csv $? | \
113 -e 's/^\s*"\s*\(.*\)\s*"/\1/' \
114 -e 's/\s\{2,\}/ /g' \
115 -e 's/\s*(used as 2nd pnpid)\s*//' \
116 -e 's:^\(.*\)\s*,\s*\([a-zA-Z@]\{3\}\)\s*,\s*\([0-9]\+/[0-9]\+/[0-9]\+\):\2\t\1:p' | \
117 sed 's/\s*$$//' | sort -u >$@
121 http://download.microsoft.com/download/7/E/7/7E7662CF-CBEA-470B-A97E-CE7CE0D98DC2/ISA_PNPID_List.xlsx