# ---------------------------------------------------------------------------- #
## \file install-op-camotics.sh
## \author Sebastien Beaugrand
## \sa http://beaugrand.chez.com/
## \copyright CeCILL 2.1 Free Software license
# ---------------------------------------------------------------------------- #
version=1.3.0
repo=$idir/../repo

if isOnline; then
    url=https://camotics.org/download.html
    version=`curl -s $url | grep Version | sed 's#.* \([0-9.]\+\).*#\1#'`
fi
logInfo "camotics version=$version"

if [ $version != "1.3.0" ]; then
    logTodo "vi $idir/install-op-/install-op-camotics/README.md"
    return 0
fi

url=https://camotics.org/builds/release/debian-stable-64bit
app=camotics_${version}_amd64.deb
download $url/$app || return 1

if notWhich camotics; then
    sudoRoot apt-get -q -y install $repo/$app
fi

version=3.14.5
file=/usr/lib/x86_64-linux-gnu/libv8.so.$version
if notLink $file; then
    sudoRoot ln -s /usr/lib/x86_64-linux-gnu/libv8.so $file
fi