mirror of
https://github.com/YunoHost-Apps/roundcube_ynh.git
synced 2024-09-03 20:16:28 +02:00
[fix] Replace ynh_package_install_from_equivs by ynh_install_app_dependencies
This commit is contained in:
parent
3da90e0fbb
commit
42ee193cc8
3 changed files with 52 additions and 3 deletions
|
@ -342,3 +342,46 @@ ynh_backup_before_upgrade () { # Backup the current version of the app, restore
|
||||||
ynh_die "Backup failed, the upgrade process was aborted."
|
ynh_die "Backup failed, the upgrade process was aborted."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Define and install dependencies with a equivs control file
|
||||||
|
# This helper can/should only be called once per app
|
||||||
|
#
|
||||||
|
# usage: ynh_install_app_dependencies dep [dep [...]]
|
||||||
|
# | arg: dep - the package name to install in dependence
|
||||||
|
ynh_install_app_dependencies () {
|
||||||
|
dependencies=$@
|
||||||
|
manifest_path="../manifest.json"
|
||||||
|
if [ ! -e "$manifest_path" ]; then
|
||||||
|
manifest_path="../settings/manifest.json" # Into the restore script, the manifest is not at the same place
|
||||||
|
fi
|
||||||
|
version=$(sudo grep '\"version\": ' "$manifest_path" | cut -d '"' -f 4) # Retrieve the version number in the manifest file.
|
||||||
|
dep_app=${app//_/-} # Replace all '_' by '-'
|
||||||
|
|
||||||
|
if ynh_package_is_installed "${dep_app}-ynh-deps"; then
|
||||||
|
echo "A package named ${dep_app}-ynh-deps is already installed" >&2
|
||||||
|
else
|
||||||
|
cat > ./${dep_app}-ynh-deps.control << EOF # Make a control file for equivs-build
|
||||||
|
Section: misc
|
||||||
|
Priority: optional
|
||||||
|
Package: ${dep_app}-ynh-deps
|
||||||
|
Version: ${version}
|
||||||
|
Depends: ${dependencies// /, }
|
||||||
|
Architecture: all
|
||||||
|
Description: Fake package for ${app} (YunoHost app) dependencies
|
||||||
|
This meta-package is only responsible of installing its dependencies.
|
||||||
|
EOF
|
||||||
|
ynh_package_install_from_equivs ./${dep_app}-ynh-deps.control \
|
||||||
|
|| ynh_die "Unable to install dependencies" # Install the fake package and its dependencies
|
||||||
|
ynh_app_setting_set $app apt_dependencies $dependencies
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Remove fake package and its dependencies
|
||||||
|
#
|
||||||
|
# Dependencies will removed only if no other package need them.
|
||||||
|
#
|
||||||
|
# usage: ynh_remove_app_dependencies
|
||||||
|
ynh_remove_app_dependencies () {
|
||||||
|
dep_app=${app//_/-} # Replace all '_' by '-'
|
||||||
|
ynh_package_autoremove ${dep_app}-ynh-deps # Remove the fake package and its dependencies if they not still used.
|
||||||
|
}
|
|
@ -42,7 +42,11 @@ grep -q -R 'jessie-backports' /etc/apt/sources.list{,.d} || {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
ynh_package_install_from_equivs ../conf/${DEPS_PKG_NAME}.control
|
# ynh_package_install_from_equivs ../conf/${DEPS_PKG_NAME}.control
|
||||||
|
ynh_install_app_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
|
||||||
|
|
||||||
# Create system user dedicace for this app
|
# Create system user dedicace for this app
|
||||||
ynh_system_user_create $app
|
ynh_system_user_create $app
|
||||||
|
|
|
@ -43,8 +43,10 @@ grep -q -R 'jessie-backports' /etc/apt/sources.list{,.d} || {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
ynh_package_install_from_equivs ../conf/${DEPS_PKG_NAME}.control \
|
ynh_install_app_dependencies php5-cli php5-common php5-intl php5-json \
|
||||||
|| ynh_die "Unable to install dependencies"
|
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
|
||||||
|
|
||||||
# Create system user dedicace for this app
|
# Create system user dedicace for this app
|
||||||
ynh_system_user_create $app
|
ynh_system_user_create $app
|
||||||
|
|
Loading…
Add table
Reference in a new issue