Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
eoa-publication-model/scripts/init.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
64 lines (52 sloc)
1.88 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
WD=$(pwd) | |
BASE_DIR=$WD/$(dirname $0)/.. | |
DEP_DIR="$BASE_DIR/dependencies" | |
echo "BASE_DIR: '$BASE_DIR'" | |
echo "DEP_DIR: '$DEP_DIR'" | |
# stop on first error | |
set -e | |
mkdir -v -p "$DEP_DIR" | |
function install_git_dep() { | |
local name="$1" | |
local url="$2" | |
local hash="$3" | |
local wd=$(pwd) | |
echo "installing: '$url' (hash '$hash') into '$name'..." | |
cd "$DEP_DIR" | |
if [[ -e "$name" ]]; then | |
echo "already exists - removing it..." | sed 's/^/ /' | |
rm -rf "$name" | |
fi | |
git clone "$url" "$name" 2>&1 | sed 's/^/ /' || (echo "error"; exit 1) | |
cd "$name" | |
git checkout "$hash" 2>&1 &>/dev/null || (echo "error"; exit 1) | |
cd "$wd" | |
} | |
# download TEI repositories: | |
install_git_dep 'TEI' 'https://github.com/TEIC/TEI.git' '7fbbc7c5c2ba533dc70f561b27101dbfa7f519a0' | |
install_git_dep 'Stylesheets' 'https://github.com/TEIC/Stylesheets.git' '2a01be46ee82fce5eba6074359b3d18db2222e0c' | |
install_git_dep 'schematron' 'https://github.com/Schematron/schematron.git' 'e16ecc490f9c6429f275ea268279787a71ff298f' | |
cd "$DEP_DIR" | |
# download some schemata from TEI: | |
mkdir -p tei-schema/rnc | |
mkdir -p tei-schema/rng | |
mkdir -p tei-schema/odd | |
curl -L http://www.tei-c.org/Vault/P5/current/xml/tei/custom/schema/relaxng/tei_all.rnc > "tei-schema/rnc/tei_all.rnc" | |
curl -L http://www.tei-c.org/Vault/P5/current/xml/tei/custom/schema/relaxng/tei_all.rng > "tei-schema/rng/tei_all.rng" | |
curl -L http://www.tei-c.org/Vault/P5/current/xml/tei/odd/p5subset.xml > "tei-schema/odd/p5subset.xml" | |
# download fxsl - a functional programming library for xslt: | |
# website: http://fxsl.sourceforge.net/ | |
mkdir -v -p "fxsl" | |
if [[ -e 'fxsl' ]]; then | |
rm -r 'fxsl' | |
fi | |
wget -P "fxsl" https://sourceforge.net/projects/fxsl/files/FXSL%20for%20XSLT%202/FXSL%202.0/fxsl-xslt2.zip | |
unzip -d "fxsl" "fxsl/*.zip" | |
# patch fxsl: | |
cd "$BASE_DIR" | |
patch -p0 -i patch_fxsl.patch | |
# patch schematron: | |
cd $BASE_DIR | |
patch -p0 -i patch_schematron.patch | |
$BASE_DIR/scripts/update_output.sh |