2017-06-18 20:49:01 +02:00
|
|
|
#
|
|
|
|
# spec file for package matrix-synapse
|
|
|
|
#
|
2020-01-01 05:09:47 +01:00
|
|
|
# Copyright (c) 2020 SUSE LLC
|
2017-06-18 20:49:01 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2019-10-04 00:23:50 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2017-06-18 20:49:01 +02:00
|
|
|
#
|
|
|
|
|
2019-10-04 00:23:50 +02:00
|
|
|
|
|
|
|
# These come from matrix-synapse's CONDITIONAL_REQUIREMENTS.
|
|
|
|
%bcond_without email_notifs
|
|
|
|
%bcond_without postgres
|
|
|
|
%bcond_without saml
|
|
|
|
%bcond_without url_preview
|
|
|
|
%bcond_without jwt
|
2020-02-03 11:56:06 +01:00
|
|
|
# missing deps
|
|
|
|
%bcond_with opentracing
|
2019-11-28 19:25:53 +01:00
|
|
|
# matrix-synapse-ldap isn't packaged on openSUSE.
|
|
|
|
%bcond_with ldap
|
2019-10-04 00:23:50 +02:00
|
|
|
# txacme is broken in openSUSE.
|
|
|
|
%bcond_with acme
|
|
|
|
# sentry-sdk isn't packaged on openSUSE.
|
|
|
|
%bcond_with sentry
|
|
|
|
|
|
|
|
## Package updates
|
|
|
|
#
|
|
|
|
# * Update version in _service to the most recent released one
|
|
|
|
# * Call `osc service dr`
|
|
|
|
# * Update changelog manually from
|
|
|
|
# https://github.com/matrix-org/synapse/releases or synapse/CHANGES.md
|
|
|
|
# * Commit+submit
|
|
|
|
|
|
|
|
# Synapse 1.1.0 and onwards only supports Python >= 3.5.
|
|
|
|
%define skip_python2 1
|
|
|
|
|
2017-07-10 13:05:51 +02:00
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2019-10-04 00:23:50 +02:00
|
|
|
%define modname synapse
|
|
|
|
%define pkgname matrix-synapse
|
|
|
|
Name: %{pkgname}
|
2020-09-24 04:35:42 +02:00
|
|
|
Version: 1.20.0
|
2017-06-18 20:49:01 +02:00
|
|
|
Release: 0
|
2017-07-04 12:19:47 +02:00
|
|
|
Summary: Matrix protocol reference homeserver
|
2017-06-18 20:49:01 +02:00
|
|
|
License: Apache-2.0
|
|
|
|
Group: Productivity/Networking/Instant Messenger
|
2019-10-04 00:23:50 +02:00
|
|
|
URL: https://github.com/matrix-org/synapse
|
|
|
|
Source0: %{pkgname}-%{version}.tar.xz
|
2020-02-03 11:56:06 +01:00
|
|
|
Source48: README.SUSE
|
|
|
|
Source49: matrix-synapse.tmpfiles.d
|
2019-10-04 00:23:50 +02:00
|
|
|
Source50: %{pkgname}.service
|
2020-02-03 11:56:06 +01:00
|
|
|
Source51: matrix-synapse-generate-config.sh
|
2020-03-04 15:48:28 +01:00
|
|
|
# track series file so we can easily use quilt
|
|
|
|
# cd synapse ; ln -s .. patches ; quilt push -a
|
|
|
|
# to clean up your working copy afterwards: git reset --hard ; rm -rv .pc patches
|
|
|
|
Source99: series
|
2020-02-03 11:56:06 +01:00
|
|
|
Patch: matrix-synapse-1.4.1-paths.patch
|
2017-06-18 20:49:01 +02:00
|
|
|
BuildRequires: %{python_module base}
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: %{python_module psutil >= 2.0.0}
|
2017-06-18 20:49:01 +02:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2019-10-04 00:23:50 +02:00
|
|
|
BuildRequires: %{python_module treq >= 15.1.0}
|
2017-06-18 20:49:01 +02:00
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
2019-10-04 00:23:50 +02:00
|
|
|
BuildRequires: systemd-rpm-macros
|
|
|
|
BuildRequires: unzip
|
|
|
|
%{?systemd_requires}
|
2017-06-18 20:49:01 +02:00
|
|
|
Requires(pre): shadow
|
2019-10-04 00:23:50 +02:00
|
|
|
%ifpython3
|
|
|
|
Requires: %{python_flavor} >= 3.5
|
2017-06-18 20:49:01 +02:00
|
|
|
%endif
|
2019-10-04 00:23:50 +02:00
|
|
|
# NOTE: Keep this is in the same order as synapse/python_dependencie.py.
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-Pillow >= 4.3.0
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-Pillow
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-PyNaCl >= 1.2.1
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-PyNaCl
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-PyYAML >= 3.11
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-PyYAML
|
|
|
|
BuildRequires: python3-Twisted >= 20.3.0
|
|
|
|
%requires_eq python3-Twisted
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-attrs >= 17.4.0
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-attrs
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-bcrypt >= 3.1.0
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-bcrypt
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-bleach >= 1.4.3
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-bleach
|
2020-09-24 04:35:42 +02:00
|
|
|
BuildRequires: python3-canonicaljson >= 1.3.0
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-canonicaljson
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-frozendict >= 1
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-frozendict
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-idna >= 2.5
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-idna
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-jsonschema >= 2.5.1
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-jsonschema
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-msgpack >= 0.5.2
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-msgpack
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-netaddr >= 0.7.18
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-netaddr
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-phonenumbers >= 8.2.0
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-phonenumbers
|
2020-07-16 00:57:41 +02:00
|
|
|
BuildRequires: (python3-prometheus_client >= 0.4.0 with python3-prometheus_client < 0.9.0)
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-prometheus_client
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-psutil >= 2.0.0
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-psutil
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-pyOpenSSL >= 16.0.0
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-pyOpenSSL
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-pyasn1 >= 0.1.9
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-pyasn1
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-pyasn1-modules >= 0.0.7
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-pyasn1-modules
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-pymacaroons >= 0.13.0
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-pymacaroons
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-service_identity >= 18.1.0
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-service_identity
|
2020-02-12 17:22:41 +01:00
|
|
|
BuildRequires: python3-signedjson >= 1.1.0
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-signedjson
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-six >= 1.10
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-six
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-sortedcontainers >= 1.4.4
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-sortedcontainers
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-systemd >= 231
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-systemd
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-typing_extensions >= 3.7.4
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-typing_extensions
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-treq >= 15.1
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-treq
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-unpaddedbase64 >= 1.1.0
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-unpaddedbase64
|
2019-10-04 00:23:50 +02:00
|
|
|
# Specify all CONDITIONAL_REQUIREMENTS (we Require them to avoid no-recommends
|
|
|
|
# breaking very commonly-used bits of matrix-synapse such as postgresql).
|
|
|
|
%if %{with email_notifs}
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-Jinja2 >= 2.9
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-Jinja2
|
2019-10-04 00:23:50 +02:00
|
|
|
%endif
|
|
|
|
%if %{with ldap}
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-matrix-synapse-ldap3 >= 0.1
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-matrix-synapse-ldap3
|
2019-10-04 00:23:50 +02:00
|
|
|
%endif
|
|
|
|
%if %{with postgres}
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-psycopg2 >= 2.7
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-psycopg2
|
2019-10-04 00:23:50 +02:00
|
|
|
%endif
|
|
|
|
%if %{with acme}
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-txacme >= 0.9.2
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-txacme
|
2019-10-04 00:23:50 +02:00
|
|
|
%endif
|
|
|
|
%if %{with saml}
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-pysaml2 >= 4.5.0
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-pysaml2
|
2019-10-04 00:23:50 +02:00
|
|
|
%endif
|
|
|
|
%if %{with url_preview}
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-lxml >= 3.5.0
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-lxml
|
2019-10-04 00:23:50 +02:00
|
|
|
%endif
|
|
|
|
%if %{with sentry}
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-sentry-sdk >= 0.7.2
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-sentry-sdk
|
2019-10-04 00:23:50 +02:00
|
|
|
%endif
|
|
|
|
%if %{with jwt}
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-PyJWT >= 1.6.4
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-PyJWT
|
2020-02-03 11:56:06 +01:00
|
|
|
%endif
|
|
|
|
%if %{with opentracing}
|
|
|
|
BuildRequires: python3-jaeger-client >= 4.0.0
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-jaeger-client
|
2020-02-03 11:56:06 +01:00
|
|
|
BuildRequires: python3-opentracing >= 2.2.0
|
2020-04-02 18:41:09 +02:00
|
|
|
%requires_eq python3-opentracing
|
2019-10-04 00:23:50 +02:00
|
|
|
%endif
|
2017-06-18 20:49:01 +02:00
|
|
|
BuildArch: noarch
|
2019-10-04 00:23:50 +02:00
|
|
|
# We only provide/obsolete python2 to ensure that users upgrade.
|
2020-02-03 11:56:06 +01:00
|
|
|
Obsoletes: python2-matrix-synapse < %{version}-%{release}
|
|
|
|
Provides: python2-matrix-synapse = %{version}-%{release}
|
|
|
|
Obsoletes: python3-matrix-synapse < %{version}-%{release}
|
|
|
|
Provides: python3-matrix-synapse = %{version}-%{release}
|
2017-06-18 20:49:01 +02:00
|
|
|
|
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
2017-07-04 12:19:47 +02:00
|
|
|
Synapse is a Python-based reference "homeserver" implementation of
|
|
|
|
Matrix. Matrix is a system for federated Instant Messaging and VoIP.
|
2017-06-18 20:49:01 +02:00
|
|
|
|
|
|
|
%prep
|
2020-02-03 11:56:06 +01:00
|
|
|
%autosetup -p1
|
2019-10-04 00:23:50 +02:00
|
|
|
|
|
|
|
# Remove all un-needed #!-lines.
|
|
|
|
find synapse/ -type f -exec sed -i '1{/^#!/d}' {} \;
|
|
|
|
# Replace all #!/usr/bin/env lines to use #!/usr/bin/$1 directly.
|
|
|
|
find ./ -type f -exec \
|
|
|
|
sed -i '1s|^#!/usr/bin/env |#!/usr/bin/|' {} \;
|
|
|
|
# Force the usage of python_flavor.
|
|
|
|
find ./ -type f \
|
|
|
|
-exec sed -i '1s|^#!/usr/bin/python$|#!/usr/bin/%{python_flavor}|' {} \;
|
|
|
|
|
|
|
|
# Update the python flavour in the service file.
|
2020-02-03 11:56:06 +01:00
|
|
|
sed -i 's|@PYTHON_FLAVOR@|%{_bindir}/%{python_flavor}|g' %{S:50}
|
2017-06-18 20:49:01 +02:00
|
|
|
|
|
|
|
%build
|
|
|
|
%python_build
|
|
|
|
|
|
|
|
%install
|
2020-02-03 11:56:06 +01:00
|
|
|
cp %{S:48} README.SUSE
|
2019-10-04 00:23:50 +02:00
|
|
|
# We install scripts into /usr/lib to avoid silly conflicts with other pkgs.
|
|
|
|
install -d -m 0755 %{buildroot}%{_libexecdir}/%{pkgname}
|
|
|
|
%python_install "--install-scripts=%{_libexecdir}/%{pkgname}/"
|
2017-06-18 20:49:01 +02:00
|
|
|
|
2019-10-04 00:23:50 +02:00
|
|
|
# While we provide a systemd service, link synctl so it's simpler to use.
|
|
|
|
install -d -m 0755 %{buildroot}%{_bindir}
|
|
|
|
ln -s %{_libexecdir}/%{pkgname}/synctl %{buildroot}%{_bindir}/synctl
|
|
|
|
|
|
|
|
# Install default matrix-synapse configuration.
|
|
|
|
# TODO: Switch to the debian default config.
|
2020-02-03 11:56:06 +01:00
|
|
|
install -d -m 0750 \
|
|
|
|
%{buildroot}%{_sysconfdir}/%{pkgname}/ \
|
|
|
|
%{buildroot}%{_sysconfdir}/%{pkgname}/{conf,keys}.d/
|
|
|
|
install -D -m 0640 contrib/systemd/log_config.yaml %{buildroot}%{_sysconfdir}/%{pkgname}/log.yaml
|
|
|
|
install -D -m 0640 contrib/systemd/log_config.yaml %{buildroot}%{_sysconfdir}/%{pkgname}/log.systemd.yaml
|
|
|
|
install -D -m 0640 contrib/example_log_config.yaml %{buildroot}%{_sysconfdir}/%{pkgname}/log.file.yaml
|
2019-10-04 00:23:50 +02:00
|
|
|
|
|
|
|
# Man pages.
|
|
|
|
install -D -m 0644 -t %{buildroot}%{_mandir}/man1 debian/*.1
|
|
|
|
|
|
|
|
# system configuration.
|
2017-07-04 12:19:47 +02:00
|
|
|
mkdir -p %{buildroot}%{_sbindir}
|
2019-10-04 00:23:50 +02:00
|
|
|
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{pkgname}
|
2020-02-03 11:56:06 +01:00
|
|
|
#
|
2019-12-21 02:07:17 +01:00
|
|
|
install -D -m 0644 %{S:50} %{buildroot}%{_unitdir}/%{pkgname}.service
|
2020-02-03 11:56:06 +01:00
|
|
|
install -D -m 0644 %{S:49} %{buildroot}%{_tmpfilesdir}/%{pkgname}.conf
|
|
|
|
#
|
|
|
|
install -D -m 0755 %{S:51} %{buildroot}%{_sbindir}/matrix-synapse-generate-config
|
2017-06-18 20:49:01 +02:00
|
|
|
|
2019-10-04 00:23:50 +02:00
|
|
|
# User directory.
|
2020-02-03 11:56:06 +01:00
|
|
|
install -d -m 0750 %{buildroot}%{_rundir}/%{pkgname}
|
2019-10-04 00:23:50 +02:00
|
|
|
install -d -m 0750 %{buildroot}%{_localstatedir}/lib/%{pkgname}
|
2020-02-03 11:56:06 +01:00
|
|
|
install -d -m 0750 %{buildroot}%{_localstatedir}/log/%{pkgname}
|
2017-06-18 20:49:01 +02:00
|
|
|
|
2017-06-29 21:39:37 +02:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2017-06-18 20:49:01 +02:00
|
|
|
|
|
|
|
%pre
|
2019-10-04 00:23:50 +02:00
|
|
|
getent group synapse >/dev/null || groupadd -r synapse
|
2017-07-04 12:19:47 +02:00
|
|
|
getent passwd synapse >/dev/null || \
|
2020-02-03 11:56:06 +01:00
|
|
|
/usr/sbin/useradd -r -g synapse -s /bin/false -c 'Matrix Synapse' \
|
|
|
|
-d %{_rundir}/%{pkgname} synapse
|
|
|
|
usermod --shell=/bin/false --home=%{_localstatedir}/lib/%{pkgname} --gid=synapse synapse
|
2019-10-04 00:23:50 +02:00
|
|
|
%service_add_pre %{pkgname}.service
|
2017-06-18 20:49:01 +02:00
|
|
|
|
|
|
|
%post
|
2020-02-03 11:56:06 +01:00
|
|
|
%tmpfiles_create %{_tmpfilesdir}/%{pkgname}.conf
|
2019-10-04 00:23:50 +02:00
|
|
|
%service_add_post %{pkgname}.service
|
2017-06-18 20:49:01 +02:00
|
|
|
|
|
|
|
%preun
|
2019-10-04 00:23:50 +02:00
|
|
|
%service_del_preun %{pkgname}.service
|
2017-06-18 20:49:01 +02:00
|
|
|
|
|
|
|
%postun
|
2019-10-04 00:23:50 +02:00
|
|
|
%service_del_postun %{pkgname}.service
|
2017-06-18 20:49:01 +02:00
|
|
|
|
2019-10-04 00:23:50 +02:00
|
|
|
%files -n %{pkgname}
|
2020-02-03 11:56:06 +01:00
|
|
|
%doc *.rst CHANGES.md README.SUSE
|
2019-10-04 00:23:50 +02:00
|
|
|
%license LICENSE
|
2020-02-03 11:56:06 +01:00
|
|
|
%config(noreplace) %attr(-,root,synapse) %{_sysconfdir}/%{pkgname}/
|
2019-10-04 00:23:50 +02:00
|
|
|
%dir %attr(0750,%{modname},%{modname}) %{_localstatedir}/lib/%{pkgname}
|
2020-02-03 11:56:06 +01:00
|
|
|
%dir %attr(0750,%{modname},%{modname}) %{_localstatedir}/log/%{pkgname}
|
2017-06-18 20:49:01 +02:00
|
|
|
%{python_sitelib}
|
2019-10-04 00:23:50 +02:00
|
|
|
# Python helper scripts.
|
|
|
|
%{_bindir}/synctl
|
|
|
|
%{_libexecdir}/%{pkgname}
|
|
|
|
# systemd service.
|
|
|
|
%{_sbindir}/rc%{pkgname}
|
2020-02-03 11:56:06 +01:00
|
|
|
%{_sbindir}/matrix-synapse-generate-config
|
2019-10-04 00:23:50 +02:00
|
|
|
%{_unitdir}/%{pkgname}.service
|
2020-02-03 11:56:06 +01:00
|
|
|
%{_tmpfilesdir}/%{pkgname}.conf
|
2019-10-04 00:23:50 +02:00
|
|
|
# Man pages.
|
|
|
|
%{_mandir}/man*/*
|
2020-02-03 11:56:06 +01:00
|
|
|
%ghost %dir %attr(750,%{modname},%{modname}) /run/matrix-synapse
|
2017-07-04 12:19:47 +02:00
|
|
|
|
2017-06-18 20:49:01 +02:00
|
|
|
%changelog
|