samer@0
|
1 #!/bin/sh
|
samer@9
|
2 # ------------------ CONFIG ----------------
|
samer@0
|
3
|
samer@9
|
4 CLEANUP=no
|
samer@9
|
5 INSTALL_SWI=no
|
samer@0
|
6
|
samer@3
|
7 function install_swi {
|
samer@9
|
8 unpack_into ~/src http://www.swi-prolog.org/download/devel/src/pl-7.1.29.tar.gz
|
samer@9
|
9 cd ~/src/pl-7.1.29
|
samer@3
|
10 cp build.templ build
|
samer@3
|
11 patch build ~/etc/swipl-build.patch
|
samer@3
|
12 ./build
|
samer@3
|
13 }
|
samer@3
|
14
|
samer@9
|
15 function unpack_into {
|
samer@9
|
16 wget_into ~/downloads "$2"
|
samer@9
|
17 arname=$(basename "$2")
|
samer@9
|
18 cd "$1"
|
samer@9
|
19 tar xzf "~/downloads/$arname"
|
samer@9
|
20 if [ $CLEANUP == yes ]; then
|
samer@9
|
21 rm "~/downloads/$arname"
|
samer@9
|
22 fi
|
samer@9
|
23 }
|
samer@0
|
24
|
samer@9
|
25 function wget_into {
|
samer@9
|
26 mkdir -p "$1"
|
samer@9
|
27 cd "$1"
|
samer@9
|
28 wget "$2"
|
samer@9
|
29 }
|
samer@9
|
30
|
samer@9
|
31 function get_repo_into {
|
samer@9
|
32 dest="$1"
|
samer@9
|
33 repo="$3"
|
samer@9
|
34 cmd=$2
|
samer@9
|
35 shift 3
|
samer@9
|
36
|
samer@9
|
37 name=$(basename "$repo")
|
samer@9
|
38 cd "$dest"
|
samer@9
|
39 if [ -d $name ]; then
|
samer@9
|
40 echo "$name repository alread present in $dest"
|
samer@9
|
41 else
|
samer@9
|
42 $cmd clone "$repo" $*
|
samer@9
|
43 fi
|
samer@9
|
44 }
|
samer@9
|
45
|
samer@9
|
46 if [ $INSTALL_SWI == yes ]; then
|
samer@9
|
47 install_swi
|
samer@9
|
48 fi
|
samer@0
|
49
|
samer@0
|
50 # DOWNLOADS FROM REPOs
|
samer@9
|
51 get_repo_into ~/src/github git https://samer--/ClioPatria
|
samer@9
|
52 get_repo_into ~/src/github git https://github.com/humdrum-tools/humdrum-tools --recursive
|
samer@9
|
53 get_repo_into ~/src/hg hg https://code.soundsoftware.ac.uk/hg/dml-cliopatria
|
samer@9
|
54 get_repo_into ~/src/hg hg https://code.soundsoftware.ac.uk/hg/ishara
|
samer@9
|
55 get_repo_into ~/src/hg hg https://code.soundsoftware.ac.uk/hg/kernscores-utf8
|
samer@0
|
56
|
samer@3
|
57 ln -s ~/src/hg/kernscores-utf8 ~/lib/kern
|
samer@0
|
58
|
samer@9
|
59 unpack_into ~/lib https://code.soundsoftware.ac.uk/attachments/download/1281/lib-swipl.tar.gz
|
samer@9
|
60 unpack_into ~/var/dml https://code.soundsoftware.ac.uk/attachments/download/1282/var-dml-cpack.tar.gz
|
samer@9
|
61 wget_into ~/lib/beets https://code.soundsoftware.ac.uk/attachments/download/1284/music-ro.db
|
samer@9
|
62 wget_into ~/lib/mets https://code.soundsoftware.ac.uk/attachments/download/1283/DML_metadata_batch_01.tar.gz
|
samer@3
|
63
|
samer@9
|
64
|
samer@9
|
65
|