diff --git a/scripts/_common.sh b/scripts/_common.sh index 212e110..5a6d8ea 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,7 +7,11 @@ APPNAME="odoo" function define_paths() { # In odoo 10 some file change if [ $(echo "$odoo_version >= 10" | bc) -ne 0 ]; then - export source_path=/usr/lib/python2.7/dist-packages/odoo/ + if [ $(echo "$odoo_version >= 11" | bc) -ne 0 ]; then + export source_path=/usr/lib/python3/dist-packages/odoo/ + else + export source_path=/usr/lib/python2.7/dist-packages/odoo/ + fi export conf_file=/etc/odoo/odoo.conf bin_file=/usr/bin/odoo else @@ -78,9 +82,13 @@ function install_dependencies() { # TODO if 8.0 install https://www.odoo.com/apps/modules/8.0/shell/ fi + if is_jessie ; then + sudo echo "deb http://http.debian.net/debian jessie-backports main" | sudo tee /etc/apt/sources.list.d/jessie-backport.list + fi apt-get update - ynh_install_app_dependencies curl postgresql odoo xfonts-75dpi xfonts-base wkhtmltopdf node-less python-xlrd + ynh_install_app_dependencies curl postgresql odoo xfonts-75dpi xfonts-base wkhtmltopdf node-less python-xlrd python3-dev gcc libldap2-dev libssl-dev libsasl2-dev + pip3 install pyldap if ! wkhtmltopdf --version | grep "wkhtmltopdf 0.12.4 (with patched qt)"; then # The debian package has a bug so we deploy a more recent version @@ -113,7 +121,6 @@ function add_services() { yunohost service stop odoo yunohost service start odoo yunohost service enable odoo - systemctl enable odoo fi } diff --git a/scripts/_future.sh b/scripts/_future.sh index d68da67..ff18dad 100644 --- a/scripts/_future.sh +++ b/scripts/_future.sh @@ -203,3 +203,26 @@ exec_as() { sudo sudo -u "$USER" "$@" fi } + +ynh_debian_release () { + lsb_release --codename --short +} + +is_stretch () { + if [ "$(ynh_debian_release)" == "stretch" ] + then + return 0 + else + return 1 + fi +} + +is_jessie () { + if [ "$(ynh_debian_release)" == "jessie" ] + then + return 0 + else + return 1 + fi +} +