Blob


1 MANPAGES = ../kamictl/kamictl.8 \
2 ../kamid/9p.7 \
3 ../kamid/kamid.8 \
4 ../kamid/kamid.conf.5 \
5 ../kamiftp/kamiftp.1 \
6 ../kamiproxy/kamiproxy.1
8 PAGES = index.gmi install.gmi tutorial.gmi caveats.gmi
10 TITLE_caveats.gmi = caveats
11 TITLE_index.gmi = home
12 TITLE_install.gmi = install guide
13 TITLE_tutorial.gmi = tutorial
15 SUBST = ./subst CURRV=0.1 NEXTV=0.2 \
16 GH=https://github.com/omar-polo/kamid \
17 CURRSIGN=RWTaqCGPkA11Nhvo+uW+U1EKASiVo3IxKrQOqLaEtpYDdw5qLzs4a/9T \
18 NEXTSIGN=RWRwqQVDYtY1jTc1lXqyu2e+ZGWgN/h3n/LE/at7pNTuJ1qWsogFvDh8
20 SUBST_GEM = ${SUBST} MANEXT=txt EXT=gmi
21 SUBST_WWW = ${SUBST} MANEXT=html EXT=html
23 .PHONY: all dirs manpages server-www serve-gemini upload clean titles
25 all: dirs manpages pages
26 cp style.css www/
27 convert ../art/tohru.png -resize 300x300 www/tohru.png
29 dirs:
30 mkdir -p gemini
31 mkdir -p www
33 manpages:
34 .for m in ${MANPAGES}
35 ./mdoc2html.sh $m www/${m:T}.html
36 man -O width=65 -Tutf8 -l $m | col -b > gemini/${m:T}.txt
37 .endfor
39 pages:
40 .for p in ${PAGES}
41 grep -v '^<' $p | ${SUBST_GEM} > gemini/$p
43 ${SUBST_WWW} TITLE=${TITLE_${p}:Q} header.html > www/${p:.gmi=.html}
44 ${MAKE} titles | ./menu.pl "${p:.gmi=.html}" >> www/${p:.gmi=.html}
45 ${SUBST_WWW} $p | ./gem2html >> www/${p:.gmi=.html}
46 cat footer.html >> www/${p:.gmi=.html}
47 .endfor
49 serve-www:
50 python3 -m http.server --directory www 8888
52 serve-gemini:
53 gmid -p 1966 ./gemini
55 upload:
56 openrsync --rsync-path=openrsync --del -a www/ antartica:/var/www/kamid.omarpolo.com
57 openrsync --rsync-path=openrsync --del -a gemini/ antartica:/var/gemini/kamid.omarpolo.com
59 clean:
60 rm -rf gemini www
62 titles:
63 .for p in ${PAGES}
64 @printf "%s %s\n" "${p:.gmi=.html}" ${TITLE_${p}:Q}
65 .endfor