]> mj.ucw.cz Git - diplomky.git/blob - mkdist
PDF/A: Opraveno použití GhostScriptu (prepress bez lomítka)
[diplomky.git] / mkdist
1 #!/bin/bash
2 set -e
3 export LC_ALL=cs_CZ
4
5 for a in bp dp phd ; do
6         rm -rf vzor-$a{,.zip}
7         git archive --prefix=vzor-$a/ HEAD | tar xf -
8         (
9                 cd vzor-$a
10                 rm -rf mkdist upload uprava slides TODO
11                 (
12                         date +'%Y-%m-%d'
13                         echo -n 'Git commit: '
14                         git rev-parse HEAD
15                 ) >VERSION
16         )
17 done
18
19 # BP
20 (
21         echo "Generating BP"
22         cd vzor-bp
23         # Nothing to do at the moment :)
24 )
25
26 # DP
27 (
28         echo "Generating DP"
29         cd vzor-dp
30         sed -i '
31                 s/bakalářsk/diplomov/g
32                 s/BAKALÁŘSK/DIPLOMOV/g
33                 s/bachelor/master/g
34                 s/BACHELOR/MASTER/g
35                 s/bp_uprava/dp_uprava/g
36         ' */*.tex README
37         if grep -Eri 'bakal|bachel' . ; then
38                 echo >&2 "Substitutions failed"
39                 exit 1
40         fi
41 )
42
43 # PhD
44 (
45         echo "Generating PhD"
46         cd vzor-phd
47         sed -i '
48                 s/bakalářská/disertační/g
49                 s/bakalářské/disertační/g
50                 s/bakalářských/disertačních/g
51                 s/bakalářskou/disertační/g
52                 s/BAKALÁŘSKÁ/DISERTAČNÍ/g
53                 s/bachelor/doctoral/g
54                 s/BACHELOR/DOCTORAL/g
55                 s/bp_uprava/phd_uprava/g
56                 / Následuje vevázaný /,+2d
57         ' */*.tex README
58         if grep -Eri 'bakal|bachel' . ; then
59                 echo >&2 "Substitutions failed"
60                 exit 1
61         fi
62 )
63
64 for a in bp dp phd ; do
65         (
66                 cd vzor-$a/cs
67                 make
68                 mv prace.pdf vzor.pdf
69                 make clean
70         )
71         (
72                 cd vzor-$a/en
73                 make
74                 mv thesis.pdf example.pdf
75                 make clean
76         )
77         (
78                 cd vzor-$a
79                 sed -i '
80                         /^%\+ *NEMICEPS/N
81                         /^%\+ *SPECIMEN/,/^%\+ *NEMICEPS/d
82                         s/ *\\X{[^}]*}//
83                         /^\\XXX{/d
84                 ' */*.tex
85         )
86 done
87
88 for a in bp dp phd ; do
89         zip -r vzor-$a.zip vzor-$a
90 done