source: documentation/trunk/manuals/generate-pdf.sh@ 18743

Last change on this file since 18743 was 18743, checked in by oranfry, 15 years ago

avoid out of heap space error and little bash errors

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.7 KB
Line 
1#!/bin/bash
2
3top_dir=`pwd`
4shared_dir=`pwd`/../shared
5source_dir=`pwd`/xml-source
6processing_dir=`pwd`/processing
7output_dir=`pwd`/build
8fop_dir="$shared_dir/fop"
9export CLASSPATH=$CLASSPATH:$shared_dir:$fop_dir/build/fop.jar:$fop_dir/lib
10export JAVA_OPTS="-Xmx1024M $JAVA_OPTS"
11
12if [ ! -d $output_dir ]; then
13 mkdir $output_dir
14fi
15
16#sus out what manuals to build
17all_manuals="Paper User Develop Install"
18if [ "$1" == "all" ]; then
19 manuals=$all_manuals
20elif [ "$1" != "" ]; then
21 manuals=$1
22else
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
34fi
35
36#sus out what languages to build in
37all_langs="en es ru fr ar"
38if [ "$2" == "all" ]; then
39 langs=$all_langs
40
41elif [ "$2" != "" ]; then
42 langs=$2
43else
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
51fi
52
53echo "Manuals: $manuals"
54echo "Languages: $langs"
55echo
56
57for l in $langs; do
58
59 if [ ! -d $output_dir/$l ]; then
60 mkdir $output_dir/$l
61 fi
62 if [ ! -d $output_dir/$l/pdf ]; then
63 mkdir $output_dir/$l/pdf
64 fi
65
66 for m in $manuals; do
67 echo -n "Processing the $m manual in $l..."
68 $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
69 echo "done"
70 done
71done
Note: See TracBrowser for help on using the repository browser.