aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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