summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile51
1 files changed, 41 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 09a12e18..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,18 +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
+# 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)
- (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:
+# 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