mirror of
https://github.com/YunoHost-Apps/limesurvey_ynh.git
synced 2024-09-03 19:36:32 +02:00
[enh] Better dependencies managment
This commit is contained in:
parent
4182e252fa
commit
0f5c010f35
3 changed files with 33 additions and 1 deletions
|
@ -207,6 +207,36 @@ ynh_set_default_perm () {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ynh_read_manifest () {
|
||||||
|
python3 -c "import sys, json;print(json.load(open('../manifest.json'))['$1'])"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ynh_app_dependencies (){
|
||||||
|
export dependencies=$1
|
||||||
|
export project_url=$(ynh_read_manifest 'url')
|
||||||
|
export version=$(ynh_read_manifest 'version')
|
||||||
|
mkdir -p conf
|
||||||
|
cat > ../conf/app-ynh-deps.control.j2 << EOF
|
||||||
|
Section: misc
|
||||||
|
Priority: optional
|
||||||
|
Homepage: {{ project_url }}
|
||||||
|
Standards-Version: 3.9.2
|
||||||
|
|
||||||
|
Package: {{ app }}-ynh-deps
|
||||||
|
Version: {{ version }}
|
||||||
|
Depends: {{ dependencies }}
|
||||||
|
Architecture: all
|
||||||
|
Description: meta package for {{ app }} (YunoHost app) dependencies
|
||||||
|
This meta-package is only responsible of installing its dependencies.
|
||||||
|
EOF
|
||||||
|
|
||||||
|
ynh_configure app-ynh-deps.control ./$app-ynh-deps.control
|
||||||
|
ynh_package_install_from_equivs ./$app-ynh-deps.control \
|
||||||
|
|| ynh_die "Unable to install dependencies"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# Create a system user
|
# Create a system user
|
||||||
#
|
#
|
||||||
# usage: ynh_system_user_create user_name [home_dir]
|
# usage: ynh_system_user_create user_name [home_dir]
|
||||||
|
|
|
@ -28,7 +28,7 @@ ynh_local_path_available "$data_path"
|
||||||
|
|
||||||
ynh_save_args domain path admin is_public language local_path
|
ynh_save_args domain path admin is_public language local_path
|
||||||
|
|
||||||
ynh_package_install php5-imap
|
ynh_app_dependencies php5-imap
|
||||||
|
|
||||||
ynh_mysql_generate_db "$user" "$app"
|
ynh_mysql_generate_db "$user" "$app"
|
||||||
|
|
||||||
|
|
|
@ -20,5 +20,7 @@ ynh_rm_php_fpm_conf
|
||||||
# We can't delete it before because php5-fpm use it
|
# We can't delete it before because php5-fpm use it
|
||||||
ynh_system_user_delete "$user"
|
ynh_system_user_delete "$user"
|
||||||
|
|
||||||
|
ynh_package_remove $app-ynh-deps
|
||||||
|
|
||||||
sudo yunohost app ssowatconf
|
sudo yunohost app ssowatconf
|
||||||
echo -e "\e[0m" # Restore norml color
|
echo -e "\e[0m" # Restore norml color
|
||||||
|
|
Loading…
Add table
Reference in a new issue