From e528ccb38d1ec35ca2ac0ba42bac757b9fbd0b7b Mon Sep 17 00:00:00 2001 From: "Henry J. Webster" Date: Sat, 31 Oct 2026 16:59:51 -0500 Subject: personal: add personal website --- site/personal/Makefile | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 site/personal/Makefile (limited to 'site/personal/Makefile') diff --git a/site/personal/Makefile b/site/personal/Makefile new file mode 100644 index 0000000..4ee3492 --- /dev/null +++ b/site/personal/Makefile @@ -0,0 +1,60 @@ +HOST ?= hwebs@marta + +SOURCE = www-personal +DEPS = .local/src/www-personal +CADDY_SITE = /usr/local/etc/caddy/sites/personal.caddy +CRON = /usr/local/etc/cron.d/www-personal + +COMMONMARK_REPO = https://codeberg.org/spritely/guile-commonmark.git +COMMONMARK_REV = ed3ce543ca2fbcf3312683aad66f19aa933468f6 + +HAUNT_REPO = https://git.dthompson.us/haunt.git +HAUNT_REV = v0.4.0 + +.PHONY: install deploy uninstall + +install: + ssh $(HOST) 'doas /usr/sbin/pkg install -y git guile3 guile-aclocal guile-lib-guile30 autoconf automake gmake pkgconf rsync' + ssh $(HOST) 'set -e; \ + mkdir -p $(DEPS); \ + cd $(DEPS); \ + if [ ! -d guile-commonmark ]; then \ + git clone $(COMMONMARK_REPO); \ + fi; \ + cd guile-commonmark; \ + git fetch --tags origin; \ + git checkout --detach $(COMMONMARK_REV); \ + if [ ! -f .installed-$(COMMONMARK_REV) ]; then \ + ./bootstrap; \ + ./configure --prefix=/usr/local; \ + gmake; \ + doas gmake install; \ + touch .installed-$(COMMONMARK_REV); \ + fi' + ssh $(HOST) 'set -e; \ + mkdir -p $(DEPS); \ + cd $(DEPS); \ + if [ ! -d haunt ]; then \ + git clone $(HAUNT_REPO); \ + fi; \ + cd haunt; \ + git fetch --tags origin; \ + git checkout --detach $(HAUNT_REV); \ + if [ ! -f .installed-$(HAUNT_REV) ]; then \ + ./bootstrap; \ + ./configure --prefix=/usr/local; \ + gmake; \ + doas gmake install; \ + touch .installed-$(HAUNT_REV); \ + fi' + ssh $(HOST) 'doas mkdir -p /usr/local/etc/cron.d' + ssh $(HOST) 'doas sh -c "cat > $(CRON)"' < cron + +deploy: + rsync -az --exclude=.git --exclude=Makefile --exclude=Caddyfile ./ $(HOST):$(SOURCE)/ + ssh $(HOST) 'cd $(SOURCE) && /usr/local/bin/haunt build && /usr/local/bin/haunt publish' + ssh $(HOST) 'doas mkdir -p /usr/local/etc/caddy/sites' + ssh $(HOST) 'doas sh -c "cat > $(CADDY_SITE)"' < Caddyfile + +uninstall: + ssh $(HOST) 'doas rm -f $(CADDY_SITE) $(CRON)' -- cgit v1.3