| 1 |
# |
| 2 |
# Keyringer Makefile by Silvio Rhatto (rhatto at riseup.net). |
| 3 |
# |
| 4 |
# This Makefile is free software; you can redistribute it and/or modify it |
| 5 |
# under the terms of the GNU General Public License as published by the Free |
| 6 |
# Software Foundation; either version 3 of the License, or any later version. |
| 7 |
# |
| 8 |
# This Makefile is distributed in the hope that it will be useful, but WITHOUT |
| 9 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 10 |
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
| 11 |
# |
| 12 |
# You should have received a copy of the GNU General Public License along with |
| 13 |
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
| 14 |
# Place - Suite 330, Boston, MA 02111-1307, USA |
| 15 |
# |
| 16 |
|
| 17 |
PACKAGE = keyringer |
| 18 |
VERSION = $(shell ./keyringer | head -n 1 | cut -d ' ' -f 2) |
| 19 |
PREFIX ?= /usr/local |
| 20 |
MANDIR ?=$(PREFIX)/share/man |
| 21 |
ARCHIVE ?= tarballs |
| 22 |
INSTALL = /usr/bin/install |
| 23 |
|
| 24 |
clean: |
| 25 |
find . -name *~ | xargs rm -f # clean local backups |
| 26 |
|
| 27 |
install_lib: |
| 28 |
$(INSTALL) -D -m 0755 lib/keyringer/functions $(DESTDIR)/$(PREFIX)/lib/$(PACKAGE)/functions |
| 29 |
$(INSTALL) -D -m 0755 -d lib/keyringer/actions $(DESTDIR)/$(PREFIX)/lib/$(PACKAGE)/actions |
| 30 |
$(INSTALL) -D -m 0755 lib/keyringer/actions/* $(DESTDIR)/$(PREFIX)/lib/$(PACKAGE)/actions |
| 31 |
$(INSTALL) -D -m 0755 -d share/keyringer/editors $(DESTDIR)/$(PREFIX)/share/$(PACKAGE)/editors |
| 32 |
$(INSTALL) -D -m 0644 share/keyringer/editors/* $(DESTDIR)/$(PREFIX)/share/$(PACKAGE)/editors |
| 33 |
|
| 34 |
install_bin: |
| 35 |
$(INSTALL) -D -m 0755 keyringer $(DESTDIR)/$(PREFIX)/bin/keyringer |
| 36 |
|
| 37 |
install_doc: |
| 38 |
$(INSTALL) -D -m 0644 index.md $(DESTDIR)/$(PREFIX)/share/doc/$(PACKAGE)/README.md |
| 39 |
$(INSTALL) -D -m 0644 LICENSE $(DESTDIR)/$(PREFIX)/share/doc/$(PACKAGE)/LICENSE |
| 40 |
|
| 41 |
install_man: |
| 42 |
$(INSTALL) -D -m 0644 share/man/keyringer.1 $(DESTDIR)/$(MANDIR)/man1/keyringer.1 |
| 43 |
|
| 44 |
install_completion: |
| 45 |
$(INSTALL) -D -m 0644 lib/keyringer/completions/bash/keyringer $(DESTDIR)/$(PREFIX)/share/bash-completion/completions/keyringer |
| 46 |
$(INSTALL) -D -m 0644 lib/keyringer/completions/zsh/_keyringer $(DESTDIR)/$(PREFIX)/share/zsh/site-functions/_keyringer |
| 47 |
|
| 48 |
install: clean |
| 49 |
@make install_lib install_bin install_doc install_man install_completion |
| 50 |
|
| 51 |
build_man: |
| 52 |
# Pipe output to sed to avoid http://lintian.debian.org/tags/hyphen-used-as-minus-sign.html |
| 53 |
# Fixed in http://johnmacfarlane.net/pandoc/releases.html#pandoc-1.10-2013-01-19 |
| 54 |
pandoc -s -w man share/man/keyringer.1.md -o share/man/keyringer.1 |
| 55 |
sed -i -e 's/--/\\-\\-/g' share/man/keyringer.1 |
| 56 |
|
| 57 |
tarball: |
| 58 |
mkdir -p $(ARCHIVE) |
| 59 |
git archive --prefix=keyringer-$(VERSION)/ --format=tar HEAD | bzip2 > $(ARCHIVE)/keyringer-$(VERSION).tar.bz2 |
| 60 |
|
| 61 |
release: |
| 62 |
@make build_man |
| 63 |
git commit -a -m "Keyringer $(VERSION)" |
| 64 |
# See https://github.com/nvie/gitflow/issues/87 |
| 65 |
# https://github.com/nvie/gitflow/pull/160 |
| 66 |
# https://github.com/nvie/gitflow/issues/50 |
| 67 |
#git flow release finish -s -m "Keyringer $(VERSION)" $(VERSION) |
| 68 |
#git flow release finish -s $(VERSION) |
| 69 |
git checkout master |
| 70 |
git merge develop |
| 71 |
@make tarball |
| 72 |
gpg --use-agent --armor --detach-sign --output $(ARCHIVE)/keyringer-$(VERSION).tar.bz2.asc $(ARCHIVE)/keyringer-$(VERSION).tar.bz2 |
| 73 |
scp $(ARCHIVE)/keyringer-$(VERSION).tar.bz2* keyringer:/var/sites/keyringer/releases/ |
| 74 |
# We're doing tagging afterwards: |
| 75 |
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=568375 |
| 76 |
#git tag -s $(VERSION) -m "Keyringer $(VERSION)" |
| 77 |
git checkout develop |
| 78 |
|
| 79 |
debian: |
| 80 |
git checkout debian |
| 81 |
gbp import-orig --upstream-vcs-tag=$(VERSION) $(ARCHIVE)/keyringer-$(VERSION).tar.bz2 |
| 82 |
# Fine tune debian/changelog prepared by git-dch |
| 83 |
dch -e |
| 84 |
git commit -a -m "Updating debian/changelog" |
| 85 |
gbp buildpackage --git-tag-only --git-sign-tags --git-ignore-new |
| 86 |
|
| 87 |
web: |
| 88 |
@ikiwiki --setup ikiwiki.yaml |
| 89 |
|
| 90 |
web_deploy: |
| 91 |
@rsync -avz --delete www/ blog:/var/sites/keyringer/www/ |
| 92 |
|
| 93 |
publish: web web_deploy |