Blame


1 7b4d8efb 2022-02-04 op #!/bin/sh
2 7b4d8efb 2022-02-04 op #
3 7b4d8efb 2022-02-04 op # stuff we should do in the makefile
4 7ae13e25 2022-02-04 op # but can't for portability reasons.
5 7ae13e25 2022-02-04 op # public domain
6 7b4d8efb 2022-02-04 op
7 7b4d8efb 2022-02-04 op pair()
8 7b4d8efb 2022-02-04 op {
9 7b4d8efb 2022-02-04 op files="$files $2"
10 c6435c22 2022-02-04 op dotfiles="$HOME/$1 $dotfiles"
11 6b8ba66c 2022-02-04 op xxxfiles="${2%.lp} $xxxfiles"
12 c6435c22 2022-02-04 op
13 c6435c22 2022-02-04 op dname=$(dirname "$HOME/$1")
14 7b4d8efb 2022-02-04 op cat <<EOF >> Makefile.local
15 c6435c22 2022-02-04 op $HOME/$1: $2
16 c6435c22 2022-02-04 op [ ! -d "$dname" ] && mkdir -p "$dname" || true
17 7b4d8efb 2022-02-04 op ./lpp \$? > \$@
18 7b4d8efb 2022-02-04 op EOF
19 7e6fb0e3 2022-02-21 op
20 7e6fb0e3 2022-02-21 op if [ -n "$3" ]; then
21 7e6fb0e3 2022-02-21 op printf '\tchmod %s $@\n' "$3" >> Makefile.local
22 7e6fb0e3 2022-02-21 op fi
23 7e6fb0e3 2022-02-21 op echo >> Makefile.local
24 7b4d8efb 2022-02-04 op }
25 7b4d8efb 2022-02-04 op
26 6b8ba66c 2022-02-04 op conv()
27 6b8ba66c 2022-02-04 op {
28 6b8ba66c 2022-02-04 op gemfiles="gem/$1.gmi $gemfiles"
29 6b8ba66c 2022-02-04 op wwwfiles="www/$1.html $wwwfiles"
30 6b8ba66c 2022-02-04 op cat <<EOF >> Makefile.local
31 6b8ba66c 2022-02-04 op gem/$1.gmi: $2
32 6b8ba66c 2022-02-04 op sed 's/EXT/gmi'/ $2 | ./unpar | ./gc > \$@
33 6b8ba66c 2022-02-04 op
34 6b8ba66c 2022-02-04 op www/$1.html: gem/$1.gmi header.html footer.html
35 6b8ba66c 2022-02-04 op sed 's!TITLE!$1!' header.html > \$@
36 6b8ba66c 2022-02-04 op sed 's/EXT/html/' $2 | ./unpar | ./gc | ./gem2html >> \$@
37 6b8ba66c 2022-02-04 op cat footer.html >> \$@
38 6b8ba66c 2022-02-04 op
39 6b8ba66c 2022-02-04 op EOF
40 6b8ba66c 2022-02-04 op }
41 6b8ba66c 2022-02-04 op
42 7b4d8efb 2022-02-04 op rm -f Makefile.local
43 7b4d8efb 2022-02-04 op
44 37301a13 2022-02-04 op pair .profile profile.lp
45 37301a13 2022-02-04 op pair .kshrc kshrc.lp
46 37301a13 2022-02-04 op pair lib/profile rc.lp
47 72623747 2022-02-04 op pair .sqliterc sqliterc.lp
48 456488bc 2022-02-04 op pair .psqlrc psqlrc.lp
49 7e6fb0e3 2022-02-21 op pair bin/acmerc bin/acmerc.lp +x
50 7e6fb0e3 2022-02-21 op pair bin/browser bin/browser.lp +x
51 7b4d8efb 2022-02-04 op
52 37301a13 2022-02-04 op conv index index.lp
53 7b4d8efb 2022-02-04 op for file in $files; do
54 6b8ba66c 2022-02-04 op conv "${file%.lp}" "$file"
55 7b4d8efb 2022-02-04 op done
56 7b4d8efb 2022-02-04 op
57 7b4d8efb 2022-02-04 op cat <<EOF >> Makefile.local
58 6b8ba66c 2022-02-04 op DOTFILES = $dotfiles
59 7b4d8efb 2022-02-04 op GEMFILES = $gemfiles
60 7b4d8efb 2022-02-04 op WWWFILES = $wwwfiles
61 6b8ba66c 2022-02-04 op XXXFILES = $(printf "%s\n" $xxxfiles | sort | xargs echo)
62 7b4d8efb 2022-02-04 op EOF