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