summary refs log tree commit diff
path: root/www/git.causal.agency/Makefile
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-09-30 20:27:09 +0000
committerJune McEnroe <june@causal.agency>2021-09-30 22:57:04 +0000
commit957c7fdb0bd1c0a504d39808c92b47dafcd55b12 (patch)
tree8fb401be2060e4966b617e367197e0798c304315 /www/git.causal.agency/Makefile
parentSilence owner-info error (diff)
downloadsrc-957c7fdb0bd1c0a504d39808c92b47dafcd55b12.tar.gz
src-957c7fdb0bd1c0a504d39808c92b47dafcd55b12.zip
Build and copy static binaries to /var/www
Ideally these wouldn't require sh, cat, rm, mktemp.
Diffstat (limited to '')
-rw-r--r--www/git.causal.agency/Makefile52
1 files changed, 40 insertions, 12 deletions
diff --git a/www/git.causal.agency/Makefile b/www/git.causal.agency/Makefile
index 638c21e7..76c93d3a 100644
--- a/www/git.causal.agency/Makefile
+++ b/www/git.causal.agency/Makefile
@@ -1,20 +1,48 @@
-ETC = /usr/local/etc
-WWW = /usr/local/www/cgit
-LIBEXEC = /usr/local/libexec
+PREFIX = /var/www
+CONFDIR = ${PREFIX}/conf
+DATADIR = ${PREFIX}/cgit
+BINDIR = ${PREFIX}/bin
 
-BIN = ../../bin
-BINS = about-filter source-filter owner-filter hilex htagml mtags
+BINS += about-filter
+BINS += cat
+BINS += compress
+BINS += ctags
+BINS += email-filter
+BINS += gzip
+BINS += hilex
+BINS += htagml
+BINS += mandoc
+BINS += mktemp
+BINS += mtags
+BINS += owner-filter
+BINS += rm
+BINS += sh
+BINS += source-filter
 
 all: ${BINS}
 
-install: cgitrc custom.css ${BINS}
-	install -m 644 cgitrc ${ETC}
-	install -m 644 custom.css ${WWW}
-	install ${BINS} ${LIBEXEC}
+cat rm sh:
+	cp /bin/$@ $@
+
+compress ctags mandoc mktemp:
+	${MAKE} -C /usr/src/usr.bin/$@ LDFLAGS='-static -pie'
+	mv /usr/src/usr.bin/$@/$@ $@
+	${MAKE} -C /usr/src/usr.bin/$@ clean
+
+gzip: compress
+	cp compress $@
 
-hilex htagml mtags::
-	${MAKE} -C ${BIN} $@
-	ln -f ${BIN}/$@ $@
+hilex htagml mtags:
+	rm -f ../../bin/$@
+	${MAKE} -C ../../bin $@ LDFLAGS='-static -pie'
+	mv ../../bin/$@ $@
+
+install: cgitrc custom.css ${BINS}
+	install -m 644 cgitrc ${CONFDIR}
+	install -m 644 custom.css ${DATADIR}
+	install -d -o www -g daemon ${PREFIX}/cache/cgit
+	install -d -m 1700 -o www -g daemon ${PREFIX}/tmp
+	install ${BINS} ${BINDIR}
 
 clean:
 	rm -f ${BINS}