diff --git a/conf/cops-deps.control b/conf/cops-deps.control new file mode 100644 index 0000000..bf289c4 --- /dev/null +++ b/conf/cops-deps.control @@ -0,0 +1,15 @@ +Section: misc +Priority: optional +Homepage: http://blog.slucas.fr/fr/oss/calibre-opds-php-server +Standards-Version: 1.0.1 + +Package: cops-deps +Version: 1.2-1 +Depends: php5-gd, php5-sqlite, php5-json, php5-intl +Architecture: all +Description: meta package for cops dependencies + COPS stands for Calibre OPDS (and HTML) Php Server. + . + . + This meta-package is only responsible of installing its dependencies. + diff --git a/scripts/install b/scripts/install index 221a79f..85ad6ad 100755 --- a/scripts/install +++ b/scripts/install @@ -123,8 +123,13 @@ finalphpconf="/etc/php5/fpm/pool.d/${app}.conf" ynh_app_setting_set "$app" finalphpconf "$finalphpconf" # We install dependencies -sudo apt-get update -y -sudo apt-get install php5-gd php5-sqlite php5-json php5-intl -y +#sudo apt-get update -y +#sudo apt-get install php5-gd php5-sqlite php5-json php5-intl -y + +# Install dependencies using Helpers +ynh_package_install_from_equivs ../conf/cops-deps.control \ +|| ynh_die "Unable to install dependencies" + # Creation of folder sudo mkdir -p $final_path diff --git a/scripts/remove b/scripts/remove index 74c31b2..8b905c1 100755 --- a/scripts/remove +++ b/scripts/remove @@ -35,6 +35,11 @@ sudo rm -rf $final_path sudo rm -f $finalnginxconf sudo rm -f $finalphpconf +# Remove app dependencies +if ynh_package_is_installed "cops-deps"; then + ynh_package_autoremove "cops-deps" +fi + # We reload the services sudo service php5-fpm reload sudo service nginx reload diff --git a/scripts/restore b/scripts/restore index f815291..1d3203b 100755 --- a/scripts/restore +++ b/scripts/restore @@ -30,8 +30,12 @@ runninguser=$(ynh_app_setting_get $app runninguser) basicauthcreate=$(ynh_app_setting_get $app basicauthcreate) # We install dependencies -sudo apt-get update -y -sudo apt-get install php5-gd php5-sqlite php5-json php5-intl -y +#sudo apt-get update -y +#sudo apt-get install php5-gd php5-sqlite php5-json php5-intl -y + +# Install dependencies using Helpers +ynh_package_install_from_equivs ../conf/cops-deps.control \ +|| ynh_die "Unable to install dependencies" # Restore sources & data sudo mkdir -p $final_path diff --git a/scripts/upgrade b/scripts/upgrade index 755bb86..e0da1be 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -55,8 +55,12 @@ CHECK_CALIBRE () { # Vérifie la présence du / en début de path. Et son absen CHECK_CALIBRE # We install dependencies -sudo apt-get update -y -sudo apt-get install php5-gd php5-sqlite php5-json php5-intl -y +#sudo apt-get update -y +#sudo apt-get install php5-gd php5-sqlite php5-json php5-intl -y + +# Install dependencies using Helpers +ynh_package_install_from_equivs ../conf/cops-deps.control \ +|| ynh_die "Unable to install dependencies" # Removal of old folder and restart from fresh sudo rm -rf $final_path