#!/bin/bash top_dir=`pwd` shared_dir=`pwd`/../shared source_dir=`pwd`/xml-source processing_dir=`pwd`/processing output_dir=`pwd`/build fop_dir="$shared_dir/fop" export CLASSPATH=$CLASSPATH:$shared_dir:$fop_dir/build/fop.jar:$fop_dir/lib if [ ! -d $output_dir ]; then mkdir $output_dir fi #sus out what manuals to build all_manuals="Paper User Develop Install" if [ "$1" == "all" ]; then manuals=$all_manuals elif [ "$1" != "" ]; then manuals=$1 else echo "choose a manual to work with:" echo "'all' for all the manuals" echo "'User' for the User's Guide" echo "'Develop' for the Developer's Guide" echo "'Install' for the Installer's Guide" echo "'Paper' for From Paper to Collection" echo -n "> " read manuals if [ "$manuals" == "all" ]; then manuals=$all_manuals fi fi #sus out what languages to build in all_langs="en es ru fr ar" if [ "$2" == "all" ]; then langs=$all_langs elif [ "$2" != "" ]; then langs=$2 else echo "choose a language to work with out of: $all_langs" echo "choose 'all' for all languages" echo -n "> " read langs if [ "$langs" == "all" ]; then langs=$all_langs fi fi echo "Manuals: $manuals" echo "Languages: $langs" echo for l in $langs; do if [ ! -d $output_dir/$l ]; then mkdir $output_dir/$l fi if [ ! -d $output_dir/$l/pdf ]; then mkdir $output_dir/$l/pdf fi for m in $manuals; do echo "Processing the $m manual in $l" $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 echo "done" done done