From c6a8398ba1aab48bee5613f0726ab47869238c45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Wed, 25 Oct 2017 20:18:51 +0200 Subject: [PATCH] Use prebuilt source for ARM --- README.md | 3 ++- conf/armv7.src | 12 ++++++++++++ scripts/_common.sh | 32 ++++++++++++++++++++------------ scripts/upgrade | 2 +- 4 files changed, 35 insertions(+), 14 deletions(-) create mode 100644 conf/armv7.src diff --git a/README.md b/README.md index a98ae90..95261ac 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,8 @@ If you don't have a dh.pem file in `/etc/yunohost/certs/YOUR DOMAIN/dh.pem` you You could built it by this cmd : `sudo openssl dhparam -out /etc/yunohost/certs/YOUR DOMAIN/dh.pem 2048 > /dev/null` After that you can install it without problem. -The install use the python virtualenvironement. Everything is built on the install and some package a compiled so it could take a long time if the processor is slow. +The package use a prebuild python virtualenvironnement. The binary are taken from this repos : https://github.com/Josue-T/synapse_python_build +The script to build the binary is also available. ### Package update package diff --git a/conf/armv7.src b/conf/armv7.src new file mode 100644 index 0000000..22e0a90 --- /dev/null +++ b/conf/armv7.src @@ -0,0 +1,12 @@ + +SOURCE_URL=https://github.com/Josue-T/synapse_python_build/releases/download/matrix-synapse_0.24.1-bin1_armv7l.tar.gz +SOURCE_SUM=f1a4941b4feba49111eaf5dc85cff986ec63a2628eaea4a6d5bfcfe3162d0943 +# (Optional) Program to check the integrity (sha256sum, md5sum...) +# default: sha256 +SOURCE_SUM_PRG=sha256sum +# (Optional) Archive format +# default: tar.gz +SOURCE_FORMAT=tar.gz +# (Optional) Put false if sources are directly in the archive root +# default: true +SOURCE_IN_SUBDIR=true diff --git a/scripts/_common.sh b/scripts/_common.sh index 0c32a99..629da31 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,10 +5,10 @@ app=$YNH_APP_INSTANCE_NAME synapse_user="matrix-synapse" synapse_db_name="matrix_synapse" synapse_db_user="matrix_synapse" -synapse_version="0.22.0" +synapse_version="0.24.1" install_dependances() { - ynh_install_app_dependencies coturn build-essential python2.7-dev libffi-dev python-pip python-setuptools sqlite3 libssl-dev python-virtualenv libjpeg-dev libpq-dev postgresql + 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 pip install --upgrade pip pip install --upgrade virtualenv } @@ -22,16 +22,24 @@ setup_dir() { } install_source() { - # Install synapse in virtualenv - virtualenv -p python2.7 $final_path - PS1="" - cp ../conf/virtualenv_activate $final_path/bin/activate - source $final_path/bin/activate - pip install --upgrade pip - pip install --upgrade cffi ndg-httpsclient setuptools - pip install --upgrade https://github.com/matrix-org/synapse/tarball/master - pip install --upgrade psycopg2 lxml - deactivate + + if [ -n "$(uname -m | grep arm)" ] + then + ynh_setup_source $final_path/ "armv7" + else + # Install virtualenv if it don't exist + test -e $final_path/bin || virtualenv -p python2.7 $final_path + + # Install synapse in virtualenv + PS1="" + cp ../conf/virtualenv_activate $final_path/bin/activate + source $final_path/bin/activate + pip install --upgrade pip + pip install --upgrade setuptools + pip install --upgrade cffi ndg-httpsclient psycopg2 lxml + pip install --upgrade https://github.com/matrix-org/synapse/tarball/master + deactivate + fi # Set permission chown $synapse_user:root -R $final_path diff --git a/scripts/upgrade b/scripts/upgrade index d99ecd2..cb2c078 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -65,7 +65,7 @@ then install_dependances # Create directory Install synapse in virtualenv - setup_dir || true # If the dir aready exist, but to be sure that all dir exist. + setup_dir || true # If the dir aready exist the command could fail install_source # Open access to server without a button the home