aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile74
1 files changed, 57 insertions, 17 deletions
diff --git a/Makefile b/Makefile
index a4098de..16ac04e 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,9 @@ DESTDIR ?= /usr/local
BUILDDIR ?= ./build
MANUAL_FILES = $(addprefix $(BUILDDIR)/,$(patsubst ./%.md,%,$(wildcard ./*.[1-9].md)))
-all: manual $(addprefix $(BUILDDIR)/,lacme lacme-accountd client webserver $(wildcard certs/* config/* snippets/*) certs/ca-certificates.crt)
+all: manual $(addprefix $(BUILDDIR)/,lacme lacme-accountd client webserver \
+ $(wildcard certs/* config/* snippets/*) \
+ certs/ca-certificates.crt certs-staging/ca-certificates.crt)
doc: manual
manual: $(MANUAL_FILES)
@@ -13,13 +15,20 @@ $(MANUAL_FILES): $(BUILDDIR)/%: $(BUILDDIR)/%.md
# used for validation, see https://letsencrypt.org/certificates/
$(BUILDDIR)/certs/ca-certificates.crt: \
- certs/letsencryptauthorityx[34].pem \
- certs/lets-encrypt-x[34]-cross-signed.pem \
+ certs/isrgrootx1.pem \
+ certs/isrg-root-x2.pem \
certs/lets-encrypt-r[34].pem \
- certs/lets-encrypt-r[34]-cross-signed.pem \
certs/lets-encrypt-e[12].pem
- mkdir -pv -- $(BUILDDIR)/certs
- cat $^ >$@
+ mkdir -pv -- $(dir $@)
+ cat -- $^ >$@
+
+# Staging Environment for tests, see https://letsencrypt.org/docs/staging-environment/
+$(BUILDDIR)/certs-staging/ca-certificates.crt: \
+ certs-staging/letsencrypt-stg-root-x[12].pem \
+ certs-staging/letsencrypt-stg-int-r[34].pem \
+ certs-staging/letsencrypt-stg-int-e[12].pem
+ mkdir -pv -- $(dir $@)
+ cat -- $^ >$@
prefix ?= $(DESTDIR)
exec_prefix ?= $(prefix)
@@ -29,12 +38,19 @@ libexecdir ?= $(exec_prefix)/libexec
datarootdir ?= $(prefix)/share
datadir ?= $(datarootdir)
sysconfdir ?= $(prefix)/etc
-localstatedir =? $(prefix)/var
+localstatedir ?= $(prefix)/var
runstatedir ?= $(localstatedir)/run
mandir ?= $(datarootdir)/man
man1dir ?= $(mandir)/man1
man8dir ?= $(mandir)/man8
+lacme_www_user ?= www-data
+lacme_www_group ?= www-data
+lacme_client_user ?= nobody
+lacme_client_group ?= nogroup
+
+acmeapi_server ?= https://acme-v02.api.letsencrypt.org/directory
+
$(BUILDDIR)/%: %
mkdir -pv -- $(dir $@)
cp --no-dereference --preserve=mode,links,xattr -vfT -- "$<" "$@"
@@ -42,25 +58,49 @@ $(BUILDDIR)/%: %
s#@@sbindir@@#$(sbindir)#g; \
s#@@libexecdir@@#$(libexecdir)#g; \
s#@@datadir@@#$(datadir)#g; \
+ s#@@localstatedir@@#$(localstatedir)#g; \
s#@@runstatedir@@#$(runstatedir)#g; \
- s#@@sysconfdir@@#$(sysconfdir)#g;" -- "$@"
+ s#@@sysconfdir@@#$(sysconfdir)#g; \
+ s#@@lacme_www_user@@#$(lacme_www_user)#g; \
+ s#@@lacme_www_group@@#$(lacme_www_group)#g; \
+ s#@@lacme_client_user@@#$(lacme_client_user)#g; \
+ s#@@lacme_client_group@@#$(lacme_client_group)#g; \
+ s#@@acmeapi_server@@#$(acmeapi_server)#g; \
+ " -- "$@"
+
+release:
+ @if ! git diff HEAD --quiet -- ./Changelog ./lacme ./lacme-accountd ./client; 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 ./client && \
+ git commit -m "Prepare new release v$$VERS." \
+ -- ./Changelog ./lacme ./lacme-accountd ./client && \
+ 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
- install -m0644 -vDt $(datadir)/lacme $(BUILDDIR)/certs/*
- install -m0755 -vDt $(libexecdir)/lacme $(BUILDDIR)/client $(BUILDDIR)/webserver
- install -m0644 -vDt $(man1dir) $(BUILDDIR)/lacme-accountd.1
- install -m0644 -vDt $(man8dir) $(BUILDDIR)/lacme.8
- install -m0644 -vDt $(bindir) $(BUILDDIR)/lacme-accountd
- install -m0644 -vDt $(sbindir) $(BUILDDIR)/lacme
+ install -m0644 -vDt $(sysconfdir)/lacme -- $(BUILDDIR)/config/*.conf $(BUILDDIR)/snippets/*.conf
+ install -m0755 -vd -- $(sysconfdir)/lacme/lacme-certs.conf.d
+ install -m0644 -vDt $(datadir)/lacme -- $(BUILDDIR)/certs/*
+ install -m0755 -vDt $(libexecdir)/lacme -- $(BUILDDIR)/client $(BUILDDIR)/webserver
+ install -m0644 -vDt $(man1dir) -- $(BUILDDIR)/lacme-accountd.1
+ install -m0644 -vDt $(man8dir) -- $(BUILDDIR)/lacme.8
+ install -m0755 -vDt $(sbindir) -- $(BUILDDIR)/lacme
+ install -m0755 -vDt $(bindir) -- $(BUILDDIR)/lacme-accountd
+ install -m0755 -vdD -- $(sysconfdir)/apache2/conf-available
+ ln -sv -- ../../lacme/apache2.conf $(sysconfdir)/apache2/conf-available/lacme.conf
uninstall:
rm -vf -- $(bindir)/lacme-accountd $(sbindir)/lacme
rm -vf -- $(man1dir)/lacme-accountd.1 $(man8dir)/lacme.8
rm -rvf -- $(sysconfdir)/lacme $(datadir)/lacme $(libexecdir)/lacme
+ rm -vf -- $(sysconfdir)/apache2/conf-available/lacme.conf
clean:
rm -rvf -- $(BUILDDIR)
-.PHONY: all doc manual install uninstall clean
+.PHONY: all doc manual release install uninstall clean