Merge branch 'master' of github.com:clean-cloogle/clean-irc
[cloogle-irc.git] / install_clean.sh
1 #!/bin/sh
2 set -e
3 if [ "$#" -eq 0 ];
4 then
5 echo "Usage: $0 DIR" >&2
6 exit 1;
7 fi
8 TARGET="$(realpath "$1")"
9
10 echo "Removing and repopulating $TARGET" >&2
11 if [ -d "$TARGET" ]; then
12 mv "$TARGET" "$TARGET.$(date +%F)" || rm -fr "$TARGET"
13 fi
14 rm -fr "$TARGET"
15 mkdir -p "$TARGET"
16
17 echo "Downloading and installing clean nightly" >&2
18 curl -sSL ftp://ftp.cs.ru.nl/pub/Clean/builds/linux-x64/clean-bundle-complete-linux-x64-latest.tgz \
19 | tar --gunzip --strip-components=1 --extract --directory="$TARGET"
20
21 echo "Apply patches" >&2
22 curl -sSL https://gitlab.science.ru.nl/mlubbers/iTasks-SDK/raw/95-addbackgroundtask/Libraries/iTasks/_Framework/TaskServer.dcl\
23 > "$TARGET"/lib/iTasks/iTasks/_Framework/TaskServer.dcl
24 curl -sSL https://gitlab.science.ru.nl/mlubbers/iTasks-SDK/raw/95-addbackgroundtask/Libraries/iTasks/_Framework/TaskServer.icl\
25 > "$TARGET"/lib/iTasks/iTasks/_Framework/TaskServer.icl
26
27 echo "export CLEAN_HOME=$TARGET; export PATH=$TARGET/bin:\$PATH;"