summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke S. <luke@motimail.com>2008-01-13 15:32:32 +0000
committerLuke S. <luke@motimail.com>2008-01-13 15:32:32 +0000
commitbc220cd6243ed7fe7dae5d1d914386ead26d2cdb (patch)
tree3909ff9bb8fdf444cf7ed710dd9e6c60f6608cf9
parent5fc79050706e12da9f44efbb37471f0be00ef3c4 (diff)
downloadsword-tools-bc220cd6243ed7fe7dae5d1d914386ead26d2cdb.tar.gz
Fixed build script so that each stage is modular as far as possible
git-svn-id: https://www.crosswire.org/svn/sword-tools/trunk@134 07627401-56e2-0310-80f4-f8cd0041bdcd
-rwxr-xr-xmodules/calvinscommentaries/bundle_and_install.sh20
1 files changed, 14 insertions, 6 deletions
diff --git a/modules/calvinscommentaries/bundle_and_install.sh b/modules/calvinscommentaries/bundle_and_install.sh
index 57cbf5b..9ec47b3 100755
--- a/modules/calvinscommentaries/bundle_and_install.sh
+++ b/modules/calvinscommentaries/bundle_and_install.sh
@@ -12,11 +12,18 @@ OSIS2MODOUTPUT="$BUILDDIR/modules/comments/zcom/calvinscommentaries"
CONFDIR="$BUILDDIR/mods.d"
THISDIR=`pwd`
+
+##################
+COMBINED="calvinscommentaries.versified.osis"
+
+
##############################################
function check_requirements {
which csplit > /dev/null || { echo "Cannot find required tool 'csplit'. Exiting."; exit 1;}
which replace > /dev/null || { echo "Cannot find required tool 'replace'. Exiting."; exit 1;}
+ [ -d "$CALCOMSOURCES" ] || { echo "CALCOMSOURCES not set correctly -- please edit this file."; exit 1;}
+ [ -d "$SWORDTOOLS" ] || { echo "SWORDTOOLS not set correctly -- please edit this file."; exit 1;}
}
function setup_dirs {
@@ -92,7 +99,6 @@ function reversify {
done
# Now combine again
- COMBINED="calvinscommentaries.versified.osis"
# Use this cleared up XML instead of the uncleaned stuff in $FIRSTFILEALT
echo '<?xml version="1.0" encoding="UTF-8"?>' > $COMBINED
echo '<osis xmlns="http://www.bibletechnologies.net/2003/OSIS/namespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bibletechnologies.net/2003/OSIS/namespace http://www.bibletechnologies.net/osisCore.2.1.1.xsd">' >> $COMBINED
@@ -110,12 +116,12 @@ function reversify {
function convert_to_mod {
- #######################################################################
+ cd "$BUILDDIR"
# clean out old stuff
- rm "$OSIS2MODOUTPUT/*"
+ rm -f "$OSIS2MODOUTPUT/*"
- # Bug in osis2mod currently -- it removes all whitespace either side
+ # Bug in osis2mod 1.5.9 -- it removes all whitespace either side
# of a newline, so if a sentence has a newline in it, words end
# up merged together. Fix that below:
@@ -132,9 +138,7 @@ function do_zip {
echo "Zipping..."
cp "$THISDIR/calvinscommentaries.conf" "$CONFDIR"
-
cd "$BUILDDIR"
-
rm -f CalvinsCommentaries.zip
zip -r CalvinsCommentaries.zip mods.d/ modules/
}
@@ -142,10 +146,14 @@ function do_zip {
function do_install {
echo "Installing..."
+ cd "$BUILDDIR"
unzip -o -d $HOME/.sword CalvinsCommentaries.zip
}
+# The temporary files from each stage are left behind, so you
+# just comment out the earlier stages if you only want
+# to rerun the later stages.
check_requirements
setup_dirs
combine