aboutsummaryrefslogblamecommitdiff
path: root/GNUmakefile
blob: 7fbdb88ffe9c8eec84da59886d292fafc68e1ba5 (plain) (tree)
1
2
3
4
5
6
7
8
9
10









                                                                            
                                            
                                                   
                             

                                                                                             



                                                                      















                                                                           
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


all: pelican/content/trac-to-pelican-home.md
	tools/extract.py --source-url ${SOURCE_URL}
	./kludge-cgit-urls.py
	cd pelican; pelican --output website --settings pelicanconf.py --fatal errors content

pelican/content/trac-to-pelican-home.md: tools/trac-to-pelican-home.md
	mkdir -p $(dir $@)
	(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

webfsd:
	@echo http://$$(hostname):8000/
	webfsd -r pelican/website -4 -L - -F -f index.html

.PHONY: all clean fetch distclean webfsd