1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bc_thesis/mkdist

103 lines
1.8 KiB
Plaintext

#!/bin/bash
set -e
export LC_ALL=cs_CZ
for a in bp dp phd ; do
rm -rf vzor-$a{,-win,-iso}{,.zip}
git archive --prefix=vzor-$a/ HEAD | tar xf -
(
cd vzor-$a
rm -rf mkdist upload uprava slides TODO
)
done
# BP
(
echo "Generating BP"
cd vzor-bp
# Nothing to do at the moment :)
)
# DP
(
echo "Generating DP"
cd vzor-dp
sed -i '
s/bakalářsk/diplomov/g
s/BAKALÁŘSK/DIPLOMOV/g
s/bachelor/master/g
s/BACHELOR/MASTER/g
s/bp_uprava/dp_uprava/g
' */*.tex README
if grep -Eri 'bakal|bachel' . ; then
echo >&2 "Substitutions failed"
exit 1
fi
)
# PhD
(
echo "Generating PhD"
cd vzor-phd
sed -i '
s/bakalářská/disertační/g
s/bakalářské/disertační/g
s/bakalářských/disertačních/g
s/bakalářskou/disertační/g
s/BAKALÁŘSKÁ/DISERTAČNÍ/g
s/bachelor/doctoral/g
s/BACHELOR/DOCTORAL/g
s/bp_uprava/phd_uprava/g
/ Následuje vevázaný /,+2d
' */*.tex README
if grep -Eri 'bakal|bachel' . ; then
echo >&2 "Substitutions failed"
exit 1
fi
)
for a in bp dp phd ; do
(
cd vzor-$a/cs
make
mv prace.pdf vzor.pdf
make clean
)
(
cd vzor-$a/en
make
mv thesis.pdf example.pdf
make clean
)
(
cd vzor-$a
sed -i '
/^%\+ *NEMICEPS/N
/^%\+ *SPECIMEN/,/^%\+ *NEMICEPS/d
s/ *\\X{[^}]*}//
/^\\XXX{/d
' */*.tex
)
done
for a in bp dp phd ; do
# Basic version (UTF-8)
zip -r vzor-$a.zip vzor-$a
# CP1250 version
cp -a vzor-$a vzor-$a-win
for c in vzor-$a-win/{*/*.tex,README} ; do
recode utf-8..windows-1250 $c
done
sed -i 's/\[utf8]/[cp1250]/g' vzor-$a-win/{cs/prace.tex,en/thesis.tex}
zip -r vzor-$a-win.zip vzor-$a-win
# ISO-8859-2 version
cp -a vzor-$a vzor-$a-iso
for c in vzor-$a-iso/{*/*.tex,README} ; do
recode utf-8..iso-8859-2 $c
done
sed -i 's/\[utf8]/[latin2]/g' vzor-$a-iso/{cs/prace.tex,en/thesis.tex}
zip -r vzor-$a-iso.zip vzor-$a-iso
done