summaryrefslogtreecommitdiff
path: root/install
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2020-04-29 13:03:34 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2021-02-28 12:15:20 +0100
commitbcbb14b96e1c281b903cd8139af12702a6ffd6cc (patch)
tree95df6bc8c2a7ca66da4086936d73435f938795bf /install
parentd2852678483c662c49242b521206cdc8edd0a31d (diff)
downloadIshtar-bcbb14b96e1c281b903cd8139af12702a6ffd6cc.tar.bz2
Ishtar-bcbb14b96e1c281b903cd8139af12702a6ffd6cc.zip
Adapt ishtar-install
Diffstat (limited to 'install')
-rwxr-xr-xinstall/ishtar-install192
1 files changed, 40 insertions, 152 deletions
diff --git a/install/ishtar-install b/install/ishtar-install
index 7e841e116..4e210d9a5 100755
--- a/install/ishtar-install
+++ b/install/ishtar-install
@@ -80,6 +80,7 @@ do_install() {
lsb_dist=''
dist_version=''
backports_activated=''
+ igg_activated=''
if command_exists lsb_release; then
lsb_dist="$(lsb_release -si)"
fi
@@ -120,6 +121,9 @@ do_install() {
debian|raspbian)
dist_version="$(cat /etc/debian_version | sed 's/\/.*//' | sed 's/\..*//')"
case "$dist_version" in
+ 10)
+ dist_version="buster"
+ ;;
9)
dist_version="stretch"
;;
@@ -140,6 +144,17 @@ do_install() {
if [ "$ALLBACKS" != '' ] || [ "$MAINBACKS" != '' ]; then
backports_activated='true';
fi
+
+ set +e
+ MAINIGG=`cat /etc/apt/sources.list | grep "deb.iggdrasil.net" | grep $dist_version |grep -v "^#"`
+ ALLIGG=''
+ if [ "$(ls -A /etc/apt/sources.list.d/)" ]; then
+ ALLIGG=`cat /etc/apt/sources.list.d/* | grep "deb.iggdrasil.net" | grep $dist_version |grep -v "^#"`
+ fi
+ set -e
+ if [ "$ALLIGG" != '' ] || [ "$MAINIGG" != '' ]; then
+ igg_activated='true';
+ fi
;;
oracleserver)
@@ -220,27 +235,6 @@ EOF
esac
done
- version=''
- cat >&2 <<-'EOF'
-
--------------------------------------------------------------------------------
- Two version are usually available for Ishtar: develop/master. Develop is the
- bleeding edge version and you can experience problems with this version.
- Master is the safest choice.
-
-EOF
- while [ "$version" == '' ]
- do
- cecho y "* Which version would you like to use? ([develop]/master/python3) "
- read choice
- case "$choice" in
- develop ) version="develop";;
- master ) version="master";;
- python3 ) version="WIP/python3";;
- '' ) version="develop";;
- esac
- done
-
etc_path="/etc/ishtar/"
if [ -d "$etc_path" ]; then
echo ""
@@ -269,35 +263,10 @@ EOF
fi
done
- install_path=''
- cat >&2 <<-'EOF'
-
--------------------------------------------------------------------------------
- By default Ishtar base path is '/srv/'. With this base path Ishtar is
- installed in '/srv/ishtar/'.
-EOF
- while [ "$install_path" == '' ]
- do
- cecho y "* Which base install path for Ishtar? [/srv/]"
- read choice
- if [ -z "$choice" ]; then
- install_path='/srv'
- elif [ ! -d "$choice" ]; then
- echo 'Not a valid path.'
- else
- install_path=$choice
- fi
- done
+ ls | grep archaeological_operations > /dev/null || (cecho r "This script must be launch from ishtar base path with 'bash install/ishtar-install' " && exit 1)
- full_install_path=$install_path'/ishtar/'
- if [ -d "$full_install_path" ]; then
- echo ""
- cecho r "ERROR: it seems that "$full_install_path" already exists. If this is a "
- cecho r "remnant of an old installation please delete this directory before installing."
- echo ""
- exit 1
- fi
+ full_install_path=`pwd`
install_celery=''
cat >&2 <<-'EOF'
@@ -359,7 +328,7 @@ EOF
# Run setup for each distro accordingly
case "$lsb_dist" in
ubuntu|debian|raspbian)
- if [ "$dist_version" != "stretch" ] ; then
+ if [ "$dist_version" != "buster" ] ; then
echo ""
cecho r " Sorry this script cannot manage your version of Debian/Ubuntu."
echo ""
@@ -498,91 +467,31 @@ EOF
( set -x; $sh_c 'pip3 install WeasyPrint==0.42.3' )
fi
- if [ "$dist_version" == "stretch" ]; then
-
- if [ "$lsb_dist" == 'debian' ]; then
- if [ "$backports_activated" != 'true' ]; then
- echo ""
- cecho r " In order to install Ishtar you have to activate Debian backports."
- echo " To do that:"
- echo ""
- echo " echo 'deb http://ftp.debian.org/debian stretch-backports main contrib' >> /etc/apt/sources.list"
- echo ""
- cecho p " Run again Ishtar installation script after that."
- exit 1
- fi
- fi
-
- if [ "$default_db" == '127.0.0.1' ]; then
- echo "-------------------------------------------------------------------------------";
- cecho y "Installing postgresql"
- echo ""
- POSTGIS=postgresql-9.6-postgis-2.3
- ( set -x; $sh_c 'sleep 3; apt-get install -y -q postgresql postgresql-contrib '$POSTGIS' '$POSTGIS'-scripts postgresql-contrib-9.6' )
- fi
- echo "-------------------------------------------------------------------------------";
- cecho y "Installing Ishtar dependencies"
- echo "";
-
- if [ "$lsb_dist" == 'debian' ]; then
- ( set -x; $sh_c 'sleep 3; apt-get install -t stretch-backports -y -q python3-django' )
- ( set -x; $sh_c 'sleep 3; apt-get install -y -q \
- python3-django-registration libpangocairo-1.0-0 python3-requests \
- python3-bs4 python3-cffi python3-django-compressor pandoc libjs-jquery\
- python3-xmltodict python3-djangorestframework \
- python3-tidylib python3-lxml python3-pil python3-html5lib \
- python3-psycopg2 python3-gdal gettext memcached graphviz \
- python3-memcache python3-markdown \
- python3-reportlab python3-django-extensions python3-unidecode' )
- fi
- if [ "$lsb_dist" == 'raspbian' ]; then
- ( set -x; $sh_c 'pip3 install django==1.11 \
- django-registration==2.2 \
- django-compressor==2.1 \
- django-extra-views==0.2.4 \
- django-extensions==1.7.4' )
- ( set -x; $sh_c 'sleep 3; apt-get install -y -q \
- libpangocairo-1.0-0 python3-requests \
- python3-bs4 python3-cffi pandoc libjs-jquery graphviz \
- python3-xmltodict python3-djangorestframework \
- python3-tidylib python3-lxml python3-imaging python3-html5lib \
- python3-psycopg2 python3-gdal gettext memcached \
- python3-memcache python3-markdown \
- python3-reportlab python3-unidecode' )
- fi
-
- if [ "$install_libreoffice" == 'yes' ]; then
- ( set -x; $sh_c 'sleep 3; apt-get --no-install-recommends install -y -q \
- libreoffice libreoffice-script-provider-python python3-uno' )
- cp "install/libreoffice.service" "/etc/systemd/system/libreoffice.service"
- systemctl daemon-reload
- systemctl enable libreoffice
- systemctl start libreoffice
- fi
-
- if [ "$install_celery" == 'yes' ]; then
- ( set -x; $sh_c 'sleep 3; apt-get --no-install-recommends install -y -q \
- rabbitmq-server' )
- # buster: python3-celery
- ( set -x; $sh_c 'pip3 install celery==4.2.1' )
- mkdir -p /var/log/celery/
- mkdir -p /var/run/celery/
- chown www-data:www-data /var/log/celery/ /var/run/celery/
- mkdir -p /etc/monit/conf-available/
- fi
+ if [ "$install_libreoffice" == 'yes' ]; then
+ ( set -x; $sh_c 'sleep 3; apt-get --no-install-recommends install -y -q \
+ libreoffice libreoffice-script-provider-python python3-uno' )
+ cp "install/libreoffice.service" "/etc/systemd/system/libreoffice.service"
+ systemctl daemon-reload
+ systemctl enable libreoffice
+ systemctl start libreoffice
+ fi
- echo "-------------------------------------------------------------------------------";
- cecho y "Installing django extra views"
- echo "";
- ( set -x; $sh_c 'pip3 install django-extra-views==0.12.0' )
+ if [ "$install_celery" == 'yes' ]; then
+ ( set -x; $sh_c 'sleep 3; apt-get --no-install-recommends install -y -q \
+ rabbitmq-server' )
+ ( set -x; $sh_c 'sleep 3; apt-get install -y -q \
+ python3-celery python-celery-common' )
- # buster: python3-pyqrcode python3-png
- echo "-------------------------------------------------------------------------------";
- cecho y "Installing pyqrcode"
- echo "";
- ( set -x; $sh_c 'pip3 install pyqrcode==1.2.1' )
- ( set -x; $sh_c 'pip3 install pypng==0.0.19' )
+ mkdir -p /var/log/celery/
+ mkdir -p /var/run/celery/
+ chown www-data:www-data /var/log/celery/ /var/run/celery/
+ mkdir -p /etc/monit/conf-available/
+ fi
+ if [ "$igg_activated" == 'true' ]; then
+ ( set -x; $sh_c 'sleep 3; apt-get install -y -q \
+ python3-django-simple-history python3-secretary python3-weasyprint' )
+ else
echo "-------------------------------------------------------------------------------";
cecho y "Installing django-simple-history"
echo "";
@@ -594,31 +503,10 @@ EOF
cecho y "Installing weasyprint"
echo "";
( set -x; $sh_c 'pip3 install WeasyPrint==0.41' )
- cecho y "Installing python3-ajax-select - Debian version is too old..."
- echo "";
- ( set -x; $sh_c 'pip3 install django-ajax-selects==1.6.0' )
- cecho y "Installing django-formtools - Debian version is too old..."
- echo "";
- ( set -x; $sh_c 'pip3 install django-formtools==2.1' )
- cecho y "Installing python3-virtualtime"
- echo "";
- ( set -x; $sh_c 'pip3 install virtualtime==1.6' )
fi
;;
esac
- echo "-------------------------------------------------------------------------------";
- cecho y "Installing Ishtar sources"
- echo "";
-
- cd $install_path
- if [ "$dist_version" == "wheezy" ]; then
- ( set -x; git clone https://nimn@gitlab.com/iggdrasil/oook_replace.git 2> /dev/null )
- fi
- ( set -x; git clone https://gitlab.com/iggdrasil/ishtar.git 2> /dev/null )
- cd ishtar
- git fetch 2> /dev/null
- git checkout $version 2> /dev/null
mkdir -p $etc_path
echo "ISHTAR_PATH="$full_install_path > $etc_path"config"