summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorFrederic Lepied <flepied@mandriva.com>2003-03-19 21:09:19 +0000
committerFrederic Lepied <flepied@mandriva.com>2003-03-19 21:09:19 +0000
commitd1c63791b4427df5da3e17c4e4ea4ddeb4cab7b6 (patch)
tree5495515612292a62da9ab2d2fcd166279510edb0 /Makefile
parent1b2a2a7416303be1c5df9614ebf7fd1ba9b2a2ba (diff)
downloadldetect-lst-d1c63791b4427df5da3e17c4e4ea4ddeb4cab7b6.tar
ldetect-lst-d1c63791b4427df5da3e17c4e4ea4ddeb4cab7b6.tar.gz
ldetect-lst-d1c63791b4427df5da3e17c4e4ea4ddeb4cab7b6.tar.bz2
ldetect-lst-d1c63791b4427df5da3e17c4e4ea4ddeb4cab7b6.tar.xz
ldetect-lst-d1c63791b4427df5da3e17c4e4ea4ddeb4cab7b6.zip
added support for standard rpm and localrpm targets.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile55
1 files changed, 42 insertions, 13 deletions
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