3 # Build all the ePub files for Project Aon in a single run
5 # (c) 2011, 2018 Javier Fernandez-Sanguino <jfs@computer.org>
7 # This script is provided with the same license as the one
8 # used in the Project Aon.
13 [ -z "$AONDIR" ] && AONDIR="../../"
14 [ -z "$LANGS" ] && LANGS="en es"
15 LOGDIR="$CURDIR/logs/"
16 [ ! -e "$LOGDIR" ] && mkdir $LOGDIR
17 FONTDIR="../fontfiles/"
19 if [ ! -e "${AONDIR}${FONTDIR}" ] ; then
20 echo "The font directory (${AONDIR}${FONTDIR}) does not exist."
21 echo "Please create it and copy the Souvenir font to it "
22 echo "(or adjust this script to use an alternative directory)"
27 ls ${AONDIR}/${lang}/xml/*.xml |
29 if [ -r "$file" ]; then
30 xml=`basename $file | sed -e 's/\.xml//'`
31 # Look for the XML name in the ePub metadata
32 if grep -q ^$xml $EPUBDATA; then
33 echo -n "Generating ePub file for $xml ('$lang' language)..."
34 LOGFILE=$LOGDIR/$xml.epub.log
37 perl common/scripts/gbtoepub.pl --language=$lang --font-files=$FONTDIR $xml >$LOGFILE 2>&1
39 echo " ERROR building file (review $LOGFILE)"
46 echo "ERROR: Cannot generate ePub file for $xml (not readable)"
53 for lang in $LANGS; do
54 EPUBDATA=${AONDIR}/${lang}/.publisher/rules/epub
55 if [ -e "$EPUBDATA" ] ; then
58 echo "ERROR: Cannot find the publisher rules at $EPUBDATA for $lang"