summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2011-07-25 17:20:36 -0400
committerColin Walters <walters@verbum.org>2011-07-27 09:12:16 -0400
commitb3968c6d7caeaf8ab324fc8e94424a4cbd1c9a85 (patch)
treec62fb79bd895fed3c26d7906fb892baba4a539d7
parent349fc37b29c2e2c9d15c6c53c88f4dd108a94945 (diff)
downloadgobject-introspection-b3968c6d7caeaf8ab324fc8e94424a4cbd1c9a85.tar.gz
build: rework prepare-minor-release bits to handle srcdir != builddir
-rw-r--r--Makefile.am51
-rw-r--r--tools/verbump.py9
2 files changed, 40 insertions, 20 deletions
diff --git a/Makefile.am b/Makefile.am
index 29aee329..4029d658 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -55,22 +55,6 @@ EXTRA_DIST += \
misc/pre-commit \
misc/pyflakes.py
-prepare-release-tag: Makefile
- @TAG=`echo $(VERSION)|sed s/\\\./_/g`;\
- echo "git tag GOBJECT_INTROSPECTION_$$TAG"; \
- git tag -m "Tag $$VERSION" -a \
- GOBJECT_INTROSPECTION_$$TAG
-
-prepare-minor-release: Makefile $(distdir).tar.bz2 prepare-release-tag
- python $(top_srcdir)/tools/verbump.py
-
-upload-release: $(distdir).tar.bz2
- 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
-
check-local:
gtester --verbose $(GTESTER_PROGS)
@test ! -d $(top_srcdir)/.git || (test -f .git/hooks/pre-commit || (echo -e "ERROR: missing \
@@ -83,3 +67,38 @@ check-local:
check-pyflakes:
@echo " CHECK Pyflakes"
@find $(top_srcdir)/giscanner -name \*.py | sort | uniq | xargs $(PYTHON) $(top_srcdir)/misc/pyflakes.py
+
+
+# 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
+
+# Customize to taste
+TAG_PREFIX=GOBJECT_INTROSPECTION_
+COMPRESSION=.bz2
+
+
+PACKAGE=@PACKAGE@
+VERSION=@VERSION@
+DISTNAME=$(PACKAGE)-$(VERSION).tar$(COMPRESSION)
+TAG_VERSION=$(shell echo $(VERSION) |sed s/\\\./_/g)
+
+prepare-release-tag: Makefile.release
+ git tag -m "Tag $(TAG_VERSION)" -a $(TAG_PREFIX)$(TAG_VERSION)
+
+prepare-minor-release: $(DISTNAME) prepare-release-tag
+ env top_srcdir=$(top_srcdir) python $(top_srcdir)/tools/verbump.py
+
+upload-release: $(DISTNAME)
+ 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 $(DISTNAME) master.gnome.org:
+ ssh master.gnome.org install-module $(DISTNAME)
+
diff --git a/tools/verbump.py b/tools/verbump.py
index 4e383729..0c7d593f 100644
--- a/tools/verbump.py
+++ b/tools/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)