aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2010-04-05 15:26:08 -0700
committerCarl Worth <cworth@cworth.org>2010-04-05 15:31:15 -0700
commitcdb6e12d8c32b21ca844e85d35a11033d54f7a01 (patch)
treedcb4f53fe3aaaac5b095e718794248ca1b0c755b
parent680cc4c11a6025da1809528419e923275f8f85b0 (diff)
Makefile: Start implementing a "make release" target.
So far just doing checks that the version is sane and that no release of the same version already exists.
-rw-r--r--Makefile.local29
-rw-r--r--RELEASING2
2 files changed, 28 insertions, 3 deletions
diff --git a/Makefile.local b/Makefile.local
index f9fca0f..78845f3 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -12,6 +12,11 @@
# merged.
NOTMUCH_VERSION=0.1
+RELEASE_HOST=notmuchmail.org
+RELEASE_DIR=/srv/notmuchmail.org/www/releases
+VERSIONED_PACKAGE=notmuch-$(NOTMUCH_VERSION)
+TAR_FILE=$(VERSIONED_PACKAGE).tar.gz
+
# Get settings from the output of configure by running it to generate
# Makefile.config if it doesn't exist yet. And add Makefile.config to
# our global dependency list.
@@ -55,8 +60,28 @@ endif
.PHONY: dist
dist:
- git archive --format=tar --prefix=notmuch-$(NOTMUCH_VERSION)/ HEAD | gzip > notmuch-$(NOTMUCH_VERSION).tar.gz
- @echo "Source is ready for release in notmuch-$(NOTMUCH_VERSION).tar.gz"
+ git archive --format=tar --prefix=$(VERSIONED_PACKAGE)/ HEAD | gzip > $(TAR_FILE)
+ @echo "Source is ready for release in $(TAR_FILE)"
+
+.PHONY: release
+release: release-verify-newer
+
+.PHONY: release-verify-version
+release-verify-version:
+ @echo -n "Checking that $(NOTMUCH_VERSION) is a two-component version..."
+ @if echo $(NOTMUCH_VERSION) | grep -q -v -x '[0-9]*\.[0-9]*'; then \
+ (echo "Ouch." && \
+ echo "Before releasing the notmuch version should be a two-component value." && false);\
+ else :; fi
+ @echo "Good."
+
+.PHONY: release-verify-newer
+release-verify-newer: release-verify-version
+ @echo -n "Checking that no $(NOTMUCH_VERSION) release already exists..."
+ @ssh $(RELEASE_HOST) test ! -e $(RELEASE_DIR)/$(TAR_FILE) \
+ || (echo "Ouch." && echo "Found: $(RELEASE_HOST):$(RELEASE_DIR)/$(TAR_FILE)" \
+ && echo "Refusing to replace an existing release." && false)
+ @echo "Good."
# The user has not set any verbosity, default to quiet mode and inform the
# user how to enable verbose compiles.
diff --git a/RELEASING b/RELEASING
index 3ee69ce..3a1c6dd 100644
--- a/RELEASING
+++ b/RELEASING
@@ -45,7 +45,7 @@ Here are the steps to follow to create a new notmuch release:
Commit this change.
-6) Run "make release-publish" which will perform the following steps:
+6) Run "make release" which will perform the following steps:
* Check that the notmuch version consists of only two components
* Check that no release exists with the current version