imagex-update.1.in: Explain --command quoting
[wimlib] / make-windoze-release
1 #!/bin/bash
2
3 set -e -u
4
5 if true; then
6         DESTDIR=/mnt/tmp/wimlib
7         ARCH=i686
8 else
9         DESTDIR=/mnt/tmp/wimlib-x64
10         ARCH=x86_64
11 fi
12
13 VERSION=$(grep 'This is wimlib version' README | grep -o '[0-9]\+\.[0-9]\+\.[0-9]')
14 ZIPFILE=wimlib-${VERSION}-windows-${ARCH}-bin.zip
15
16 if ! grep -q "./configure --host=${ARCH}-w64-mingw32" config.log; then
17         ./configure --host=${ARCH}-w64-mingw32
18 fi
19
20 make -j2
21
22 rm -f $DESTDIR/{libwim-*.dll,doc/*,README*,NEWS*}
23
24 cp .libs/imagex.exe $DESTDIR/wimlib-imagex.exe
25 cp .libs/libwim-*.dll $DESTDIR
26 cp README* NEWS $DESTDIR
27
28
29
30 for fil in ./doc/wimlib-imagex-*.1; do
31         echo $fil
32         base=`basename $fil`
33         base=${base%%.1}
34         #MANWIDTH=80 man $fil | col -b > $DESTDIR/doc/$base
35         man -t $fil | ps2pdf - $DESTDIR/doc/${base}.pdf
36 done
37
38 #for fil in $DESTDIR/{README*,NEWS} $DESTDIR/doc/*; do
39 for fil in $DESTDIR/{README*,NEWS}; do
40         sed < $fil > ${fil}.txt -e 's/$/\r/g'
41         rm $fil
42 done
43
44
45 rm -f $ZIPFILE
46 (
47         dir=$PWD
48         cd $(dirname $DESTDIR) &> /dev/null
49         zip -r $dir/$ZIPFILE $(basename $DESTDIR)
50 )
51