blob: bc720bee47f321a90fc8dc91f1fc878ea4acab51 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#!/bin/sh
SPECDOC=${SPECDOC:-virtio-v1.0-csd01}
./make-setup-generated.sh "$SPECDOC"
cp virtio-html.tex $SPECDOC.tex
#uncomment if you have a broken t4ht
#PATH=./t4ht-workaround:${PATH} htlatex $SPECDOC.tex "virtiohtml,info,charset=utf-8" " -cunihtf -utf8"
htlatex $SPECDOC.tex "virtio-html,info,charset=utf-8" " -cunihtf -utf8"
rm $SPECDOC.tex
rm $SPECDOC.aux
mv $SPECDOC.html $SPECDOC.tmp1
sed 's/~~/"/g' $SPECDOC.tmp1 >$SPECDOC.tmp2
sed 's/>~/>"/g' $SPECDOC.tmp2 >$SPECDOC.tmp3
sed 's/>=~/>="/g' $SPECDOC.tmp3 >$SPECDOC.tmp4
sed 's/~</"</g' $SPECDOC.tmp4 >$SPECDOC.tmp5
#For some unclear reason we get 'fi' replaced by NULL character
# on Fedora. file recognizes result as a binary data.
# Detect and work around this.
if test `file -b $SPECDOC.tmp5` = 'data';
then
perl -p -e 's/\0/fi/g' $SPECDOC.tmp5 >$SPECDOC.tmp6
else
cp $SPECDOC.tmp5 $SPECDOC.tmp6
fi
mv $SPECDOC.tmp6 $SPECDOC.html
rm $SPECDOC.tmp*
#uncomment if you have a broken t4ht
#cp ./t4ht-workaround/virtio-v1.0-csd01.css $SPECDOC.css
zip $SPECDOC.zip $SPECDOC.html $SPECDOC.css images/*.png
|