From d1c63791b4427df5da3e17c4e4ea4ddeb4cab7b6 Mon Sep 17 00:00:00 2001 From: Frederic Lepied Date: Wed, 19 Mar 2003 21:09:19 +0000 Subject: added support for standard rpm and localrpm targets. --- Makefile | 55 ++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 42 insertions(+), 13 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 46c64de2..6b158272 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,11 @@ include Makefile.config -RPM ?= $(HOME)/rpm +PACKAGE = ldetect-lst +VERSION := $(shell rpm -q --qf '%{VERSION}\n' --specfile $(PACKAGE).spec | head -1) +RELEASE := $(shell rpm -q --qf '%{RELEASE}\n' --specfile $(PACKAGE).spec | head -1) +TAG := $(shell echo "V$(VERSION)_$(RELEASE)" | tr -- '-.' '__') + +FILES = AUTHORS ChangeLog Makefile Makefile.config convert err ldetect-lst.spec lst update-ldetect-lst build: make -C lst build @@ -18,20 +23,44 @@ install: build install update-ldetect-lst $(sbindir) install convert/merge2pcitable.pl $(bindir) -rpm: srpm - rpm -bb --clean --rmsource --rmspec $(RPM)/SPECS/$(project).spec - cvs commit +# rules to build a test rpm + +localrpm: localdist buildrpm + +localdist: cleandist dir localcopy tar + +cleandist: + rm -rf $(PACKAGE)-$(VERSION) $(PACKAGE)-$(VERSION).tar.bz2 + +dir: + mkdir $(PACKAGE)-$(VERSION) + +localcopy: + tar c $(FILES) | tar x -C $(PACKAGE)-$(VERSION) -srpm: check clean $(RPM) - cvs update - (echo "# !! DON'T MODIFY HERE, MODIFY IN THE CVS !!" ; \ - cat $(project).spec \ - ) > $(RPM)/SPECS/$(project).spec +tar: + tar cvf $(PACKAGE)-$(VERSION).tar $(PACKAGE)-$(VERSION) + bzip2 -9vf $(PACKAGE)-$(VERSION).tar + rm -rf $(PACKAGE)-$(VERSION) - (cd .. ; tar cfj $(RPM)/SOURCES/$(project).tar.bz2 $(project)) - rpm -bs $(RPM)/SPECS/$(project).spec +buildrpm: + rpm -ta $(PACKAGE)-$(VERSION).tar.bz2 -changelog: - cvs2cl -U ../common/username -I ChangeLog -W 400 +# rules to build a distributable rpm + +rpm: changelog cvstag dist buildrpm + +dist: cleandist dir export tar + +export: + cvs export -d $(PACKAGE)-$(VERSION) -r $(TAG) $(PACKAGE) + +cvstag: + cvs tag $(CVSTAGOPT) $(TAG) + +changelog: ../common/username + cvs2cl -U ../common/username -I ChangeLog rm -f ChangeLog.bak cvs commit -m "Generated by cvs2cl the `date '+%d_%b'`" ChangeLog + +# Makefile ends here -- cgit v1.2.1