aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Lepied <flepied@mandriva.com>2001-08-21 18:43:53 +0000
committerFrederic Lepied <flepied@mandriva.com>2001-08-21 18:43:53 +0000
commit9ef9705af2e0fa3a649c0b3b15e90b8d52607277 (patch)
tree4713ec638db14935a4a665166aac5b32a8fd26aa
parent0b400e354bd3304218673a1f23ef6e767ac9afe2 (diff)
downloadspec-helper-9ef9705af2e0fa3a649c0b3b15e90b8d52607277.tar
spec-helper-9ef9705af2e0fa3a649c0b3b15e90b8d52607277.tar.gz
spec-helper-9ef9705af2e0fa3a649c0b3b15e90b8d52607277.tar.bz2
spec-helper-9ef9705af2e0fa3a649c0b3b15e90b8d52607277.tar.xz
spec-helper-9ef9705af2e0fa3a649c0b3b15e90b8d52607277.zip
added rules to build test and release rpm.
-rw-r--r--Makefile72
1 files changed, 43 insertions, 29 deletions
diff --git a/Makefile b/Makefile
index 0577bc7..5305eaf 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
#---------------------------------------------------------------
-# Project : Linux-Mandrake
+# Project : Mandrake Linux
# Module : spec-helper
# File : Makefile
# Version : $Id$
@@ -7,51 +7,65 @@
# Created On : Fri Feb 18 08:11:21 2000
#---------------------------------------------------------------
-VERSION=0.4
+PACKAGE=spec-helper
+VERSION:=$(shell grep '%define *version ' $(PACKAGE).spec| cut -d ' ' -f 3)
+RELEASE:=$(shell grep '%define *release ' $(PACKAGE).spec| cut -d ' ' -f 3)
+TAG := $(shell echo "V$(VERSION)_$(RELEASE)" | tr -- '-.' '__')
+
FILES= spec-helper clean_files clean_perl compress_files strip_files relative_me_babe lib_symlinks
-DISTFILES= Makefile ChangeLog Howto-spec-helper $(FILES) macroszification
-NAME=spec-helper
-DIST=$(NAME)-$(VERSION)
+DISTFILES= Makefile ChangeLog Howto-spec-helper $(FILES) macroszification spec-helper.spec
bindir=/usr/bin
all:
@echo "use make install or make dist"
-dist:
- rm -f $(NAME)-$(VERSION).tar.bz2
- rm -rf $(DIST)
- mkdir $(DIST)
- ln $(DISTFILES) $(DIST)
- tar cvf $(NAME)-$(VERSION).tar $(DIST)
- bzip2 -9vf $(NAME)-$(VERSION).tar
- rm -rf $(DIST)
-
install:
install -d -m755 $(bindir)
install -m755 macroszification $(bindir)/
install -d -m 755 $(DESTDIR)/usr/share/spec-helper
install -m 755 $(FILES) $(DESTDIR)/usr/share/spec-helper
-dis:
- rm -rf $(NAME)-$(VERSION) ../$(NAME)-$(VERSION).tar*
- mkdir -p $(NAME)-$(VERSION)
- ln $(DISTFILES) $(NAME)-$(VERSION)
- tar cvf ../$(NAME)-$(VERSION).tar $(NAME)-$(VERSION)
- bzip2 -9vf ../$(NAME)-$(VERSION).tar
- rm -rf $(NAME)-$(VERSION)
+# 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:
+ ln $(DISTFILES) $(PACKAGE)-$(VERSION)
+
+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 is available in our contrib.
- cvs2cl -U ../common/username -I ChangeLog -I $(NAME).spec
+ cvs2cl -U ../common/username -I ChangeLog
rm -f ChangeLog.bak
cvs commit -m "Generated by cvs2cl the `date '+%d_%b'`" ChangeLog
-rpm: dis
- test -d $(RPM)/SOURCES && test -d $(RPM)/
- cp -f ../$(NAME)-$(VERSION).tar.bz2 $(RPM)/SOURCES
- -rpm -ba --clean --rmsource $(NAME).spec
- rm -f $(NAME)-$(VERSION).tar.bz2
-
# Local variables:
# mode: makefile
# End: