From b97c391b78c1f387366ea28badd604017df9d001 Mon Sep 17 00:00:00 2001 From: maxice8 Date: Sun, 14 Apr 2019 22:46:49 -0300 Subject: [PATCH] New package: synapse-0.99.3 --- srcpkgs/synapse/INSTALL | 27 ++++++++++++++ srcpkgs/synapse/files/synapse/finish | 2 ++ srcpkgs/synapse/files/synapse/run | 5 +++ .../patches/bump-python-dependencies.patch | 30 ++++++++++++++++ srcpkgs/synapse/template | 36 +++++++++++++++++++ 5 files changed, 100 insertions(+) create mode 100644 srcpkgs/synapse/INSTALL create mode 100644 srcpkgs/synapse/files/synapse/finish create mode 100644 srcpkgs/synapse/files/synapse/run create mode 100644 srcpkgs/synapse/patches/bump-python-dependencies.patch create mode 100644 srcpkgs/synapse/template diff --git a/srcpkgs/synapse/INSTALL b/srcpkgs/synapse/INSTALL new file mode 100644 index 00000000000..fd925ee45e3 --- /dev/null +++ b/srcpkgs/synapse/INSTALL @@ -0,0 +1,27 @@ +# +# Tell user to generate configuration when they first install it +# Taken from Arch Linux +# +case "${ACTION}" in +post) + if [ ! -e /etc/synapse/homeserver.yaml ]; then + cat <<-EOF + ==> A synapse configuration file needs to be generated before you can + start synapse, and you should make sure that it's readable by the + synapse user. + + cd /var/lib/synapse + sudo -u synapse python3 -m synapse.app.homeserver \\ + --server-name my.domain.name \\ + --config-path /etc/synapse/homeserver.yaml \\ + --generate-config \\ + --report-stats=yes + + N.B.: The default synapse config enables the webclient feature. + You need to either disable it, install the syweb python package + from matrix-angular-sdk, or set 'web_client_location' to a path + to make synapse not try to serve it using syweb. + EOF + fi + ;; +esac diff --git a/srcpkgs/synapse/files/synapse/finish b/srcpkgs/synapse/files/synapse/finish new file mode 100644 index 00000000000..a5324d1084d --- /dev/null +++ b/srcpkgs/synapse/files/synapse/finish @@ -0,0 +1,2 @@ +#!/bin/sh +exec synctl stop /etc/synapse/homeserver.yaml diff --git a/srcpkgs/synapse/files/synapse/run b/srcpkgs/synapse/files/synapse/run new file mode 100644 index 00000000000..b44a4186768 --- /dev/null +++ b/srcpkgs/synapse/files/synapse/run @@ -0,0 +1,5 @@ +#!/bin/sh +cd /var/lib/synapse +exec chpst -u synapse:synapse python3 \ + -m synapse.app.homeserver \ + --config-path=/etc/synapse/homeserver.yaml diff --git a/srcpkgs/synapse/patches/bump-python-dependencies.patch b/srcpkgs/synapse/patches/bump-python-dependencies.patch new file mode 100644 index 00000000000..06321a9e8d4 --- /dev/null +++ b/srcpkgs/synapse/patches/bump-python-dependencies.patch @@ -0,0 +1,30 @@ +From c1a7db468d4dbb3958f5b480fcde760566962ba4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Johannes=20L=C3=B6thberg?= +Date: Tue, 8 Jan 2019 20:09:50 +0100 +Subject: [PATCH] Bump python_dependencies +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Johannes Löthberg +--- + synapse/python_dependencies.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/synapse/python_dependencies.py b/synapse/python_dependencies.py +index f71e21ff4..b49873781 100644 +--- synapse/python_dependencies.py ++++ synapse/python_dependencies.py +@@ -62,7 +62,7 @@ REQUIREMENTS = [ + "six>=1.10", + # prometheus_client 0.4.0 changed the format of counter metrics + # (cf https://github.com/matrix-org/synapse/issues/4001) +- "prometheus_client>=0.0.18,<0.4.0", ++ "prometheus_client>=0.0.18,<0.7.0", + + # we use attr.s(slots), which arrived in 16.0.0 + # Twisted 18.7.0 requires attrs>=17.4.0 +-- +2.21.0 + + diff --git a/srcpkgs/synapse/template b/srcpkgs/synapse/template new file mode 100644 index 00000000000..616dae0c4ee --- /dev/null +++ b/srcpkgs/synapse/template @@ -0,0 +1,36 @@ +# Template file for 'synapse' +pkgname=synapse +version=0.99.3 +revision=1 +archs=noarch +build_style=python3-module +hostmakedepends="python3-setuptools" +depends="python3-jsonschema python3-frozendict python3-canonicaljson + python3-signedjson python3-nacl python3-service_identity python3-Twisted + python3-openssl python3-yaml python3-pyasn1 python3-pyasn1-modules + python3-daemonize python3-bcrypt python3-Pillow python3-psutil + python3-msgpack python3-phonenumbers python3-prometheus_client<0.7.0 + python3-attrs python3-netaddr python3-setuptools python3-bleach + python3-Jinja2 python3-psycopg2 python3-lxml python3-saml2 python3-treq + python3-txacme python3-macaroons python3-sortedcontainers" +short_desc="Matrix reference homeserver" +maintainer="maxice8 " +license="Apache-2.0" +homepage="https://github.com/matrix-org/synapse" +distfiles="https://github.com/matrix-org/synapse/archive/v${version}.tar.gz" +checksum=60a2b4caaed3e23a8fe9b43406dbee695d60271650f332cf3df3fce675a68274 + +conf_files="/etc/synapse/log_config.yaml" + +system_accounts="synapse" +synapse_homedir="/var/lib/synapse" + +make_dirs=" + /var/lib/synapse 0700 synapse synapse + /etc/synapse 0755 synapse synapse" + +post_install() { + vinstall contrib/systemd/log_config.yaml 644 etc/synapse + + vsv synapse +}