summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Lidén Borell <samuel@slbdata.se>2010-01-02 17:55:51 +0100
committerSamuel Lidén Borell <samuel@slbdata.se>2010-01-02 22:30:16 +0100
commit8d7f4685ab05f88ad2bbcc52267008238228fab1 (patch)
tree0091bf0ad9f49b8c0fdc722518378348774605e9
parent2efb134d747f479ba8d523845bad660c5ea16f44 (diff)
downloadfribid-8d7f4685ab05f88ad2bbcc52267008238228fab1.tar.gz
fribid-8d7f4685ab05f88ad2bbcc52267008238228fab1.tar.bz2
fribid-8d7f4685ab05f88ad2bbcc52267008238228fab1.zip
A makefile rule that syncs "debian/changelog"
-rw-r--r--Makefile29
1 files changed, 26 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 298083a..ab405fa 100644
--- a/Makefile
+++ b/Makefile
@@ -24,9 +24,12 @@ SUBDIRS=client plugin translations
DISTNAME=`./configure --internal--get-define=BINNAME`-`./configure --internal--get-define=PACKAGEVERSION`
-all clean install uninstall:
+all subdirs-clean install uninstall:
for dir in $(SUBDIRS); do (cd $$dir && $(MAKE) $@) || exit $?; done
+clean: subdirs-clean
+ rm -f ch-all.tmp ch-entry.tmp ch-other.tmp
+
distclean: clean
rm -f common/config.h
@@ -54,7 +57,7 @@ distdebsig: distdeb
for deb in $(DISTDESTDIR)*.deb; do gpg -o $$deb.sig --sign $$deb; done
# Release management
-prepare-release: refresh-release-time set-version
+prepare-release: refresh-release-time set-version sync-changelog
need-version:
@[ -n "$$version" ] || (echo "The \`version' environment variable is not set" > /dev/stderr; false)
@@ -66,5 +69,25 @@ refresh-release-time:
set-version: need-version
sed -ri 's/(#define PACKAGEVERSION\s+")([^"]+)(")/\1'$$version'\3/' common/defines.h
-.PHONY: all clean dist distdeb distdebsig distclean distsig install prepare-release refresh-release-time uninstall $(SUBDIRS)
+sync-changelog: need-version
+ # This rule syncs debian/changelog with CHANGELOG
+ # Remove the current version (if present)
+ cp debian/changelog ch-other.tmp
+ [ `head -n 1 debian/changelog | sed -r 's/[^\s]+ \(([^)]+)\).*/\1/'` != "$$version" ] || \
+ sed '/--/{:x n;bx}; d' debian/changelog | tail -n +3 > ch-other.tmp # is there a better way?
+ # Debianize the changelog entry for the current version
+ echo "fribid ($$version) unstable; urgency=$${urgency:-low}" > ch-entry.tmp
+ echo >> ch-entry.tmp
+ sed "/^$$version - /{:x /^\n*$$/Q; n;bx };d" CHANGELOG | tail -n +2 >> ch-entry.tmp
+ echo >> ch-entry.tmp
+ echo " -- "`git config --get user.name`" <"`git config --get user.email`"> "`date -R` >> ch-entry.tmp
+ echo >> ch-entry.tmp
+ # Merge and add the changelog entry
+ cat ch-entry.tmp ch-other.tmp > ch-all.tmp
+ echo "$$version" | grep -qvF '-' \
+ && mv ch-all.tmp debian/changelog \
+ || echo "Debian versions entries are not synced from CHANGELOG"
+ rm -f ch-all.tmp ch-entry.tmp ch-other.tmp
+
+.PHONY: all clean dist distdeb distdebsig distclean distsig install need-version prepare-release refresh-release-time set-version subdirs-clean sync-changelog uninstall $(SUBDIRS)