telepathy.am 2.46 KB
Newer Older
1 2 3 4 5
## Useful top-level Makefile.am snippets for Telepathy projects.

dist-hook:
	chmod u+w ${distdir}/ChangeLog
	if test -d ${top_srcdir}/.git; then \
6
		( cd ${top_srcdir} && git log --date=iso $(CHANGELOG_RANGE) ) > ${distdir}/ChangeLog; \
7 8
	fi

9 10 11 12 13 14 15 16 17 18 19 20
distcheck-hook:
	@test "z$(CHECK_FOR_UNRELEASED)" = z || \
	case @VERSION@ in \
		*.*.*.*|*+) ;; \
		*) \
			if grep -r UNRELEASED $(CHECK_FOR_UNRELEASED); \
			then \
				echo "^^^ This is meant to be a release, but some files say UNRELEASED" >&2; \
				exit 2; \
			fi \
			;; \
	esac
21

22
_is-release-check:
23
	@case @VERSION@ in \
24 25
		(*.*.*.*|*+) \
			echo "Hey! @VERSION@ is not a release!" >&2; \
26 27 28
			exit 2; \
			;; \
	esac
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
	@cd ${top_srcdir} && \
	if ! git diff --no-ext-diff --quiet --exit-code; then \
		echo "Hey! Your tree is dirty! No release for you." >&2; \
		exit 2; \
	fi
	@cd ${top_srcdir} && \
	if ! git diff --cached --no-ext-diff --quiet --exit-code; then \
		echo "Hey! You have changes staged! No release for you." >&2; \
		exit 2; \
	fi
if ENABLE_GTK_DOC
else
	@echo "Hey! You need to pass --enable-gtk-doc to configure!"
	@exit 2;
endif

%.tar.gz.asc: %.tar.gz
	$(AM_V_GEN)gpg --detach-sign --armor $@

@PACKAGE@-@VERSION@.tar.gz:
	$(MAKE) _is-release-check
	$(MAKE) check
	$(MAKE) distcheck

maintainer-prepare-release:
	$(MAKE) _is-release-check
	$(MAKE) all
	$(MAKE) distcheck
	$(MAKE) release-mail
	git tag -s @PACKAGE@-@VERSION@ -m @PACKAGE@' '@VERSION@
	gpg --detach-sign --armor @PACKAGE@-@VERSION@.tar.gz

release-mail: NEWS
	$(AM_V_GEN)(python $(top_srcdir)/tools/make-release-mail.py \
		@PACKAGE@ @VERSION@ $(top_srcdir)/NEWS > $@.tmp && \
		mv $@.tmp $@)

maintainer-upload-release: _maintainer-upload-release

_maintainer-upload-release-check: _is-release-check
69 70 71 72 73 74 75 76
	test -f @PACKAGE@-@VERSION@.tar.gz
	test -f @PACKAGE@-@VERSION@.tar.gz.asc
	gpg --verify @PACKAGE@-@VERSION@.tar.gz.asc

_maintainer-upload-release: _maintainer-upload-release-check
	rsync -vzP @PACKAGE@-@VERSION@.tar.gz telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/releases/@PACKAGE@/@PACKAGE@-@VERSION@.tar.gz
	rsync -vzP @PACKAGE@-@VERSION@.tar.gz.asc telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/releases/@PACKAGE@/@PACKAGE@-@VERSION@.tar.gz.asc

77 78 79 80 81 82 83 84
maintainer-make-release:
	$(MAKE) maintainer-prepare-release
	$(MAKE) maintainer-upload-release
	@echo "Now:"
	@echo " • bump the nano-version;"
	@echo " • push the branch and tags upstream; and"
	@echo " • send release-mail to <telepathy@lists.freedesktop.org>."

85
## vim:set ft=automake: