]> git.notmuchmail.org Git - notmuch/blobdiff - Makefile.local
Derive version numbers from git
[notmuch] / Makefile.local
index b38370cc278aa256aafd67000c2cd2f0cf369bb5..71525e2c5a07c02bb855ea5b282f78d6d55c888d 100644 (file)
@@ -7,14 +7,14 @@
 # digit when we reach particularly major milestones of usability.
 #
 # Between releases, (such as when compiling notmuch from the git
-# repository), we add a third digit, (0.1.1, 0.1.2, etc.), and
-# increment it occasionally, (such as after a big batch of commits are
-# merged.
+# repository), we let git to append identification of the actual
+# commit.
 PACKAGE=notmuch
-VERSION=0.1
+VERSION:=$(shell if [ -f version ]; then cat version; else git describe --match '[0-9].[0-9]*'; fi)
 
 RELEASE_HOST=notmuchmail.org
 RELEASE_DIR=/srv/notmuchmail.org/www/releases
+RELEASE_URL=http://notmuchmail.org/releases
 TAR_FILE=$(PACKAGE)-$(VERSION).tar.gz
 SHA1_FILE=$(TAR_FILE).sha1
 GPG_FILE=$(SHA1_FILE).asc
@@ -62,7 +62,11 @@ endif
 endif
 
 $(TAR_FILE):
-       git archive --format=tar --prefix=$(PACKAGE)-$(VERSION)/ HEAD | gzip > $(TAR_FILE)
+       git archive --format=tar --prefix=$(PACKAGE)-$(VERSION)/ HEAD > $(TAR_FILE).tmp
+       echo $(VERSION) > version
+       tar --append -f $(TAR_FILE).tmp --transform s_^_$(PACKAGE)-$(VERSION)/_ version
+       rm version
+       gzip < $(TAR_FILE).tmp > $(TAR_FILE)
        @echo "Source is ready for release in $(TAR_FILE)"
 
 $(SHA1_FILE): $(TAR_FILE)
@@ -75,13 +79,57 @@ $(GPG_FILE): $(SHA1_FILE)
 .PHONY: dist
 dist: $(TAR_FILE)
 
+# We invoke make recursively only to force ordering of our phony
+# targets in the case of parallel invocation of make (-j).
 .PHONY: release
-release: release-verify-newer $(TAR_FILE) $(SHA1_FILE) $(GPG_FILE)
+release: release-verify-newer
+       $(MAKE) release-upload
+       @echo "Please send a release announcement as follows:"
+       @echo ""
+       $(MAKE) release-message
+       $(MAKE) release-message > $(PACKAGE)-$(VERSION).announce
+       @echo "(This message is also available in $(PACKAGE)-$(VERSION).announce"
+
+.PHONY: release-upload
+release-upload: $(TAR_FILE) $(SHA1_FILE) $(GPG_FILE)
        mkdir -p releases
        scp $(TAR_FILE) $(SHA1_FILE) $(GPG_FILE) $(RELEASE_HOST):$(RELEASE_DIR)
        mv $(TAR_FILE) $(SHA1_FILE) $(GPG_FILE) releases
        ssh $(RELEASE_HOST) "rm -f $(RELEASE_DIR)/LATEST-$(PACKAGE)-[0-9]* && ln -s $(TAR_FILE) $(RELEASE_DIR)/LATEST-$(PACKAGE)-$(VERSION)"
        git tag -s -m "$(PACKAGE) $(VERSION) release" $(VERSION)
+       git push origin $(VERSION)
+
+.PHONY: release-message
+release-message:
+       @echo "To: notmuch@notmuchmail.org"
+       @echo "Subject: $(PACKAGE) release $(VERSION) now available"
+       @echo ""
+       @echo "Where to obtain notmuch $(VERSION)"
+       @echo "==========================="
+       @echo "  $(RELEASE_URL)/$(TAR_FILE)"
+       @echo ""
+       @echo "Which can be verified with:"
+       @echo ""
+       @echo "  $(RELEASE_URL)/$(SHA1_FILE)"
+       @echo -n "  "
+       @cat releases/$(SHA1_FILE)
+       @echo ""
+       @echo "  $(RELEASE_URL)/$(GPG_FILE)"
+       @echo "  (signed by `getent passwd "$$USER" | cut -d: -f 5 | cut -d, -f 1`)"
+       @echo ""
+       @echo "What's new in notmuch $(VERSION)"
+       @echo "========================="
+       @sed -ne '/^[Nn]otmuch 0.1/{n;n;b NEWS}; d; :NEWS /^===/q; {p;n;b NEWS}' < NEWS | head -n -2
+       @echo ""
+       @echo "What is notmuch"
+       @echo "==============="
+       @echo "Notmuch is a system for indexing, searching, reading, and tagging"
+       @echo "large collections of email messages in maildir or mh format. It uses"
+       @echo "the Xapian library to provide fast, full-text search with a convenient"
+       @echo "search syntax."
+       @echo ""
+       @echo "For more about notmuch, see http://notmuchmail.org"
+
 
 .PHONY: release-verify-version
 release-verify-version: