1 | #!/bin/bash
|
---|
2 |
|
---|
3 | top_dir=`pwd`
|
---|
4 | shared_dir=`pwd`/../shared
|
---|
5 | source_dir=`pwd`/xml-source
|
---|
6 | processing_dir=`pwd`/processing
|
---|
7 | output_dir=`pwd`/build
|
---|
8 | fop_dir="$shared_dir/fop"
|
---|
9 | export CLASSPATH=$CLASSPATH:$shared_dir:$fop_dir/build/fop.jar:$fop_dir/lib
|
---|
10 | export JAVA_OPTS="-Xmx1024M $JAVA_OPTS"
|
---|
11 |
|
---|
12 | if [ ! -d $output_dir ]; then
|
---|
13 | mkdir $output_dir
|
---|
14 | fi
|
---|
15 |
|
---|
16 | #sus out what manuals to build
|
---|
17 | all_manuals="Paper User Develop Install"
|
---|
18 | if [ "$1" == "all" ]; then
|
---|
19 | manuals=$all_manuals
|
---|
20 | elif [ "$1" != "" ]; then
|
---|
21 | manuals=$1
|
---|
22 | else
|
---|
23 | echo "choose a manual to work with:"
|
---|
24 | echo "'all' for all the manuals"
|
---|
25 | echo "'User' for the User's Guide"
|
---|
26 | echo "'Develop' for the Developer's Guide"
|
---|
27 | echo "'Install' for the Installer's Guide"
|
---|
28 | echo "'Paper' for From Paper to Collection"
|
---|
29 | echo -n "> "
|
---|
30 | read manuals
|
---|
31 | if [ "$manuals" = "all" ]; then
|
---|
32 | manuals=$all_manuals
|
---|
33 | fi
|
---|
34 | fi
|
---|
35 |
|
---|
36 | #sus out what languages to build in
|
---|
37 | all_langs="en es ru fr ar"
|
---|
38 | if [ "$2" == "all" ]; then
|
---|
39 | langs=$all_langs
|
---|
40 |
|
---|
41 | elif [ "$2" != "" ]; then
|
---|
42 | langs=$2
|
---|
43 | else
|
---|
44 | echo "choose a language to work with out of: $all_langs"
|
---|
45 | echo "choose 'all' for all languages"
|
---|
46 | echo -n "> "
|
---|
47 | read langs
|
---|
48 | if [ "$langs" = "all" ]; then
|
---|
49 | langs=$all_langs
|
---|
50 | fi
|
---|
51 | fi
|
---|
52 |
|
---|
53 | #show what manuals and languages will be used
|
---|
54 | echo "Manuals: $manuals"
|
---|
55 | echo "Languages: $langs"
|
---|
56 | echo
|
---|
57 |
|
---|
58 | #do it
|
---|
59 | for l in $langs; do
|
---|
60 |
|
---|
61 | if [ ! -d $output_dir/$l ]; then
|
---|
62 | mkdir $output_dir/$l
|
---|
63 | fi
|
---|
64 | if [ ! -d $output_dir/$l/pdf ]; then
|
---|
65 | mkdir $output_dir/$l/pdf
|
---|
66 | fi
|
---|
67 |
|
---|
68 | for m in $manuals; do
|
---|
69 | #hack to preserve old way of specifying manuals
|
---|
70 | if [ "$m" == "u" ]; then m=User;
|
---|
71 | elif [ "$m" == "d" ]; then m=Develop;
|
---|
72 | elif [ "$m" == "i" ]; then m=Install;
|
---|
73 | elif [ "$m" == "p" ]; then m=Paper; fi
|
---|
74 |
|
---|
75 | echo -n "Processing the $m manual in $l..."
|
---|
76 | $fop_dir/fop.sh -c $processing_dir/fop-fonts/userconfig.xml -q -xsl $processing_dir/xml-to-pdf.xsl -xml $source_dir/$l/"$m"_"$l".xml -pdf $output_dir/$l/pdf/"$m"_"$l".pdf
|
---|
77 | echo "done"
|
---|
78 | done
|
---|
79 | done
|
---|