aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2021-02-14 23:51:30 +0100
committerGuilhem Moulin <guilhem@fripost.org>2021-02-15 01:31:29 +0100
commit91881351597ce28d8b6448a712396d4432d4a8ba (patch)
tree7bbb4425b73f07180da0539c2f3f9460d85795eb
parentf62a66c6ce82d9a1af241dc3952250362e601d45 (diff)
Makefile: new 'release' target.
-rw-r--r--Makefile16
1 files changed, 15 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index fa830c4..3c8c6bc 100644
--- a/Makefile
+++ b/Makefile
@@ -54,6 +54,20 @@ $(BUILDDIR)/%: %
s#@@lacme_client_group@@#$(lacme_client_group)#g;" \
-- "$@"
+release:
+ @if ! git diff HEAD --quiet -- ./Changelog ./lacme ./lacme-accountd; then \
+ echo "Dirty state, refusing to release!" >&2; \
+ exit 1; \
+ fi
+ VERS=$$(dpkg-parsechangelog -l Changelog -SVersion 2>/dev/null) && \
+ if git rev-parse -q --verify "refs/tags/v$$VERS" >/dev/null; then echo "tag exists" 2>/dev/null; exit 1; fi && \
+ sed -ri "0,/^( -- .*) .*/ s//\\1 $(shell date -R)/" ./Changelog && \
+ sed -ri "0,/^(our\\s+\\\$$VERSION\\s*=\\s*)'[0-9.]+'\\s*;/ s//\\1'$$VERS';/" \
+ -- ./lacme ./lacme-accountd && \
+ git commit -m "Prepare new release v$$VERS." \
+ -- ./Changelog ./lacme ./lacme-accountd && \
+ git tag -sm "Release version $$VERS" "v$$VERS"
+
install: all
install -m0644 -vDt $(sysconfdir)/lacme $(BUILDDIR)/config/*.conf $(BUILDDIR)/snippets/*.conf
install -vd $(sysconfdir)/lacme/lacme-certs.conf.d
@@ -72,4 +86,4 @@ uninstall:
clean:
rm -rvf -- $(BUILDDIR)
-.PHONY: all doc manual install uninstall clean
+.PHONY: all doc manual release install uninstall clean