From aacff1b269a39c967f84ab33b68f827febee8891 Mon Sep 17 00:00:00 2001 From: Mike Burns Date: Wed, 31 Jul 2013 18:16:01 -0400 Subject: Add a release target The `make release` command will build the Debian package, push the version to a git tag on GitHub, and upload the docs to GitHub pages. This also adds a `deb` target, along with `build-docs`, `upload-docs`, `build-tag`, and `push-tag`. In addition, introduce a `NEWS.md` file. Both `rcm.sh.in` and `NEWS.md.in` will act as input files. This is to abstract over the version number. --- Makefile.am | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index 7e8b686..85c280b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,2 +1,42 @@ AUTOMAKE_OPTIONS = foreign SUBDIRS = man share bin + +.PHONY: release deb-changelog build-tag push-tag deb build-docs upload-docs + +ORIGIN_URL=$(shell git config --get remote.origin.url) + +release: deb push-tag upload-docs + +deb-changelog: NEWS.md + cp -f NEWS.md debian/changelog + +deb: deb-changelog + mkdir /tmp/deb + cp -a . /tmp/deb/rcm-$(PACKAGE_VERSION) + cd /tmp/deb && \ + tar --exclude=*swp --exclude-backups --exclude-vcs --exclude=debian \ + --exclude=config.status --exclude=config.log \ + -zcf rcm_$(PACKAGE_VERSION).orig.tar.gz rcm-$(PACKAGE_VERSION) && \ + cd rcm-$(PACKAGE_VERSION) && \ + debuild -us -uc + cp /tmp/deb/rcm_$(PACKAGE_VERSION)*.deb $(abs_srcdir) + +build-tag: + git tag -f -a v$(PACKAGE_VERSION) -m "Release $(PACKAGE_VERSION)" + +push-tag: build-tag + git push origin --tags + +build-docs: + git clone --branch gh-pages --single-branch . gh-pages && \ + for i in lsrc.1 mkrc.1 rcm.7 rcrc.5 rcup.1; do \ + mandoc -Thtml -Oman=%N.%S.html man/$$i > gh-pages/$$i.html ; \ + done ; \ + cp gh-pages/rcm.7.html gh-pages/index.html + +upload-docs: build-docs + cd gh-pages ; \ + git commit -am "update pages" ; \ + git push $(ORIGIN_URL) gh-pages ; \ + cd .. && \ + rm -rf gh-pages -- cgit v1.2.3