summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2003-01-29 16:42:19 +0000
committerAndreas Gruenbacher <agruen@suse.de>2003-01-29 16:42:19 +0000
commitaa777ca572b787515d397fc76b13d380153280e5 (patch)
tree24835c4ab1b3404eac9a16963532dcde5f644452 /Makefile
parent40c11c745095aa01e99fd683edb1e29ec6f13e93 (diff)
downloadquilt-aa777ca572b787515d397fc76b13d380153280e5.tar.gz
Add RELEASE to Makefile; generate spec file from template + Makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 22 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 66bc495..437211e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,6 @@
PACKAGE := quilt
VERSION := 0.21
+RELEASE := 1
prefix := /usr/local
bindir := $(prefix)/bin
@@ -14,7 +15,8 @@ CFLAGS = -g -Wall
#-----------------------------------------------------------------------
SRC += COPYING AUTHORS TODO BUGS Makefile \
- quilt.spec quilt.changes
+ quilt.spec.in quilt.spec quilt.changes
+DIRT += quilt.spec
BIN_IN := quilt
BIN_SRC := $(BIN_IN:%=%.in) guards
@@ -70,7 +72,7 @@ bin/guards.1 : bin/guards
mkdir -p $$(dirname $@)
pod2man $< > $@
-dist :
+dist : spec
rm -f $(PACKAGE)-$(VERSION)
ln -s . $(PACKAGE)-$(VERSION)
tar cvfz $(PACKAGE)-$(VERSION).tar.gz \
@@ -96,6 +98,24 @@ install : all
install -d $(BUILD_ROOT)$(mandir)/man1
install -m 644 $(MAN1) $(BUILD_ROOT)$(mandir)/man1/
+spec : $(PACKAGE).spec
+$(PACKAGE).spec : $(PACKAGE).spec.in $(PACKAGE).changes
+ @echo "Generating spec file"
+ @sed -e 's/^\(Version:[ \t]*\).*/\1$(VERSION)/' \
+ -e 's/^\(Release:[ \t]\).*/\1$(RELEASE)/' \
+ < $< > $@
+ @perl -ne ' \
+ m/^(|-+)$$/ and next; \
+ ( \
+ s/^(...) \s (...) \s (.\d) \s (\d\d:\d\d:\d\d) \s \
+ (...) \s (\d\d\d\d) \s - \s (.+) \
+ /* $$1 $$2 $$3 $$6 - $$7/x || \
+ m/^(- | )(?!\s)/ \
+ and print \
+ ) or die "Syntax error in line $$. of changelog:\n$$_\n"; \
+ ' $(PACKAGE).changes \
+ | lib/parse-patch -u changelog $@
+
clean distclean :
rm -f $(DIRT)