From b5f1e06f35572c3768d27a1a1f251de938abbfbf Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 25 Mar 2019 23:01:02 +0100 Subject: [PATCH] fix dependencies --- scripts/_common.sh | 3 +++ scripts/install | 19 ++++++++----------- scripts/remove | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 944a65e..1ad79e3 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,6 +4,9 @@ # COMMON VARIABLES #================================================= +# dependencies used by the app +pkg_dependencies="z-push-common z-push-backend-caldav z-push-backend-carddav z-push-backend-combined z-push-backend-imap z-push-backend-ldap z-push-backend-galsearch-ldap z-push-autodiscover php-memcached php-cli php-soap" + #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index fa6e8ac..5745a5f 100755 --- a/scripts/install +++ b/scripts/install @@ -14,6 +14,11 @@ source ynh_add_secure_repos__2 # MANAGE SCRIPT FAILURE #================================================= +ynh_clean_setup () { + ### Remove this function if there's nothing to clean before calling the remove script. + read -p "Press any key..." + true +} # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -73,7 +78,7 @@ ynh_print_info "Installing dependencies..." ynh_install_extra_repo --repo="deb http://repo.z-hub.io/z-push:/final/Debian_9.0/ /" --key="http://repo.z-hub.io/z-push:/final/Debian_9.0/Release.key" -ynh_install_app_dependencies z-push-common z-push-backend-caldav z-push-backend-carddav z-push-backend-combined z-push-backend-imap z-push-backend-ldap z-push-backend-galsearch-ldap z-push-autodiscover php-memcached php-cli php-soap +ynh_install_app_dependencies $pkg_dependencies #================================================= # NGINX CONFIGURATION @@ -106,7 +111,7 @@ ynh_replace_string "__TIMEZONE__" "$(cat /etc/timezone)" "$config_path/autodisco # Enable caldav carddav support -if sudo yunohost app list --installed -f baikal | grep -q id ; then +if yunohost app list --installed -f baikal | grep -q id ; then echo "Detected Baikal" baikaldomain=$(ynh_app_setting_get baikal domain) baikalpath=$(ynh_app_setting_get baikal path) @@ -133,7 +138,7 @@ if sudo yunohost app list --installed -f baikal | grep -q id ; then ynh_store_file_checksum "$config_path/caldav.conf.php" ynh_store_file_checksum "$config_path/carddav.conf.php" -elif sudo yunohost app list --installed -f nextcloud | grep -q id ; then +elif yunohost app list --installed -f nextcloud | grep -q id ; then echo "Detected NextCloud" nextclouddomain=$(ynh_app_setting_get nextcloud domain) nextcloudpath=$(ynh_app_setting_get nextcloud path) @@ -203,14 +208,6 @@ ynh_print_info "Configuring log rotation..." # Use logrotate to manage application logfile(s) ynh_use_logrotate -#================================================= -# ADVERTISE SERVICE IN ADMIN PANEL -#================================================= - -#yunohost service add $app --log "/var/log/$app/APP.log" -# if using yunohost version 3.2 or more in the 'manifest.json', a description can be added -#yunohost service add $app --description "$app daemon for XXX" --log "/var/log/$app/$app.log" - #================================================= # SETUP SSOWAT #================================================= diff --git a/scripts/remove b/scripts/remove index 0ca4d4c..5c9e505 100755 --- a/scripts/remove +++ b/scripts/remove @@ -33,7 +33,7 @@ ynh_print_info "Removing dependencies" # Remove metapackage and its dependencies ynh_remove_app_dependencies -#ynh_remove_extra_repo +ynh_remove_extra_repo #================================================= # REMOVE APP MAIN DIR diff --git a/scripts/restore b/scripts/restore index dc219a2..a0bd973 100755 --- a/scripts/restore +++ b/scripts/restore @@ -76,7 +76,7 @@ ynh_restore_file "/etc/php/7.0/fpm/pool.d/$app.conf" ynh_install_extra_repo --repo="deb http://repo.z-hub.io/z-push:/final/Debian_9.0/ /" --key="http://repo.z-hub.io/z-push:/final/Debian_9.0/Release.key" -ynh_install_app_dependencies z-push-common z-push-backend-caldav z-push-backend-carddav z-push-backend-combined z-push-backend-imap z-push-backend-ldap z-push-backend-galsearch-ldap z-push-autodiscover php-memcached php-cli php-soap +ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE THE LOGROTATE CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index ee4ce3a..2a07893 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -99,7 +99,7 @@ ynh_print_info "Upgrading dependencies..." ynh_install_extra_repo --repo="deb http://repo.z-hub.io/z-push:/final/Debian_9.0/ /" --key="http://repo.z-hub.io/z-push:/final/Debian_9.0/Release.key" -ynh_install_app_dependencies z-push-common z-push-backend-caldav z-push-backend-carddav z-push-backend-combined z-push-backend-imap z-push-backend-ldap z-push-backend-galsearch-ldap z-push-autodiscover php-memcached php-cli php-soap +ynh_install_app_dependencies $pkg_dependencies #================================================= # PHP-FPM CONFIGURATION