X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=Makefile.local;h=71525e2c5a07c02bb855ea5b282f78d6d55c888d;hp=bb5d6762c9b091251546a50bd9a9d6dd1536bf86;hb=09aaff13245457f6fcb5c6c5b7d9fdef69567a23;hpb=53fa1ed0a89f2965e387e41509b998dad1e7ab82 diff --git a/Makefile.local b/Makefile.local index bb5d6762..71525e2c 100644 --- a/Makefile.local +++ b/Makefile.local @@ -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 @@ -41,7 +41,8 @@ extra_cxxflags := # Smash together user's values with our extra values FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CFLAGS) $(WARN_CFLAGS) $(CONFIGURE_CFLAGS) $(extra_cflags) FINAL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(CONFIGURE_CXXFLAGS) $(extra_cflags) $(extra_cxxflags) -FINAL_LDFLAGS = $(LDFLAGS) $(CONFIGURE_LDFLAGS) +FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Llib -lnotmuch +FINAL_LIBNOTMUCH_LDFLAGS = $(LDFLAGS) $(CONFIGURE_LDFLAGS) .PHONY: all all: notmuch notmuch-shared notmuch.1.gz @@ -61,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) @@ -74,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: @@ -167,10 +216,10 @@ notmuch_client_srcs = \ notmuch_client_modules = $(notmuch_client_srcs:.c=.o) notmuch: $(notmuch_client_modules) lib/libnotmuch.a - $(call quiet,CC $(CFLAGS)) $^ $(FINAL_LDFLAGS) -o $@ + $(call quiet,CC $(CFLAGS)) $^ $(FINAL_LIBNOTMUCH_LDFLAGS) -o $@ notmuch-shared: $(notmuch_client_modules) lib/libnotmuch.so - $(call quiet,CC $(CFLAGS)) -Llib -lnotmuch $(notmuch_client_modules) $(FINAL_LDFLAGS) -o $@ + $(call quiet,CC $(CFLAGS)) $(notmuch_client_modules) $(FINAL_NOTMUCH_LDFLAGS) -o $@ notmuch.1.gz: notmuch.1 gzip --stdout $^ > $@