[gjs] build: Update release automation from g-i



commit 1b6abf8ecb43985d38f3430cec1c79c8bb672f65
Author: Colin Walters <walters verbum org>
Date:   Wed Jul 27 11:37:29 2011 -0400

    build: Update release automation from g-i

 Makefile.am                      |   36 +++++++++++++++++++++++++++---------
 scripts/verbump.py => verbump.py |    9 +++++----
 2 files changed, 32 insertions(+), 13 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 298fee2..edf0c25 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -192,17 +192,35 @@ include Makefile-test.am
 
 EXTRA_DIST += autogen.sh COPYING.LGPL
 
-prepare-release-tag:
-	TAGNAME=`echo $(PACKAGE) | tr - _ | tr a-z A-Z` \
-	TAGVER=`echo $(VERSION) | sed s/\\\./_/g`; \
-	  git tag -m "Tag $(VERSION)" -a "$$TAGNAME"_"$$TAGVER"
+# Colin's handy Makefile bits for:
+# 1) stuffing tarballs with pre-generated scripts from your workstation
+# 2) bumping configure.ac version post-release
+# 3) tagging correctly in git
+# 4) uploading to gnome.org
+# To use:
+#  $ make check
+#  $ make dist
+#  $ make prepare-minor-release
 
-prepare-minor-release: $(distdir).tar.bz2 prepare-release-tag
-	python $(top_srcdir)/scripts/verbump.py
+# Customize to taste
+TAG_PREFIX=GJS_
+COMPRESSION=.bz2
 
-upload-release: $(distdir).tar.bz2
+
+PACKAGE= PACKAGE@
+VERSION= VERSION@
+DISTNAME=$(PACKAGE)-$(VERSION).tar$(COMPRESSION)
+TAG_VERSION=$(shell echo $(VERSION) |sed s/\\\./_/g)
+
+prepare-release-tag: Makefile
+	git tag -m "Tag $(TAG_VERSION)" -a $(TAG_PREFIX)$(TAG_VERSION)
+
+prepare-minor-release: $(DISTNAME) prepare-release-tag Makefile
+	env top_srcdir=$(top_srcdir) python $(top_srcdir)/verbump.py
+
+upload-release: $(DISTNAME) Makefile
 	git log origin/master..master
 	@echo -n "Ok to push? [y/N] "; read ans; test x$$ans == xy || exit 1
 	git push --tags origin master:master
-	scp $(distdir).tar.bz2 master.gnome.org:
-	ssh master.gnome.org install-module $(distdir).tar.bz2
+	scp $(DISTNAME) master.gnome.org:
+	ssh master.gnome.org install-module $(DISTNAME)
diff --git a/scripts/verbump.py b/verbump.py
similarity index 85%
rename from scripts/verbump.py
rename to verbump.py
index 609498a..cbf6346 100644
--- a/scripts/verbump.py
+++ b/verbump.py
@@ -25,8 +25,9 @@ if not os.path.isfile('config.log'):
 package = _extract_config_log_variable('PACKAGE_TARNAME')
 version = _extract_config_log_variable('VERSION')
 
-f = open('configure.ac');
-newf = open('configure.ac.new', 'w')
+configure_path=os.path.join(os.environ['top_srcdir'], 'configure.ac')
+f = open(configure_path)
+newf = open(configure_path + '.tmp', 'w')
 for line in f:
   m = micro_version_re.match(line)
   if not m:
@@ -38,9 +39,9 @@ for line in f:
   newf.write(micro_version_replace % (newv, ))
 newf.close()
 
-os.rename('configure.ac.new', 'configure.ac')
+os.rename(configure_path + '.tmp', configure_path)
 print "Successfully wrote new 'configure.ac' with post-release version bump"
 
-args=['git', 'commit', '-m', "configure: Post-release version bump", 'configure.ac']
+args=['git', 'commit', '-m', "configure: Post-release version bump", configure_path]
 print "Running: %r" % (args, )
 subprocess.check_call(args)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]