diff --git a/scripts/_common.sh b/scripts/_common.sh index a9f36f9..2a21273 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,12 @@ # ============================================================================= # Package dependencies -pkg_dependencies="php5-cli php5-common php5-intl php5-json php5-mcrypt php-pear php-auth-sasl php-mail-mime php-patchwork-utf8 php-net-smtp php-net-socket php-crypt-gpg php-net-ldap2 php-net-ldap3" +pkg_dependencies="php5-cli php5-common php5-intl php5-json php5-mcrypt php-pear php-auth-sasl php-mail-mime php-patchwork-utf8 php-net-smtp php-net-socket php-net-ldap2 php-net-ldap3" +if [ "$(lsb_release --codename --short)" != "jessie" ]; then + pkg_dependencies="$pkg_dependencies php-zip" +else + pkg_dependencies="$pkg_dependencies php-crypt-gpg" +fi # Plugins version contextmenu_version=2.3 diff --git a/scripts/install b/scripts/install index ad24650..bcdb8f1 100644 --- a/scripts/install +++ b/scripts/install @@ -58,10 +58,12 @@ ynh_app_setting_set $app with_enigma $with_enigma #================================================= # jessie-backports is needed for php-net-ldap3 -grep -q -R 'jessie-backports' /etc/apt/sources.list{,.d} || { - echo "deb http://httpredir.debian.org/debian jessie-backports main" \ - | tee -a /etc/apt/sources.list.d/backports.list >/dev/null -} +if [ "$(lsb_release --codename --short)" = "jessie" ]; then + grep -q -R 'jessie-backports' /etc/apt/sources.list{,.d} || { + echo "deb http://httpredir.debian.org/debian jessie-backports main" \ + | tee -a /etc/apt/sources.list.d/backports.list >/dev/null + } +fi ynh_install_app_dependencies "$pkg_dependencies" diff --git a/scripts/restore b/scripts/restore index 2a2cea6..bf75e1a 100644 --- a/scripts/restore +++ b/scripts/restore @@ -41,6 +41,20 @@ ynh_webpath_available $domain $path_url \ test ! -d $final_path \ || ynh_die "There is already a directory: $final_path " +#================================================= +# INSTALL DEPENDENCIES +#================================================= + +# jessie-backports is needed for php-net-ldap3 +if [ "$(lsb_release --codename --short)" = "jessie" ]; then + grep -q -R 'jessie-backports' /etc/apt/sources.list{,.d} || { + echo "deb http://httpredir.debian.org/debian jessie-backports main" \ + | tee -a /etc/apt/sources.list.d/backports.list >/dev/null + } +fi + +ynh_install_app_dependencies "$pkg_dependencies" + #================================================= # STANDARD RESTORATION STEPS #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ff92958..29b9259 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -62,10 +62,12 @@ path_url=$(ynh_normalize_url_path $path_url) #================================================= # jessie-backports is needed for php-net-ldap3 -grep -q -R 'jessie-backports' /etc/apt/sources.list{,.d} || { - echo "deb http://httpredir.debian.org/debian jessie-backports main" \ - | tee -a /etc/apt/sources.list.d/backports.list >/dev/null -} +if [ "$(lsb_release --codename --short)" = "jessie" ]; then + grep -q -R 'jessie-backports' /etc/apt/sources.list{,.d} || { + echo "deb http://httpredir.debian.org/debian jessie-backports main" \ + | tee -a /etc/apt/sources.list.d/backports.list >/dev/null + } +fi ynh_install_app_dependencies "$pkg_dependencies"