diff options
author | Mike Burns <mike@mike-burns.com> | 2013-07-31 18:16:01 -0400 |
---|---|---|
committer | Mike Burns <mike@mike-burns.com> | 2013-08-01 15:05:19 -0400 |
commit | aacff1b269a39c967f84ab33b68f827febee8891 (patch) | |
tree | 3965aecfe4602e48264df778e5037aa8090cb674 /Makefile.am | |
parent | bc1364d1a195572bf470c81352c01bc8dfec6880 (diff) |
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.
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 40 |
1 files changed, 40 insertions, 0 deletions
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 |