summaryrefslogtreecommitdiff
path: root/GNUmakefile
blob: b5cf5444bc25ddf07cf7e7c571322d8fa545864f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
HERE := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))

SOURCE_URL		:= https://git.cryptech.is/
SOURCE_TRAC_DB		:= bikeshed.cryptech.is:/home/trac/db/trac.db
SOURCE_TRAC_ATTACHMENTS := bikeshed.cryptech.is:/home/trac/files/attachments

REPO_HOST := bikeshed.cryptech.is
REPO_PATH := /usr/local/git/repositories

HTTP_HOST := $(shell hostname -f)
HTTP_PORT := 8000

all: trac-to-pelican-home.md
	tools/extract.py --source-url ${SOURCE_URL}
	ln -f trac-to-pelican-home.md pelican/content/trac-to-pelican-home.md
	./kludge-cgit-urls.py
	./kludge-camelcase-oopsies.py
	mv pelican/content/DNSSEC/Requirements.md pelican/content/DNSSEC-Requirements.md
	rmdir pelican/content/DNSSEC
	cd pelican; pelican --output website --settings pelicanconf.py --fatal errors content

trac-to-pelican-home.md: tools/trac-to-pelican-home.md
	(date '+Date: %Y-%m-%d %H:%M'; cat $<) > $@

fetch:
	rsync -aP --delete ${SOURCE_TRAC_DB} ${SOURCE_TRAC_ATTACHMENTS} .
	ssh -n ${REPO_HOST} 'sudo find ${REPO_PATH} -name "*.git"' | \
	sed s=${REPO_PATH}/== | sort | jq -Rn '[inputs]' >repositories.json

clean:
	rm -rf wiki pelican

distclean: clean
	rm -rf trac.db attachments

server:
	@echo http://${HTTP_HOST}:${HTTP_PORT}/
	python3 -m http.server --directory pelican/website --bind ${HTTP_HOST} ${HTTP_PORT}

check:
	linkchecker pelican/website

.PHONY: all clean fetch distclean server check