wkd/Makefile

42 lines
1.1 KiB
Makefile
Raw Permalink Normal View History

2024-01-27 12:36:45 +01:00
# SPDX-FileCopyrightText: 2022 David Runge <dave@sleepmap.de>
# SPDX-FileCopyrightText: 2024 Simon Bruder <simon@sbruder.de>
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
# This makefile is inspired by David Runges article
# (https://sleepmap.de/2022/new-pgp-key-id-1793dad5d803a8ffd7451697bb992f9864fad168/)
# and the code for their WKD setup
# (https://git.sleepmap.de/dave/wkd.git/tree/?h=main)
DOMAINS=$(shell cat domains.txt)
KEYS=$(shell cat keys.txt)
DOMAIN_DIRS=$(patsubst %,wkd/.well-known/openpgpkey/%,${DOMAINS})
KEY_PATHS=$(patsubst %,keys/%.asc,${KEYS})
.PHONY: default
default: ${DOMAIN_DIRS}
wkd/.well-known/openpgpkey/%: certring.asc
sq -f wkd generate wkd $(notdir $@) certring.asc
certring.asc: ${KEY_PATHS}
sq -f keyring join -o certring.asc ${KEY_PATHS}
keys: ${KEY_PATHS}
# to allow wildcard rules to be PHONY
.PHONY: always_run
always_run:
keys/%.asc: always_run
gpg --export --armor $(basename $(notdir $@)) > $@
.PHONY: deploy
deploy:
rsync -varP --delete ./wkd/ wkd@openpgpkey.sbruder.de:
.PHONY: clean
clean:
rm -rf certring.asc wkd