X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=Makefile;h=b73a9cffbea08e9be3ebd5401aa6c760ff78197b;hb=48861587b841e25084c6a02381c92b5f97e3ef33;hp=4a68acc075e4180042380e7dbbc70d52a9ae4147;hpb=3eb50502409b4015ef51eca8b35d8f40387a74f1;p=oweals%2Fhwdata.git diff --git a/Makefile b/Makefile index 4a68acc..b73a9cf 100644 --- a/Makefile +++ b/Makefile @@ -1,49 +1,51 @@ -NAME=$(shell awk '/Name:/ { print $$2 }' hwdata.spec) +NAME=hwdata VERSION=$(shell awk '/Version:/ { print $$2 }' hwdata.spec) -RELEASE=$(shell rpm -q --specfile --qf "%{release}" hwdata.spec) +RELEASE=$(shell rpm -q --define 'dist %{nil}' --specfile --qf "%{release}" hwdata.spec) +ifeq ($(shell git rev-parse --abbrev-ref HEAD | sed -n 's/^\([^0-9-]\+\).*/\L\1/p'), rhel) + # add revision to tag name for rhel branches + TAGNAME := $(NAME)-$(VERSION)-$(RELEASE) +else + TAGNAME := $(NAME)-$(VERSION) +endif SOURCEDIR := $(shell pwd) - -prefix=$(DESTDIR)/usr -sysconfdir=$(DESTDIR)/etc -bindir=$(prefix)/bin -sbindir=$(prefix)/sbin -datadir=$(prefix)/share -mandir=$(datadir)/man -includedir=$(prefix)/include -libdir=$(prefix)/lib - -CC=gcc -CFLAGS=$(RPM_OPT_FLAGS) -g +ARCHIVE := $(TAGNAME).tar.bz2 CVSROOT = $(shell cat CVS/Root 2>/dev/null || :) CVSTAG = $(NAME)-r$(subst .,-,$(VERSION)) -FILES = MonitorsDB pci.ids upgradelist usb.ids videodrivers oui.txt pnp.ids +IDFILES = pci.ids usb.ids oui.txt iab.txt pnp.ids + +.PHONY: all install tag force-tag check commit create-archive archive srpm-x \ + clean clog new-pci-ids new-usb-ids new-oui new-iab new-pnp-ids -.PHONY: all install tag force-tag check commit create-archive archive srpm-x clean clog new-pci-ids new-usb-ids +include Makefile.inc -all: +all: -install: - mkdir -p -m 755 $(datadir)/$(NAME) +Makefile.inc: configure + ./configure + @echo "$@ generated. Run the make again." + @exit 1 + +install: Makefile.inc + mkdir -p -m 755 $(DESTDIR)$(datadir)/$(NAME) for foo in $(FILES) ; do \ - install -m 644 $$foo $(datadir)/$(NAME) ;\ + install -m 644 $$foo $(DESTDIR)$(datadir)/$(NAME) ;\ done - mkdir -p -m 755 $(datadir)/$(NAME)/videoaliases - mkdir -p -m 755 $(sysconfdir)/modprobe.d - install -m 644 blacklist.conf $(sysconfdir)/modprobe.d + mkdir -p -m 755 $(DESTDIR)$(libdir)/modprobe.d + install -m 644 -T blacklist.conf $(DESTDIR)$(libdir)/modprobe.d/dist-blacklist.conf commit: git commit -a ||: tag: - @git tag -a -m "Tag as $(NAME)-$(VERSION)-$(RELEASE)" $(NAME)-$(VERSION)-$(RELEASE) - @echo "Tagged as $(NAME)-$(VERSION)-$(RELEASE)" + @git tag -s -m "Tag as $(TAGNAME)" $(TAGNAME) + @echo "Tagged as $(TAGNAME)" force-tag: - @git tag -f $(NAME)-$(VERSION)-$(RELEASE) - @echo "Tag forced as $(NAME)-$(VERSION)-$(RELEASE)" + @git tag -s -f -m "Tag as $(TAGNAME)" $(TAGNAME) + @echo "Tag forced as $(TAGNAME)" changelog: @rm -f ChangeLog @@ -52,27 +54,35 @@ changelog: check: @[ -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" @./check-pci-ids.py || { echo "FAILURE: ./check-pci-ids.py"; exit 1; } && echo "OK: ./check-pci-ids.py" + @./check-usb-ids.sh + @for file in $(IDFILES); do \ + text=`LANG=C file $$file`; \ + expected="$$file: UTF-8 Unicode text"; \ + if [[ "$$text" != "$$expected" ]]; then \ + printf "Expected: %s\n Got instead: %s\n" "$$expected" "$$text" >&2; \ + exit 1; \ + fi; \ + echo "OK: $$text"; \ + done @echo -n "CHECK date of pci.ids: "; grep "Date:" pci.ids | cut -d ' ' -f 5 @echo -n "CHECK date of usb.ids: "; grep "Date:" usb.ids | cut -d ' ' -f 6 - @: videodrivers is tab-separated - @[ `grep -vc ' ' videodrivers` -eq 0 ] || { echo "FAILURE: videodrivers not TAB separated"; exit 1; } && echo "OK: videodrivers" create-archive: - @rm -rf $(NAME)-$(VERSION) $(NAME)-$(VERSION)-$(RELEASE).tar* 2>/dev/null + @rm -rf $(TAGNAME) $(TAGNAME).tar* 2>/dev/null @make changelog - @git archive --format=tar --prefix=$(NAME)-$(VERSION)/ HEAD > $(NAME)-$(VERSION)-$(RELEASE).tar - @mkdir $(NAME)-$(VERSION) - @cp ChangeLog $(NAME)-$(VERSION)/ - @tar --append -f $(NAME)-$(VERSION)-$(RELEASE).tar $(NAME)-$(VERSION) - @bzip2 -f $(NAME)-$(VERSION)-$(RELEASE).tar - @rm -rf $(NAME)-$(VERSION) + @git archive --format=tar --prefix=$(TAGNAME)/ HEAD > $(TAGNAME).tar + @mkdir $(TAGNAME) + @cp ChangeLog $(TAGNAME)/ + @tar --append -f $(TAGNAME).tar $(TAGNAME) + @bzip2 -f $(TAGNAME).tar + @rm -rf $(TAGNAME) @echo "" - @echo "The final archive is in $(NAME)-$(VERSION)-$(RELEASE).tar.bz2" + @echo "The final archive is in $(ARCHIVE)" archive: check clean commit tag create-archive upload: - @scp ${NAME}-$(VERSION)-$(RELEASE).tar.bz2 fedorahosted.org:$(NAME) + @scp $(ARCHIVE) fedorahosted.org:$(NAME) dummy: @@ -82,18 +92,42 @@ srpm-x: create-archive @echo SRPM is: $(NAME)-$(VERSION)-$(RELEASE).src.rpm clean: - @rm -f $(NAME)-*.gz $(NAME)-*.src.rpm + @rm -f $(NAME)-*.gz $(NAME)-*.src.rpm new-pnp.xlsx pnp.ids.txt clog: hwdata.spec @sed -n '/^%changelog/,/^$$/{/^%/d;/^$$/d;s/%%/%/g;p}' $< | tee $@ -download: new-usb-ids new-pci-ids new-oui.txt +download: new-usb-ids new-pci-ids new-oui new-iab new-pnp-ids new-usb-ids: @curl -O http://www.linux-usb.org/usb.ids new-pci-ids: - @curl -O http://pciids.sourceforge.net/pci.ids - -new-oui.txt: - @curl -O http://standards.ieee.org/develop/regauth/oui/oui.txt + @curl -O https://raw.githubusercontent.com/pciutils/pciids/master/pci.ids + +new-oui: + @curl -O http://standards-oui.ieee.org/oui.txt + @dos2unix oui.txt + +new-iab: + @curl -O http://standards-oui.ieee.org/iab/iab.txt + @dos2unix iab.txt + +new-pnp-ids: pnp.ids + +pnp.ids: pnp.ids.txt pnp.ids.patch + patch -o $@ $@ + +new-pnp.xlsx: + @curl -o $@ \ + http://download.microsoft.com/download/7/E/7/7E7662CF-CBEA-470B-A97E-CE7CE0D98DC2/ISA_PNPID_List.xlsx