aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorFrederic Lepied <flepied@mandriva.com>2001-08-09 09:00:48 +0000
committerFrederic Lepied <flepied@mandriva.com>2001-08-09 09:00:48 +0000
commit4c76bd7b1b09ea5c642ad303d9d5bf9958736938 (patch)
treecc4e87d9439ce1941fce85d1fff73597208ea244 /Makefile
parente836c4bddc48d152c66e0b1993ac58607151e2eb (diff)
downloadmsec-4c76bd7b1b09ea5c642ad303d9d5bf9958736938.tar
msec-4c76bd7b1b09ea5c642ad303d9d5bf9958736938.tar.gz
msec-4c76bd7b1b09ea5c642ad303d9d5bf9958736938.tar.bz2
msec-4c76bd7b1b09ea5c642ad303d9d5bf9958736938.tar.xz
msec-4c76bd7b1b09ea5c642ad303d9d5bf9958736938.zip
add rules to build test and release rpms.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile65
1 files changed, 47 insertions, 18 deletions
diff --git a/Makefile b/Makefile
index da996af..71a9d6b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,7 @@
-VERSION = 0.15
-NAME = msec
+PACKAGE = msec
+VERSION := $(shell grep 'Version:' $(PACKAGE).spec| cut -f 2)
+RELEASE := $(shell grep 'Release:' $(PACKAGE).spec| cut -f 2)
+TAG := $(shell echo "V$(VERSION)_$(RELEASE)" | tr -- '-.' '__')
all: promisc_check msec_find
@@ -15,22 +17,6 @@ promisc_check:
msec_find:
(cd src/msec_find && make)
-dis: clean
- rm -rf msec-$(VERSION) ../msec-$(VERSION).tar*
- mkdir -p msec-$(VERSION)
- find . -not -name "msec-$(VERSION)"|cpio -pd msec-$(VERSION)/
- find msec-$(VERSION) -type d -name CVS|xargs rm -rf
- perl -p -i -e 's|^%define version.*|%define version $(VERSION)|' msec.spec
- tar cf ../msec-$(VERSION).tar msec-$(VERSION)
- bzip2 -9f ../msec-$(VERSION).tar
- rm -rf msec-$(VERSION)
-
-rpm: dis ../$(NAME)-$(VERSION).tar.bz2 $(RPM)
- cp -f ../$(NAME)-$(VERSION).tar.bz2 $(RPM)/SOURCES
- cp -f $(NAME).spec $(RPM)/SPECS/
- -rpm -ba --clean --rmsource $(NAME).spec
- rm -f ../$(NAME)-$(VERSION).tar.bz2
-
install:
(mkdir -p $(RPM_BUILD_ROOT)/etc/security/msec)
(mkdir -p $(RPM_BUILD_ROOT)/usr/share/msec)
@@ -51,4 +37,47 @@ install:
install -m644 doc/*8 $(RPM_BUILD_ROOT)/usr/man/man8/
bzip2 -9f $(RPM_BUILD_ROOT)/usr/man/man8/*8
+version:
+ @echo $(VERSION)-$(RELEASE)
+
+# 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: clean
+ find . -not -name "$(PACKAGE)-$(VERSION)"|cpio -pd $(PACKAGE)-$(VERSION)/
+ find $(PACKAGE)-$(VERSION) -type d -name CVS|xargs rm -rf
+
+tar:
+ tar cvf $(PACKAGE)-$(VERSION).tar $(PACKAGE)-$(VERSION)
+ bzip2 -9vf $(PACKAGE)-$(VERSION).tar
+ rm -rf $(PACKAGE)-$(VERSION)
+
+buildrpm:
+ rpm -ta $(PACKAGE)-$(VERSION).tar.bz2
+
+# 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 commit
+ 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