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 IMAGE = yotsuba.png
12 TITLE_caveats.gmi = caveats
13 TITLE_index.gmi = home
14 TITLE_install.gmi = install guide
15 TITLE_tutorial.gmi = tutorial
17 SUBST = ./subst CURRV=0.2 NEXTV=0.3 \
18 GH=https://github.com/omar-polo/kamid \
19 CURRSIGN=RWRwqQVDYtY1jTc1lXqyu2e+ZGWgN/h3n/LE/at7pNTuJ1qWsogFvDh8 \
20 NEXTSIGN=RWRfLLIt5kKXfLgtcP6xF/3SlaPOGsBRYl2Tl8husw3pObmkdh/hxqiL
22 SUBST_GEM = ${SUBST} MANEXT=txt EXT=gmi
23 SUBST_WWW = ${SUBST} MANEXT=html EXT=html
25 .PHONY: all dirs manpages server-www serve-gemini upload clean titles
27 all: dirs manpages pages
28 cp style.css www/
29 convert ../art/${IMAGE} -resize 300x300 www/${IMAGE}
31 dirs:
32 mkdir -p gemini
33 mkdir -p www
35 manpages:
36 .for m in ${MANPAGES}
37 ./mdoc2html.sh $m www/${m:T}.html
38 man -O width=65 -Tutf8 -l $m | col -b > gemini/${m:T}.txt
39 .endfor
41 pages:
42 .for p in ${PAGES}
43 grep -v '^<' $p | ${SUBST_GEM} > gemini/$p
45 ${SUBST_WWW} TITLE=${TITLE_${p}:Q} header.html > www/${p:.gmi=.html}
46 ${MAKE} titles | ./menu.pl "${p:.gmi=.html}" >> www/${p:.gmi=.html}
47 ${SUBST_WWW} $p | ./gem2html >> www/${p:.gmi=.html}
48 cat footer.html >> www/${p:.gmi=.html}
49 .endfor
51 serve-www:
52 python3 -m http.server --directory www 8888
54 serve-gemini:
55 gmid -p 1966 ./gemini
57 upload:
58 openrsync --rsync-path=openrsync --del -a www/ antartica:/var/www/kamid.omarpolo.com
59 openrsync --rsync-path=openrsync --del -a gemini/ antartica:/var/gemini/kamid.omarpolo.com
61 clean:
62 rm -rf gemini www
64 titles:
65 .for p in ${PAGES}
66 @printf "%s %s\n" "${p:.gmi=.html}" ${TITLE_${p}:Q}
67 .endfor