summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 13 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 2a82a8d..a808e4d 100644
--- a/Makefile
+++ b/Makefile
@@ -27,10 +27,18 @@ MANDIR = /usr/share/man
VERSION = 4.0.7
-all: crypt-expiry-check crypt-expiry-check.cron crypt-expiry-check.1
+all: man.commons crypt-expiry-check crypt-expiry-check.cron crypt-expiry-check.1
%: %.in
sed "s/#VERSION#/$(VERSION)/; s@#CRONDIR#@$(CRONDIR)@; s@#BINDIR#@$(BINDIR)@; s@#ETCDIR#@$(ETCDIR)@" $< > $@
+ [ "$@" = "crypt-expiry-check" ] && chmod +x "$@" || true
+
+%.1: % man.commons
+ grep -v "^$<(" man.commons | sed '/^\[SEE ALSO]$$/{n;:a;N;/\[/b;s/\n/, /;ta;}' > "$<.common" && \
+ help2man \
+ -n 'Check expiry of gpg-keys and X.509 certificates' \
+ -h -h -v -Z \
+ -o "$@" -N --include $<.common --no-discard-stderr "./$<"
.PHONY: install dist clean
@@ -41,8 +49,10 @@ install: all
install -D -m0644 -t $(DESTDIR)$(ETCDIR) crypt-expiry.checks
clean:
- rm -f crypt-expiry-check crypt-expiry-check.cron crypt-expiry-check.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
! git tag -d v$(VERSION) 2> /dev/null