diff --git a/conf/z-push-deps.control b/conf/z-push-deps.control new file mode 100644 index 0000000..39bc788 --- /dev/null +++ b/conf/z-push-deps.control @@ -0,0 +1,16 @@ +Section: misc +Priority: optional +Homepage: http://z-push.org/ +Standards-Version: 2.3.4 + +Package: z-push-deps +Version: 1.2-1 +Depends: php-soap, php5-imap, libawl-php, php5-xsl +Architecture: all +Description: meta package for z-push dependencies + Z-Push is an open-source application to synchronize + ActiveSync compatible devices such as mobile phones, + tablets and Outlook 2013 and above. + . + . +This meta-package is only responsible of installing its dependencies. diff --git a/scripts/install b/scripts/install index c0c341a..cfba1c1 100755 --- a/scripts/install +++ b/scripts/install @@ -65,7 +65,12 @@ CHECK_DOMAINPATH () { # Vérifie la disponibilité du path et du domaine. CHECK_DOMAINPATH # Prereqs -sudo apt-get install php-soap php5-imap libawl-php php5-xsl -y +#sudo apt-get install php-soap php5-imap libawl-php php5-xsl -y + +# Install dependencies using Helpers +ynh_package_install_from_equivs ../conf/${DEPS_PKG_NAME}.control \ +|| ynh_die "Unable to install dependencies" + final_path="/var/www/$app" diff --git a/scripts/remove b/scripts/remove index 2aad6a3..486ad96 100755 --- a/scripts/remove +++ b/scripts/remove @@ -15,6 +15,11 @@ sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf sudo rm -f /etc/php5/fpm/pool.d/$app.conf sudo rm -f /etc/logrotate.d/$app +# Remove app dependencies +if ynh_package_is_installed "$DEPS_PKG_NAME"; then + ynh_package_autoremove "$DEPS_PKG_NAME" +fi + # Restart of services sudo service php5-fpm reload sudo service nginx reload diff --git a/scripts/restore b/scripts/restore index 23c4170..7056219 100755 --- a/scripts/restore +++ b/scripts/restore @@ -15,8 +15,13 @@ final_nginxconf=$(ynh_app_setting_get $app final_nginxconf) final_phpconf=$(ynh_app_setting_get $app final_phpconf) # Prereqs -sudo apt-get update -y -sudo apt-get install php-soap php5-imap libawl-php php5-xsl +#sudo apt-get update -y +#sudo apt-get install php-soap php5-imap libawl-php php5-xsl +# Install dependencies using Helpers +ynh_package_install_from_equivs ../conf/${DEPS_PKG_NAME}.control \ +|| ynh_die "Unable to install dependencies" + + # Restore sources, data and permissions sudo mkdir -p $final_path diff --git a/scripts/upgrade b/scripts/upgrade index 02e7a7b..05860fa 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -56,7 +56,11 @@ fi # Prereqs -sudo apt-get install php-soap php5-imap libawl-php php5-xsl +#sudo apt-get install php-soap php5-imap libawl-php php5-xsl +# Install dependencies using Helpers +ynh_package_install_from_equivs ../conf/${DEPS_PKG_NAME}.control \ +|| ynh_die "Unable to install dependencies" + # Cleaning sudo rm -rf $final_path