seafile_ynh/scripts/_common.sh

38 lines
1.4 KiB
Bash
Raw Normal View History

#=================================================
# SET ALL CONSTANTS
#=================================================
2017-07-21 14:56:41 +02:00
app=$YNH_APP_INSTANCE_NAME
2018-02-11 01:28:15 +01:00
[[ -e "../settings/manifest.json" ]] || [[ -e "../manifest.json" ]] && \
seafile_version=$(ynh_app_upstream_version)
2017-12-09 20:56:20 +01:00
#=================================================
# DEFINE ALL COMMON FONCTIONS
#=================================================
2018-01-19 20:55:44 +01:00
install_source() {
mkdir "$final_path/seafile-server-$seafile_version"
2018-07-31 17:46:42 +02:00
if [[ $architecture == "i386" ]]
then
2019-06-11 22:28:26 +02:00
ynh_die --message "Error : this architecture is no longer supported by the upstream. Please create en issue here : https://github.com/YunoHost-Apps/seafile_ynh/issues to ask to discuss about a support of this architecture"
2018-07-31 17:46:42 +02:00
fi
2018-01-19 20:55:44 +01:00
ynh_setup_source "$final_path/seafile-server-$seafile_version" "$architecture"
2017-01-31 23:25:17 +01:00
}
2017-07-21 14:56:41 +02:00
install_dependance() {
2019-03-20 09:45:11 +01:00
ynh_install_app_dependencies python2.7 python-pip libpython2.7 python-setuptools python-ldap python-urllib3 python-simplejson python-imaging python-mysqldb python-flup expect python-requests python-dev ffmpeg python-memcache \
2018-05-09 23:52:06 +02:00
libjpeg62-turbo-dev zlib1g-dev # For building pillow
sudo -u $seafile_user pip install --user --upgrade Pillow 'moviepy<1.0' certifi idna
2017-01-31 23:25:17 +01:00
}
2019-06-11 22:28:26 +02:00
set_permission() {
chown -R $seafile_user:$seafile_user $final_path
}
2017-07-21 14:56:41 +02:00
ynh_clean_setup () {
2017-08-09 15:34:10 +02:00
pkill -f seafile-controller
pkill -f seaf-server
pkill -f ccnet-server
2019-06-11 22:28:26 +02:00
pkill -f seahub
2018-06-07 21:20:50 +02:00
}