samer@0: #!/bin/sh samer@9: # ------------------ CONFIG ---------------- samer@0: samer@9: INSTALL_SWI=no samer@11: SS_USER=samer samer@11: MAKE_HUMDRUM=no samer@11: samer@11: # ------------------ END OF CONFIG --------- samer@0: samer@3: function install_swi { samer@11: # cd ~/downloads samer@11: # wget http://www.swi-prolog.org/download/devel/src/pl-7.1.29.tar.gz samer@11: # cd ~/src samer@11: # tar xzf pl-7.1.29.tar.gz samer@9: unpack_into ~/src http://www.swi-prolog.org/download/devel/src/pl-7.1.29.tar.gz samer@9: cd ~/src/pl-7.1.29 samer@3: cp build.templ build samer@3: patch build ~/etc/swipl-build.patch samer@3: ./build samer@3: } samer@3: samer@9: function unpack_into { samer@9: arname=$(basename "$2") samer@11: wget_into ~/downloads "$2" && cd "$1" && tar xzf ~/downloads/$arname samer@11: } samer@11: samer@11: function cp_into { samer@11: name=$(basename "$2") samer@11: mkdir -p "$1" samer@11: wget_into ~/downloads "$2" && cp -p "$name" "$1" samer@9: } samer@0: samer@9: function wget_into { samer@11: name=$(basename "$2") samer@9: mkdir -p "$1" samer@9: cd "$1" samer@11: if [ -a "$name" ]; then samer@11: echo "Aready existing in $1: $2." samer@11: else samer@11: echo "I am going to download into $1 from $2." samer@11: echo "You may be asked for a password." samer@11: wget --user=$SS_USER --ask-password "$2" samer@11: fi samer@9: } samer@9: samer@9: function get_repo_into { samer@9: dest="$1" samer@9: repo="$3" samer@9: cmd=$2 samer@9: shift 3 samer@9: samer@9: name=$(basename "$repo") samer@11: mkdir -p "$dest" samer@9: cd "$dest" samer@9: if [ -d $name ]; then samer@9: echo "$name repository alread present in $dest" samer@9: else samer@9: $cmd clone "$repo" $* samer@9: fi samer@9: } samer@9: samer@9: if [ $INSTALL_SWI == yes ]; then samer@9: install_swi samer@9: fi samer@0: samer@0: # DOWNLOADS FROM REPOs samer@11: get_repo_into ~/src/github git https://github.com/samer--/ClioPatria samer@12: cd ~/src/github/ClioPatria && git checkout dml samer@9: get_repo_into ~/src/github git https://github.com/humdrum-tools/humdrum-tools --recursive samer@11: if [ $MAKE_HUMDRUM == yes ]; then samer@11: cd ~/src/github/humdrum-tools && make samer@11: fi samer@11: samer@9: get_repo_into ~/src/hg hg https://code.soundsoftware.ac.uk/hg/dml-cliopatria samer@9: get_repo_into ~/src/hg hg https://code.soundsoftware.ac.uk/hg/ishara samer@9: get_repo_into ~/src/hg hg https://code.soundsoftware.ac.uk/hg/kernscores-utf8 samer@0: samer@9: unpack_into ~/lib https://code.soundsoftware.ac.uk/attachments/download/1281/lib-swipl.tar.gz samer@9: unpack_into ~/var/dml https://code.soundsoftware.ac.uk/attachments/download/1282/var-dml-cpack.tar.gz samer@11: cp_into ~/lib/beets https://code.soundsoftware.ac.uk/attachments/download/1284/music-ro.db samer@11: cp_into ~/lib/mets https://code.soundsoftware.ac.uk/attachments/download/1283/DML_metadata_batch_01.tar.gz samer@3: samer@11: mkdir -p ~/var/dml/memo_db