2020-04-16 23:33:43 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-11-01 22:04:11 +01:00
|
|
|
#=================================================
|
2020-04-16 23:33:43 +02:00
|
|
|
# COMMON VARIABLES
|
2019-11-01 22:04:11 +01:00
|
|
|
#=================================================
|
|
|
|
|
2017-10-30 17:52:57 +01:00
|
|
|
|
2020-04-16 23:33:43 +02:00
|
|
|
# Note that we also need some specific pkg_dependencies for build with arm architectures
|
|
|
|
# dependencies used by the app
|
|
|
|
pkg_dependencies="python-dev python-virtualenv virtualenv uwsgi uwsgi-plugin-python build-essential libssl-dev libffi-dev"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# PERSONAL HELPERS
|
|
|
|
#=================================================
|
2019-05-08 15:02:14 +02:00
|
|
|
|
2019-11-01 22:04:11 +01:00
|
|
|
install_sources() {
|
|
|
|
ynh_setup_source --dest_dir "$final_path"
|
|
|
|
|
|
|
|
# pip installation
|
|
|
|
virtualenv --python=$(which python2 python | head -n 1) "$final_path/local"
|
|
|
|
# Init virtualenv
|
|
|
|
(
|
|
|
|
set +o nounset
|
|
|
|
source "$final_path/local/bin/activate"
|
|
|
|
set -o nounset
|
|
|
|
cd "$final_path"
|
|
|
|
pip install --upgrade pip
|
2020-04-21 20:55:12 +02:00
|
|
|
pip install --upgrade pyramid_chameleon 'soupsieve<2.0'
|
2019-11-01 22:04:11 +01:00
|
|
|
CFLAGS="-Wno-error -Wno-error=format-security" \
|
|
|
|
ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future" \
|
|
|
|
pip install --upgrade --requirement "$final_path/requirements.txt"
|
|
|
|
|
|
|
|
python "$final_path/setup.py" develop
|
|
|
|
|
|
|
|
touch "$final_path/local/COMPLETE"
|
|
|
|
)
|
|
|
|
# Add nice homepage
|
|
|
|
cp -r ../sources/page $final_path/syncserver/
|
|
|
|
(cd "$final_path/syncserver" && patch -p1 < $YNH_CWD/../sources/homepage.patch) || echo "Unable to apply patches"
|
2018-07-05 23:21:03 +02:00
|
|
|
}
|
|
|
|
|
2019-11-01 22:04:11 +01:00
|
|
|
set_permissions() {
|
|
|
|
chown $app -R $final_path
|
|
|
|
chmod u=rwX,g=rX,o= -R $final_path
|
|
|
|
chown $app:root /var/log/uwsgi/$app
|
|
|
|
chmod -R u=rwX,g=rX,o= /var/log/uwsgi/$app
|
2018-08-20 22:46:56 +02:00
|
|
|
}
|
2020-04-16 23:33:43 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# EXPERIMENTAL HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# FUTURE OFFICIAL HELPERS
|
|
|
|
#=================================================
|