summaryrefslogtreecommitdiff
path: root/language/sanskrit/build-ctan-dist.sh
blob: b2ce5d400e77dfc2b00fa16d36efef95e9ba20ff (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/sh

set -e
set -x

command_exists() {
    type "$1" &> /dev/null ;
}

if command_exists pandoc ; then
    pandoc --smart \
           --verbose \
           -f markdown-raw_tex \
           -t latex \
           -o README.pdf \
           README.md
fi

${CC:-cc} -o skt skt.c

./skt sktdoc.skt sktdoc.tex

latexmk -gg -ps sktdoc.tex

latexmk -g -pdf sktdoc.tex

rm -f ./ps-type1/sktdoc.pdf
ln ./sktdoc.pdf ./ps-type1/sktdoc.pdf

chmod -R +r .

list_files() {
    find ./ps-type1 -type f \
         \( -name '*.pfb' \
         -o -name '*.map' \
         -o -name 'sktdoc.pdf' \
         -o -name 'README' \
         \) -print

    find . -maxdepth 1 -type f \
         \( -name '*.sh' \
         -o -name '*.mf' \
         -o -name '*.tfm' \
         -o -name '*.fd' \
         -o -name '*.sty' \
         -o -name '*.c' \
         -o -name 'sktdoc.ps' \
         -o -name 'sktdoc.pdf' \
         -o -name 'sktdoc.skt' \
         -o -name 'README.md' \
         -o -name 'README.pdf' \
         \) -print
}

list_files | sort | \
    tar -cvvzf sanskrit.tar.gz \
        -T - \
        --transform 's,^\./,sanskrit/,' \
        --owner=sanskrit \
        --group=ctan