diff --git a/bin/comrad-activate b/bin/comrad-activate index d1f7f04..b8b2e70 100755 --- a/bin/comrad-activate +++ b/bin/comrad-activate @@ -6,16 +6,21 @@ realpath() { } echo "Python (t1): `which python`" - +path_lib="`realpath ~/comrad/lib`" path_conda="`realpath ~/comrad/lib/miniconda3`" path_venv="`realpath ~/comrad/code/venv`" path_repo="`realpath ~/comrad/code`" +path_themis="$path_lib/themis/build" + source $path_conda/etc/profile.d/conda.sh export PATH="$path_conda/Library/bin:$path_conda:$PATH" # export PATH="$path_conda/Library/bin:$path_conda/Scripts:$path_conda:$PATH" export PATH="$path_conda/bin:$PATH" conda activate $path_venv + +export LD_LIBRARY_PATH="$path_themis:$LD_LIBRARY_PATH" + python -m pip install -r $path_repo/requirements.txt echo "Python (t2): `which python`" \ No newline at end of file diff --git a/bin/comrad-app b/bin/comrad-app index 7e546bf..c2386a2 100755 --- a/bin/comrad-app +++ b/bin/comrad-app @@ -22,6 +22,7 @@ path_lib="`realpath ~/comrad/lib`" path_conda="`realpath ~/comrad/lib/miniconda3`" path_venv="`realpath ~/comrad/code/venv`" path_repo="`realpath ~/comrad/code`" +path_themis="$path_lib/themis/build" source "$path_conda/etc/profile.d/conda.sh" # export PATH="$path_conda/Library/bin:$path_conda/Scripts:$path_conda:$PATH" @@ -42,6 +43,7 @@ then fi +export LD_LIBRARY_PATH="$path_themis:$LD_LIBRARY_PATH" python -m pip install -r $path_repo/requirements.txt -q python $path_repo/comrad/app/main.py \ No newline at end of file diff --git a/bin/comrad-cli b/bin/comrad-cli index 2c1700c..17edab6 100755 --- a/bin/comrad-cli +++ b/bin/comrad-cli @@ -8,10 +8,13 @@ realpath() { path_conda="`realpath ~/comrad/lib/miniconda3`" path_venv="`realpath ~/comrad/code/venv`" path_repo="`realpath ~/comrad/code`" +path_lib="`realpath ~/comrad/lib`" +path_themis="$path_lib/themis/build" source $path_conda/etc/profile.d/conda.sh export PATH="$path_conda/bin:$PATH" conda activate $path_venv +export LD_LIBRARY_PATH="$path_themis:$LD_LIBRARY_PATH" python -m pip install -r $path_repo/requirements.txt -q export COMRAD_SHOW_LOG=0 diff --git a/libssl-dev_1.1.1-1ubuntu2.1~18.04.6_amd64.deb b/libssl-dev_1.1.1-1ubuntu2.1~18.04.6_amd64.deb new file mode 100644 index 0000000..3545db6 Binary files /dev/null and b/libssl-dev_1.1.1-1ubuntu2.1~18.04.6_amd64.deb differ diff --git a/script/install b/script/install index 7b0dee7..4138500 100644 --- a/script/install +++ b/script/install @@ -94,6 +94,8 @@ path_bin="$path_repo/bin" # fi +path_themis="$path_lib/themis/build" +export LD_LIBRARY_PATH="$path_themis:$LD_LIBRARY_PATH" @@ -104,7 +106,7 @@ echo ' ' -echo "Machine $machine detected." +echo "$machine detected." @@ -276,29 +278,6 @@ python -m pip install -r requirements.txt - - - -############################################################# - -echo ' -Installing other requirements - -Rlite, hardware based redis database - -' - -cd $path_lib -git clone https://github.com/seppo0010/rlite.git -cd rlite -make -make all - - -# exit 1 - - - ######################################################################### if [ "$machine" = "Mac" ] @@ -312,7 +291,7 @@ fi echo ' -Themis, cryptography backend... +Installing Themis, cryptography backend... ' @@ -322,29 +301,37 @@ then echo 'installing themis with brew' /usr/local/bin/brew tap cossacklabs/tap /usr/local/bin/brew install libthemis -else - if [ ! -f "/usr/local/lib/libthemis.so" ] +fi + +if [ "$machine" = "Linux" ] +then + REQUIRED_PKG="libssl-dev" + PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $REQUIRED_PKG|grep "install ok installed") + echo "Checking for prerequisite $REQUIRED_PKG: $PKG_OK" + if [ "" = "$PKG_OK" ]; then + echo "No $REQUIRED_PKG. Setting up $REQUIRED_PKG. This needs sudo." + sudo apt-get --yes install $REQUIRED_PKG + # mkdir -p "$path_lib/var/lib/dpkg" + # touch "$path_lib/var/lib/dpkg/lock" + # apt-get download libssl-dev; dpkg -i --force-not-root --root=$path_lib libssl-dev.deb + fi + + echo 'Building Themis...' + cd "$path_lib" + if [ ! -d "$themis" ] then - if [ ! -f "/usr/lib/libthemis.so" ] - then - echo 'building themis' - cd "$path_lib" - # pwd - #git clone https://github.com/cossacklabs/themis.git - curl https://codeload.github.com/cossacklabs/themis/zip/master -o themis.zip - unzip -q -o themis.zip - #mv themis-master themis - cd themis-master - make - make install - # sudo make install - fi + curl https://codeload.github.com/cossacklabs/themis/zip/master -o themis.zip + unzip -q -o themis.zip + mv themis-master themis fi + cd themis + make fi + echo ' Completing...