summaryrefslogtreecommitdiff
path: root/site/personal/Makefile
diff options
context:
space:
mode:
authorHenry J. Webster <hwebs@hwebs.info>2026-10-31 16:59:51 -0500
committerHenry J. Webster <hwebs@hwebs.info>2026-10-31 16:59:51 -0500
commite528ccb38d1ec35ca2ac0ba42bac757b9fbd0b7b (patch)
tree19510574ec4f54b2003ad4a4eb1b56585cc74057 /site/personal/Makefile
parente0f529195d70404bd68d36cff5e54396a730f357 (diff)
personal: add personal website
Diffstat (limited to 'site/personal/Makefile')
-rw-r--r--site/personal/Makefile60
1 files changed, 60 insertions, 0 deletions
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)'