summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2016-10-12 11:03:34 +0200
committerErich Eckner <git@eckner.net>2016-10-12 11:03:34 +0200
commit711494e96a3daeeaad0812da915f9556d0866d60 (patch)
tree671b469edf3b33a99b5e1d2c04e63da38872ed7f /Makefile
parentbac03c34f452cac17fff0fe0d091a52e6cbdd15f (diff)
downloadpasswort-tresor-711494e96a3daeeaad0812da915f9556d0866d60.tar.xz
manpage aus hilfe erzeugen
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 17 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index da30bb6..c124f91 100644
--- a/Makefile
+++ b/Makefile
@@ -26,10 +26,22 @@ MANDIR = /usr/share/man
VERSION = 0.2
-all: passwort-tresor passwort-tresor.1
+all: man.commons passwort-tresor passwort-tresor.1
%: %.in
- sed "s/#VERSION#/$(VERSION)/; s@#BINDIR#@$(BINDIR)@; s@#ETCDIR#@$(ETCDIR)@" $< > $@
+ sed " \
+ s/#VERSION#/$(VERSION)/; \
+ s@#BINDIR#@$(BINDIR)@; \
+ s@#ETCDIR#@$(ETCDIR)@; \
+ s@#HELPTEXT#\(\s\+\)#@ --help \1display this help and exit\n --version\1display version and exit@; \
+ " $< > $@
+ [ "$@" = "passwort-tresor" ] && chmod +x "$@" || true
+
+%.1: % man.commons
+ grep -v "^$<(" man.commons | sed '/^\[SEE ALSO]$$/{n;:a;N;/\[/b;s/\n/, /;ta;}' > "$<.common" && \
+ help2man \
+ -n 'Wrapper for gpg to store passwords (and other text)' \
+ -o "$@" -N --include $<.common --no-discard-stderr "./$<"
.PHONY: install dist clean
@@ -39,7 +51,9 @@ install: all
install -D -m0644 passwort-tresor.konf $(DESTDIR)$(ETCDIR)/passwort-tresor.konf
clean:
- rm -f passwort-tresor passwort-tresor.1
+ ls -A | \
+ grep "^\($(shell cat .gitignore | sed 's|\.|\\.|; s|\*|.*|; s|$$|\\|' | tr '\n' '\|' )\)\$$" | \
+ xargs -r rm
dist: clean
git status --porcelain 2> /dev/null | grep -q "\S" && (git add .; git commit -m"neue Version: $(VERSION)") || true