Fix generation of Windows distribution files
authorEric Biggers <ebiggers3@gmail.com>
Wed, 23 Apr 2014 20:35:14 +0000 (15:35 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Wed, 23 Apr 2014 20:44:49 +0000 (15:44 -0500)
Two problems fixed:

- Meaningless cmd file generated (wimwimlib-imagex.cmd)
- PDF files from sourced man pages defaulted to installed (not in-tree)
  version

make-windows-release

index 697405d..14637e1 100755 (executable)
@@ -38,7 +38,16 @@ cp .libs/imagex.exe $DESTDIR/wimlib-imagex.exe
 cp .libs/libwim-*.dll $DESTDIR
 cp README* NEWS $DESTDIR
 
-for fil in ./doc/wimlib-imagex.1 ./doc/wimlib-imagex-*.1; do
+function genman() {
+       local name=$1
+       local dest=$DESTDIR/doc/${name}.pdf
+
+       echo "Generating $dest"
+
+       MANPATH="./doc" man -t $name | ps2pdf - $dest
+}
+
+for fil in ./doc/man1/wimlib-imagex-*.1; do
        base=`basename $fil`
        base=${base%%.1}
        cmd=$(echo $base | sed s/wimlib-imagex-//)
@@ -46,16 +55,16 @@ for fil in ./doc/wimlib-imagex.1 ./doc/wimlib-imagex-*.1; do
                continue
        fi
 
-       echo $fil
-       #MANWIDTH=80 man $fil | col -b > $DESTDIR/doc/$base
-       man -t $fil | ps2pdf - $DESTDIR/doc/${base}.pdf
+       genman $base
+
        sed 's/$/\r/g' > $DESTDIR/wim${cmd}.cmd <<- EOF
                @echo off
                %~dp0\\wimlib-imagex $cmd %*
        EOF
 done
 
-#for fil in $DESTDIR/{README*,NEWS} $DESTDIR/doc/*; do
+genman wimlib-imagex
+
 for fil in $DESTDIR/{README*,NEWS}; do
        sed < $fil > ${fil}.txt -e 's/$/\r/g'
        rm $fil