-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.sh
executable file
·67 lines (60 loc) · 1.47 KB
/
package.sh
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
61
62
63
64
65
66
67
#!/bin/bash
PKGNAME=everypage
PKGVERS=2-0-b
PKGCNT=("README.md")
TESTFILES=( )
TESTENGINES=("pdflatex" "lualatex")
build()
{
mkdir -p buildpkg/workdir
cp "$PKGNAME".dtx "$PKGNAME".ins "${PKGCNT[@]}" buildpkg/workdir/
cd buildpkg/workdir
cat > docstrip.cfg <<EOF
\BaseDirectory{.}
\UseTDS
\askforoverwritefalse
EOF
mkdir -p tex/latex/"$PKGNAME"
mkdir -p doc/latex/"$PKGNAME"/examples
tex "$PKGNAME".ins
lualatex "$PKGNAME".dtx
makeindex -s gind.ist "$PKGNAME"
makeindex -s gglo.ist -o "$PKGNAME".gls "$PKGNAME".glo
lualatex "$PKGNAME".dtx
lualatex "$PKGNAME".dtx
cp "$PKGNAME".pdf doc/latex/"$PKGNAME"/
cd -
}
do_test()
{
mkdir -p buildpkg/testdir
cp buildpkg/workdir/tex/latex/"$PKGNAME"/"$PKGNAME".sty buildpkg/testdir
cp buildpkg/workdir/doc/latex/"$PKGNAME"/examples/* buildpkg/testdir
cd buildpkg/testdir
for name in "${TESTFILES[@]}"; do
for engine in "${TESTENGINES[@]}" ; do
$engine "$name"
done
done
cd -
}
package()
{
mkdir -p buildpkg/"$PKGNAME"_"$PKGVERS"
cp "$PKGNAME".dtx "$PKGNAME".ins "${PKGCNT[@]}" \
buildpkg/"$PKGNAME"_"$PKGVERS"/
cp buildpkg/workdir/"$PKGNAME".pdf buildpkg/"$PKGNAME"_"$PKGVERS"/
cd buildpkg
zip -r -9 "$PKGNAME"_"$PKGVERS".zip "$PKGNAME"_"$PKGVERS"
cd -
}
clean()
{
cd buildpkg
rm -fr ./workdir ./testdir ./"$PKGNAME"_"$PKGVERS" ./"$PKGNAME".tds.zip
cd -
}
build
do_test
package
clean