1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/cops_ynh.git synced 2024-09-03 18:25:57 +02:00

Use of ynh_package_install_from_equivs

This commit is contained in:
polytan02 2017-02-24 13:43:49 +00:00
parent 0e49eddd8e
commit 8570567b5a
5 changed files with 39 additions and 6 deletions

15
conf/cops-deps.control Normal file
View file

@ -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.

View file

@ -123,8 +123,13 @@ finalphpconf="/etc/php5/fpm/pool.d/${app}.conf"
ynh_app_setting_set "$app" finalphpconf "$finalphpconf" ynh_app_setting_set "$app" finalphpconf "$finalphpconf"
# We install dependencies # We install dependencies
sudo apt-get update -y #sudo apt-get update -y
sudo apt-get install php5-gd php5-sqlite php5-json php5-intl -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 # Creation of folder
sudo mkdir -p $final_path sudo mkdir -p $final_path

View file

@ -35,6 +35,11 @@ sudo rm -rf $final_path
sudo rm -f $finalnginxconf sudo rm -f $finalnginxconf
sudo rm -f $finalphpconf 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 # We reload the services
sudo service php5-fpm reload sudo service php5-fpm reload
sudo service nginx reload sudo service nginx reload

View file

@ -30,8 +30,12 @@ runninguser=$(ynh_app_setting_get $app runninguser)
basicauthcreate=$(ynh_app_setting_get $app basicauthcreate) basicauthcreate=$(ynh_app_setting_get $app basicauthcreate)
# We install dependencies # We install dependencies
sudo apt-get update -y #sudo apt-get update -y
sudo apt-get install php5-gd php5-sqlite php5-json php5-intl -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 # Restore sources & data
sudo mkdir -p $final_path sudo mkdir -p $final_path

View file

@ -55,8 +55,12 @@ CHECK_CALIBRE () { # Vérifie la présence du / en début de path. Et son absen
CHECK_CALIBRE CHECK_CALIBRE
# We install dependencies # We install dependencies
sudo apt-get update -y #sudo apt-get update -y
sudo apt-get install php5-gd php5-sqlite php5-json php5-intl -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 # Removal of old folder and restart from fresh
sudo rm -rf $final_path sudo rm -rf $final_path