Blob


1 RSYNC = openrsync --rsync-path=openrsync
3 MANPAGES = ../telescope.1
5 PAGES = index.gmi \
6 gallery.gmi
7 # changelog.gmi
9 TITLE_index.gmi = Home
10 TITLE_changelog.gmi = ChangeLog
11 TITLE_gallery.gmi = Gallery
13 REPOLOGY_BANNER = https://repology.org/badge/vertical-allrepos/telescope.svg
14 REPOLOGY_URL = https://repology.org/project/telescope/versions
16 SUBST = ./subst CURRV=0.8.1 NEXTV=0.9 \
17 GH=https://github.com/omar-polo/telescope \
18 CURRSIGN=RWQ12hzRNC/1NhZD56pU1YaRg5AYSEWg9gId5M3e9zwuufmwnbd7WrMb \
19 NEXTSIGN=RWSmshjFM8Q0IDYUd4I/8G2q9Y0DUaZLac4enOtQh5rzsIcVF+ePXCy7 \
20 REPOLOGY_BANNER=${REPOLOGY_BANNER} \
21 REPOLOGY_URL=${REPOLOGY_URL}
23 SUBST_GEM = ${SUBST} MANEXT=txt EXT=gmi
24 SUBST_WWW = ${SUBST} MANEXT=html EXT=html
26 .PHONY: all dirs manpages serve-www serve-gemini upload clean titles
28 all: dirs manpages pages
29 cp logo.png gemini/
30 cp mandoc.css style.css www/
31 cp logo.png www/
32 cp -R gallery gemini
33 cp -R gallery www
34 convert logo.png -resize 200x200 www/logo.small.png
36 dirs:
37 mkdir -p gemini www
39 manpages:
40 .for m in ${MANPAGES}
41 man -O style=mandoc.css -Thtml -l $m > www/${m:T}.html
42 man -O width=64 -Tutf8 -l $m | col -b > gemini/${m:T}.txt
43 .endfor
45 pages:
46 .for p in ${PAGES}
47 grep -v '^<' $p | ${SUBST_GEM} > gemini/$p
49 ${SUBST_WWW} TITLE=${TITLE_${p}:Q} header.html > www/$p
50 ${MAKE} titles | ./menu.pl "${p:.gmi=.html}" >> www/$p
51 ${SUBST_WWW} $p | ./gem2html >> www/$p
52 cat footer.html >> www/$p
53 cd www && mv $p ${p:.gmi=.html}
54 .endfor
56 serve-www:
57 python3 -m http.server --directory www 8888
59 serve-gemini:
60 ge -p 1966 gemini
62 upload:
63 ${RSYNC} --del -a gemini/ antartica:/var/gemini/telescope.omarpolo.com
64 ${RSYNC} --del -a www/ antartica:/var/www/telescope.omarpolo.com
66 clean:
67 rm -rf gemini www
69 titles:
70 .for p in ${PAGES}
71 @printf "%s %s\n" "${p:.gmi=.html}" ${TITLE_${p}:Q}
72 .endfor