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 |
|
---|
11 | if [ ! -d $output_dir ]; then
|
---|
12 | mkdir $output_dir
|
---|
13 | fi
|
---|
14 |
|
---|
15 | #sus out what manuals to build
|
---|
16 | all_manuals="Paper User Develop Install"
|
---|
17 | if [ "$1" == "all" ]; then
|
---|
18 | manuals=$all_manuals
|
---|
19 | elif [ "$1" != "" ]; then
|
---|
20 | manuals=$1
|
---|
21 | else
|
---|
22 | echo "choose a manual to work with:"
|
---|
23 | echo "'all' for all the manuals"
|
---|
24 | echo "'User' for the User's Guide"
|
---|
25 | echo "'Develop' for the Developer's Guide"
|
---|
26 | echo "'Install' for the Installer's Guide"
|
---|
27 | echo "'Paper' for From Paper to Collection"
|
---|
28 | echo -n "> "
|
---|
29 | read manuals
|
---|
30 | if [ "$manuals" == "all" ]; then
|
---|
31 | manuals=$all_manuals
|
---|
32 | fi
|
---|
33 | fi
|
---|
34 |
|
---|
35 | #sus out what languages to build in
|
---|
36 | all_langs="en es ru fr ar"
|
---|
37 | if [ "$2" == "all" ]; then
|
---|
38 | langs=$all_langs
|
---|
39 |
|
---|
40 | elif [ "$2" != "" ]; then
|
---|
41 | langs=$2
|
---|
42 | else
|
---|
43 | echo "choose a language to work with out of: $all_langs"
|
---|
44 | echo "choose 'all' for all languages"
|
---|
45 | echo -n "> "
|
---|
46 | read langs
|
---|
47 | if [ "$langs" == "all" ]; then
|
---|
48 | langs=$all_langs
|
---|
49 | fi
|
---|
50 | fi
|
---|
51 |
|
---|
52 | echo "Manuals: $manuals"
|
---|
53 | echo "Languages: $langs"
|
---|
54 | echo
|
---|
55 |
|
---|
56 | for l in $langs; do
|
---|
57 |
|
---|
58 | if [ ! -d $output_dir/$l ]; then
|
---|
59 | mkdir $output_dir/$l
|
---|
60 | fi
|
---|
61 | if [ ! -d $output_dir/$l/pdf ]; then
|
---|
62 | mkdir $output_dir/$l/pdf
|
---|
63 | fi
|
---|
64 |
|
---|
65 | for m in $manuals; do
|
---|
66 | echo "Processing the $m manual in $l"
|
---|
67 | $fop_dir/fop.sh -c $shared_dir/fop/conf/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
|
---|
68 | echo "done"
|
---|
69 | done
|
---|
70 | done
|
---|