1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/synapse_ynh.git synced 2024-09-03 20:26:38 +02:00

Merge pull request #98 from YunoHost-Apps/testing

Testing
This commit is contained in:
Josue-T 2019-01-19 18:00:10 +01:00 committed by GitHub
commit 2bbe173dbd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 58 additions and 62 deletions

View file

@ -16,7 +16,7 @@ Instant messaging server matrix network.
Yunohost chatroom with matrix : [https://riot.im/app/#/room/#yunohost:matrix.org](https://riot.im/app/#/room/#yunohost:matrix.org) Yunohost chatroom with matrix : [https://riot.im/app/#/room/#yunohost:matrix.org](https://riot.im/app/#/room/#yunohost:matrix.org)
**Shipped version:** 0.33.9 **Shipped version:** 0.34.0.1
Configuration Configuration
------------- -------------

View file

@ -1,7 +1,7 @@
;; General ;; General
; Manifest ; Manifest
domain="domain.tld" (DOMAIN) domain="domain.tld" (DOMAIN)
path="/_matrix/client/#/login" (PATH) path="/_matrix/static/" (PATH)
is_public=1 (PUBLIC|public=1|private=0) is_public=1 (PUBLIC|public=1|private=0)
; Checks ; Checks
pkg_linter=1 pkg_linter=1

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/YunoHost-Apps/synapse_python_build/releases/download/v0.33.9/matrix-synapse_0.33.9-jessie-bin1_armv7l.tar.gz SOURCE_URL=https://github.com/YunoHost-Apps/synapse_python_build/releases/download/v0.34.0.1/matrix-synapse_0.34.0.1-jessie-bin1_armv7l.tar.gz
SOURCE_SUM=ffa759ee9ae7aa0c96cc9c00a039df7e8f723dd81719bb603f2a535168a4e382 SOURCE_SUM=211fc5b8d1534f56b40d462ce745a5011a262663c64cd9ce46427d1702069f3b
# (Optional) Program to check the integrity (sha256sum, md5sum...) # (Optional) Program to check the integrity (sha256sum, md5sum...)
# default: sha256 # default: sha256
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/YunoHost-Apps/synapse_python_build/releases/download/v0.33.9/matrix-synapse_0.33.9-stretch-bin1_armv7l.tar.gz SOURCE_URL=https://github.com/YunoHost-Apps/synapse_python_build/releases/download/v0.34.0.1/matrix-synapse_0.34.0.1-stretch-bin1_armv7l.tar.gz
SOURCE_SUM=875b79987b739604dc80bf8a7861f1c21a1834f836644a069de1ff22ee3801b0 SOURCE_SUM=88c44e8f6a224bb58db6fb043dad686a711c614a949464ad628bec88863750a1
# (Optional) Program to check the integrity (sha256sum, md5sum...) # (Optional) Program to check the integrity (sha256sum, md5sum...)
# default: sha256 # default: sha256
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/matrix-org/synapse/archive/v0.33.9.tar.gz SOURCE_URL=https://github.com/matrix-org/synapse/archive/v0.34.0.1.tar.gz
SOURCE_SUM=a0870c157598a494774fd9b6faf7041f9c3d62ec10d88986232c5d404de93aa4 SOURCE_SUM=69cc92ac9b3fd5097c2fa4da9c99e481bb18c9e861d5917b2acd70a0dbade0ef
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_FILENAME=synapse_source.tar.gz SOURCE_FILENAME=synapse_source.tar.gz
SOURCE_EXTRACT=false SOURCE_EXTRACT=false

View file

@ -2,17 +2,14 @@
# you cannot run it directly # you cannot run it directly
deactivate () { deactivate () {
unset -f pydoc >/dev/null 2>&1
# reset old environment variables # reset old environment variables
# ! [ -z ${VAR+_} ] returns true if VAR is declared at all if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
if ! [ -z "${_OLD_VIRTUAL_PATH+_}" ] ; then PATH="${_OLD_VIRTUAL_PATH:-}"
PATH="$_OLD_VIRTUAL_PATH"
export PATH export PATH
unset _OLD_VIRTUAL_PATH unset _OLD_VIRTUAL_PATH
fi fi
if ! [ -z "${_OLD_VIRTUAL_PYTHONHOME+_}" ] ; then if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then
PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME" PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}"
export PYTHONHOME export PYTHONHOME
unset _OLD_VIRTUAL_PYTHONHOME unset _OLD_VIRTUAL_PYTHONHOME
fi fi
@ -20,18 +17,18 @@ deactivate () {
# This should detect bash and zsh, which have a hash command that must # This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting # be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected # past commands the $PATH changes we made may not be respected
if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
hash -r 2>/dev/null hash -r
fi fi
if ! [ -z "${_OLD_VIRTUAL_PS1+_}" ] ; then if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
PS1="$_OLD_VIRTUAL_PS1" PS1="${_OLD_VIRTUAL_PS1:-}"
export PS1 export PS1
unset _OLD_VIRTUAL_PS1 unset _OLD_VIRTUAL_PS1
fi fi
unset VIRTUAL_ENV unset VIRTUAL_ENV
if [ ! "${1-}" = "nondestructive" ] ; then if [ ! "${1:-}" = "nondestructive" ] ; then
# Self destruct! # Self destruct!
unset -f deactivate unset -f deactivate
fi fi
@ -48,31 +45,32 @@ PATH="$VIRTUAL_ENV/bin:$PATH"
export PATH export PATH
# unset PYTHONHOME if set # unset PYTHONHOME if set
if ! [ -z "${PYTHONHOME+_}" ] ; then # this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
_OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME" # could use `if (set -u; : $PYTHONHOME) ;` in bash
if [ -n "${PYTHONHOME:-}" ] ; then
_OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
unset PYTHONHOME unset PYTHONHOME
fi fi
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
_OLD_VIRTUAL_PS1="$PS1" _OLD_VIRTUAL_PS1="${PS1:-}"
if [ "x" != x ] ; then if [ "x(new) " != x ] ; then
PS1="$PS1" PS1="(new) ${PS1:-}"
else else
PS1="(`basename \"$VIRTUAL_ENV\"`) $PS1" if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then
# special case for Aspen magic directories
# see http://www.zetadev.com/software/aspen/
PS1="[`basename \`dirname \"$VIRTUAL_ENV\"\``] $PS1"
else
PS1="(`basename \"$VIRTUAL_ENV\"`)$PS1"
fi
fi fi
export PS1 export PS1
fi fi
# Make sure to unalias pydoc if it's already there
alias pydoc 2>/dev/null >/dev/null && unalias pydoc
pydoc () {
python -m pydoc "$@"
}
# This should detect bash and zsh, which have a hash command that must # This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting # be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected # past commands the $PATH changes we made may not be respected
if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
hash -r 2>/dev/null hash -r
fi fi

View file

@ -9,7 +9,7 @@
"en": "Instant messaging server who use matrix", "en": "Instant messaging server who use matrix",
"fr": "Un serveur de messagerie instantané basé sur matrix" "fr": "Un serveur de messagerie instantané basé sur matrix"
}, },
"version": "0.33.9~ynh1", "version": "0.34.0.1~ynh1",
"url": "http://matrix.org", "url": "http://matrix.org",
"license": "Apache-2.0", "license": "Apache-2.0",
"maintainer": { "maintainer": {

View file

@ -0,0 +1 @@
dependances="coturn build-essential python3-dev libffi-dev python3-pip python3-setuptools sqlite3 libssl-dev python3-venv libxml2-dev libxslt1-dev python3-lxml libjpeg-dev libpq-dev postgresql acl"

View file

@ -92,8 +92,7 @@ ynh_app_setting_set $app cli_port $cli_port
# WARNING : theses command are used in INSTALL, UPGRADE, RESTORE # WARNING : theses command are used in INSTALL, UPGRADE, RESTORE
# For any update do it in all files # For any update do it in all files
ynh_install_app_dependencies coturn build-essential python2.7-dev libffi-dev python-pip python-setuptools sqlite3 libssl-dev python-virtualenv libxml2-dev libxslt1-dev python-lxml libjpeg-dev libpq-dev postgresql acl ynh_install_app_dependencies $dependances
pip install --upgrade virtualenv
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
@ -138,26 +137,20 @@ then
ynh_setup_source $final_path/ "armv7_$(lsb_release --codename --short)" ynh_setup_source $final_path/ "armv7_$(lsb_release --codename --short)"
else else
# Install virtualenv if it don't exist # Install virtualenv if it don't exist
test -e $final_path/bin || virtualenv -p python2.7 $final_path test -e $final_path/bin/python3 || python3 -m venv $final_path
# Install synapse in virtualenv # Install synapse in virtualenv
PS1=${PS1:-}
cp ../conf/virtualenv_activate $final_path/bin/activate cp ../conf/virtualenv_activate $final_path/bin/activate
ynh_replace_string __FINAL_PATH__ $final_path $final_path/bin/activate ynh_replace_string __FINAL_PATH__ $final_path $final_path/bin/activate
# We set all necessary environement variable to create a python virtualenvironnement. # We set all necessary environement variable to create a python virtualenvironnement.
source $final_path/bin/activate source $final_path/bin/activate
pip install --upgrade pip pip3 install --upgrade pip
pip install --upgrade setuptools pip3 install --upgrade setuptools
pip install --upgrade cffi ndg-httpsclient psycopg2 lxml pip3 install --upgrade cffi ndg-httpsclient psycopg2 lxml
ynh_setup_source "/tmp" "python_source" ynh_setup_source "/tmp" "python_source"
pip install --upgrade "/tmp/synapse_source.tar.gz" pip3 install --upgrade "/tmp/synapse_source.tar.gz"
# Fix issue with msgpack see https://github.com/YunoHost-Apps/synapse_ynh/issues/29
test -e $final_path/lib/python2.7/site-packages/msgpack/__init__.py || (\
pip uninstall -y msgpack-python msgpack; \
pip install msgpack-python)
# This function was defined when we called "source $final_path/bin/activate". With this function we undo what "$final_path/bin/activate" does # This function was defined when we called "source $final_path/bin/activate". With this function we undo what "$final_path/bin/activate" does
deactivate deactivate

View file

@ -59,8 +59,7 @@ ynh_restore
# WARNING : theses command are used in INSTALL, UPGRADE, RESTORE # WARNING : theses command are used in INSTALL, UPGRADE, RESTORE
# For any update do it in all files # For any update do it in all files
ynh_install_app_dependencies coturn build-essential python2.7-dev libffi-dev python-pip python-setuptools sqlite3 libssl-dev python-virtualenv libxml2-dev libxslt1-dev python-lxml libjpeg-dev libpq-dev postgresql acl ynh_install_app_dependencies $dependances
pip install --upgrade virtualenv
#================================================= #=================================================
# RECREATE THE DEDICATED USER # RECREATE THE DEDICATED USER

View file

@ -74,12 +74,23 @@ fi
#================================================= #=================================================
# STANDARD UPGRADE STEPS # STANDARD UPGRADE STEPS
#=================================================
# INSTALL DEPENDENCIES
#=================================================
# WARNING : theses command are used in INSTALL, UPGRADE, RESTORE
# For any update do it in all files
ynh_install_app_dependencies $dependances
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
# Install/upgrade synapse in virtualenv # Install/upgrade synapse in virtualenv
# Clean venv is it was on python2.7
test -e $final_path/bin/python3 || ynh_secure_remove $final_path
# WARNING : these commands are used in INSTALL, UPGRADE # WARNING : these commands are used in INSTALL, UPGRADE
# For any update do it in all files # For any update do it in all files
@ -88,26 +99,20 @@ then
ynh_setup_source $final_path/ "armv7_$(lsb_release --codename --short)" ynh_setup_source $final_path/ "armv7_$(lsb_release --codename --short)"
else else
# Install virtualenv if it don't exist # Install virtualenv if it don't exist
test -e $final_path/bin || virtualenv -p python2.7 $final_path test -e $final_path/bin/python3 || python3 -m venv $final_path
# Install synapse in virtualenv # Install synapse in virtualenv
PS1=${PS1:-}
cp ../conf/virtualenv_activate $final_path/bin/activate cp ../conf/virtualenv_activate $final_path/bin/activate
ynh_replace_string __FINAL_PATH__ $final_path $final_path/bin/activate ynh_replace_string __FINAL_PATH__ $final_path $final_path/bin/activate
# We set all necessary environement variable to create a python virtualenvironnement. # We set all necessary environement variable to create a python virtualenvironnement.
source $final_path/bin/activate source $final_path/bin/activate
pip install --upgrade setuptools pip3 install --upgrade setuptools
pip install --upgrade cffi ndg-httpsclient psycopg2 lxml pip3 install --upgrade cffi ndg-httpsclient psycopg2 lxml
# Download and check the checksum for the synapse source # Download and check the checksum for the synapse source
ynh_setup_source "/tmp" "python_source" ynh_setup_source "/tmp" "python_source"
pip install --upgrade "/tmp/synapse_source.tar.gz" pip3 install --upgrade "/tmp/synapse_source.tar.gz"
# Fix issue with msgpack see https://github.com/YunoHost-Apps/synapse_ynh/issues/29
test -e $final_path/lib/python2.7/site-packages/msgpack/__init__.py || (\
pip uninstall -y msgpack-python msgpack; \
pip install msgpack-python)
# This function was defined when we called "source $final_path/bin/activate". With this function we undo what "$final_path/bin/activate" does # This function was defined when we called "source $final_path/bin/activate". With this function we undo what "$final_path/bin/activate" does
deactivate deactivate