Blob


1 #!/bin/sh
2 #
3 # stuff we should do in the makefile
4 # but can't for portability reasons.
5 # public domain
7 pair()
8 {
9 files="$files $2"
10 dotfiles="$HOME/$1 $dotfiles"
11 xxxfiles="${2%.lp} $xxxfiles"
13 dname=$(dirname "$HOME/$1")
14 cat <<EOF >> Makefile.local
15 $HOME/$1: $2
16 [ ! -d "$dname" ] && mkdir -p "$dname" || true
17 ./lpp \$? > \$@
18 EOF
20 if [ -n "$3" ]; then
21 printf '\tchmod %s $@\n' "$3" >> Makefile.local
22 fi
23 echo >> Makefile.local
24 }
26 conv()
27 {
28 gemfiles="gem/$1.gmi $gemfiles"
29 wwwfiles="www/$1.html $wwwfiles"
30 dname=$(dirname "$1")
31 cat <<EOF >> Makefile.local
32 gem/$1.gmi: $2
33 [ ! -d "gem/$dname" ] && mkdir -p "gem/$dname" || true
34 sed 's/EXT/gmi'/ $2 | ./unpar | ./gc > \$@
36 www/$1.html: gem/$1.gmi header.html footer.html
37 [ ! -d "www/$dname" ] && mkdir -p "www/$dname" || true
38 sed 's!TITLE!$1!' header.html > \$@
39 sed 's/EXT/html/' $2 | ./unpar | ./gc | ./gem2html >> \$@
40 cat footer.html >> \$@
42 EOF
43 }
45 rm -f Makefile.local
47 pair .profile profile.lp
48 pair .kshrc kshrc.lp
49 pair lib/profile rc.lp
50 pair .sqliterc sqliterc.lp
51 pair .psqlrc psqlrc.lp
52 pair .cwmrc cwmrc.lp
54 pair bin/acmerc bin/acmerc.lp +x
55 pair bin/browser bin/browser.lp +x
56 pair bin/sshot bin/sshot.lp +x
58 pair .config/herbstluftwm/autostart config/herbstluftwm/autostart.lp
59 pair .config/herbstluftwm/panel config/herbstluftwm/panel.lp +x
60 pair .config/herbstluftwm/process.awk config/herbstluftwm/process.awk.lp
61 pair .config/herbstluftwm/lib config/herbstluftwm/lib.lp
62 pair .config/herbstluftwm/event-gen config/herbstluftwm/event-gen.lp
64 conv index index.lp
65 for file in $files; do
66 conv "${file%.lp}" "$file"
67 done
69 cat <<EOF >> Makefile.local
70 DOTFILES = $dotfiles
71 GEMFILES = $gemfiles
72 WWWFILES = $wwwfiles
73 XXXFILES = $(printf "%s\n" $xxxfiles | sort | xargs echo)
74 EOF