-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy patharchive
executable file
·71 lines (58 loc) · 1.51 KB
/
archive
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
68
69
70
#!/bin/bash
#
##################################################
DOC="pkgloader"
FILES="$DOC.sty \
$DOC.tex \
$DOC.pdf \
$DOC-dry.sty \
$DOC-packagedoc.cls \
$DOC-early.sty \
$DOC-late.sty \
$DOC-true.sty \
$DOC-false.sty \
$DOC-error.sty \
$DOC-cls-pkg.sty \
$DOC-recommended.sty \
README.md"
VERSION=0.7.0
##################################################
#
### Create a directory to build in
#
mkdir $DOC
cp $FILES $DOC
cd $DOC
### Rename README as per CTAN convention
#
mv README.md README
### Zero out the checksum value
#
sed -r -i 's/\\CheckSum\{[0-9]*\}/\\CheckSum\{0\}/;' $DOC.sty
### First compilation
#
mkdir tmp
pdflatex -output-directory tmp $DOC || exit 1
### Find and put in the correct checksum
#
CHECKSUM=`cat tmp/$DOC.log | grep "The checksum should be" \
| sed -r 's/[^0-9]*([0-9]*)[^0-9]*/\1/'`
sed -r -i "s/\\CheckSum\{0\}/\\CheckSum\{$CHECKSUM\}/;" $DOC.sty
### Create index
#
makeindex -s gglo.ist -o tmp/$DOC.gls tmp/$DOC.glo
makeindex -s gind.ist -o tmp/$DOC.ind tmp/$DOC.idx
### Final two compilations
#
pdflatex -output-directory tmp $DOC || exit 1
pdflatex -output-directory tmp $DOC || exit 1
### Move generated document to build and root dirs
#
mv tmp/$DOC.pdf .
cp $DOC.pdf ../$DOC-$VERSION.pdf
rm -rf tmp
### Tar it up
#
cd ..
tar -czf $DOC-$VERSION.tar.gz $DOC
rm -rf $DOC