2017-06-18 20:49:01 +02:00
|
|
|
#
|
|
|
|
# spec file for package matrix-synapse
|
|
|
|
#
|
|
|
|
# Copyright (c) 2017 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2017-07-10 13:05:51 +02:00
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2017-06-18 20:49:01 +02:00
|
|
|
%define github_user matrix-org
|
|
|
|
%define short_name synapse
|
|
|
|
Name: matrix-%{short_name}
|
|
|
|
Version: 0.19.2
|
|
|
|
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
|
2017-06-19 12:13:51 +02:00
|
|
|
Source0: matrix-synapse-0.19.2.tar.gz
|
2017-07-04 12:19:47 +02:00
|
|
|
Url: https://github.com/matrix-org/synapse
|
2017-06-18 20:49:01 +02:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
BuildRequires: unzip
|
|
|
|
BuildRequires: %{python_module base}
|
|
|
|
BuildRequires: %{python_module setuptools}
|
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
|
|
|
Requires(pre): shadow
|
|
|
|
%if 0%{?suse_version} >= 1330
|
|
|
|
# alternative: create a specific "synapse" group
|
|
|
|
Requires(pre): group(nogroup)
|
|
|
|
%endif
|
|
|
|
Requires: python-Twisted
|
|
|
|
Requires: python-bcrypt
|
|
|
|
Requires: python-msgpack-python
|
|
|
|
Requires: python-frozendict >= 0.4
|
|
|
|
Requires: python-unpaddedbase64 >= 1.1.0
|
|
|
|
Requires: python-canonicaljson >= 1.0.0
|
|
|
|
Requires: python-signedjson >= 1.0.0
|
|
|
|
# original from python_requirements.py
|
|
|
|
#BuildRequires: python-PyNaCl == 0.3.0
|
|
|
|
Requires: python-PyNaCl
|
|
|
|
Requires: python-service_identity >= 1.0.0
|
|
|
|
Requires: python-Twisted >= 16.0.0
|
|
|
|
Requires: python-pyOpenSSL >= 0.14
|
|
|
|
Requires: python-PyYAML
|
|
|
|
Requires: python-pyasn1
|
|
|
|
Requires: python-daemonize
|
|
|
|
Requires: python-Pillow
|
|
|
|
Requires: python-pydenticon
|
|
|
|
Requires: python-ujson
|
|
|
|
Requires: python-blist
|
|
|
|
Requires: python-pysaml2 >= 3.0.0
|
|
|
|
# original from python_requirements.py
|
|
|
|
#BuildRequires: python-pysaml2 < 4.0.0
|
|
|
|
Requires: python-pymacaroons-pynacl
|
|
|
|
Requires: python-msgpack-python >= 0.3.0
|
2017-06-29 22:53:04 +02:00
|
|
|
Requires(post): update-alternatives
|
|
|
|
Requires(postun): update-alternatives
|
2017-06-18 20:49:01 +02:00
|
|
|
BuildArch: noarch
|
2017-07-01 21:22:58 +02:00
|
|
|
%ifpython2
|
2017-07-03 22:57:44 +02:00
|
|
|
Provides: matrix-synapse = %{version}
|
2017-07-01 21:22:58 +02:00
|
|
|
%endif
|
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
|
|
|
|
%setup -q -n %{short_name}-%{version}
|
|
|
|
for i in \
|
|
|
|
app/client_reader \
|
|
|
|
app/federation_sender \
|
|
|
|
app/synchrotron \
|
|
|
|
app/pusher \
|
|
|
|
app/media_repository \
|
|
|
|
app/homeserver \
|
|
|
|
app/appservice \
|
|
|
|
app/federation_reader \
|
|
|
|
push/pusherpool \
|
|
|
|
util/versionstring
|
|
|
|
do
|
|
|
|
sed -i '1d' synapse/$i.py
|
|
|
|
done
|
|
|
|
# patch the version requirement as it would be hard to supply exactly this
|
|
|
|
# version as dependency
|
|
|
|
sed -i 's/nacl==0.3.0/nacl>=0.3.0/g' synapse/python_dependencies.py
|
|
|
|
|
|
|
|
%build
|
|
|
|
%python_build
|
|
|
|
chmod +x build/lib/synapse/app/synctl.py
|
|
|
|
|
|
|
|
%install
|
|
|
|
%python_install
|
|
|
|
|
2017-07-04 12:19:47 +02:00
|
|
|
mkdir -p "%{buildroot}%{_sysconfdir}/synapse"
|
|
|
|
install -m 0644 contrib/systemd/log_config.yaml \
|
2017-06-18 20:49:01 +02:00
|
|
|
"%{buildroot}%{_sysconfdir}/synapse"
|
2017-07-04 12:19:47 +02:00
|
|
|
mkdir -p %{buildroot}%{_sbindir}
|
2017-06-18 20:49:01 +02:00
|
|
|
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcsynapse
|
|
|
|
|
2017-07-04 12:19:47 +02:00
|
|
|
mkdir -p "%{buildroot}%{_unitdir}"
|
|
|
|
install -m 0644 contrib/systemd/synapse.service \
|
2017-06-18 20:49:01 +02:00
|
|
|
"%{buildroot}%{_unitdir}"
|
|
|
|
|
2017-07-04 12:19:47 +02:00
|
|
|
mkdir -p "%{buildroot}%{_rundir}/synapse"
|
2017-06-29 21:39:37 +02:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2017-06-18 20:49:01 +02:00
|
|
|
|
2017-06-29 22:53:04 +02:00
|
|
|
for p in hash_password register_new_matrix_user synapse_port_db synctl ; do
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/$p
|
|
|
|
done
|
|
|
|
%python_clone -a %{buildroot}%{_sbindir}/rcsynapse
|
|
|
|
%python_clone -a %{buildroot}%{_unitdir}/synapse.service
|
|
|
|
%python_clone -a %{buildroot}%{_sysconfdir}/synapse/log_config.yaml
|
|
|
|
|
2017-06-18 20:49:01 +02:00
|
|
|
%pre
|
2017-07-04 12:19:47 +02:00
|
|
|
getent passwd synapse >/dev/null || \
|
2017-06-18 20:49:01 +02:00
|
|
|
/usr/sbin/useradd -r -g nogroup -s /sbin/nologin -c 'Matrix Synapse' \
|
|
|
|
-d %{_localstatedir}/lib/synapse synapse
|
|
|
|
%service_add_pre synapse.service
|
|
|
|
|
|
|
|
%post
|
2017-06-29 22:53:04 +02:00
|
|
|
%{python_install_alternative synctl hash_password register_new_matrix_user synapse_port_db rcsynapse synapse.service log_config.yaml}
|
2017-06-18 20:49:01 +02:00
|
|
|
%service_add_post synapse.service
|
|
|
|
|
|
|
|
%preun
|
|
|
|
%service_del_preun synapse.service
|
|
|
|
|
|
|
|
%postun
|
2017-06-29 22:53:04 +02:00
|
|
|
%python_uninstall_alternative synctl
|
2017-06-18 20:49:01 +02:00
|
|
|
%service_del_postun synapse.service
|
|
|
|
|
|
|
|
%files %{python_files}
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%doc *.rst
|
|
|
|
%doc LICENSE
|
2017-06-29 22:53:04 +02:00
|
|
|
%dir %{_sysconfdir}/synapse
|
2017-06-18 20:49:01 +02:00
|
|
|
%{python_sitelib}
|
2017-06-29 22:53:04 +02:00
|
|
|
%python_alternative %{_bindir}/hash_password
|
|
|
|
%python_alternative %{_bindir}/register_new_matrix_user
|
|
|
|
%python_alternative %{_bindir}/synapse_port_db
|
|
|
|
%python_alternative %{_bindir}/synctl
|
|
|
|
%python_alternative %{_sbindir}/rcsynapse
|
|
|
|
%python_alternative %{_unitdir}/synapse.service
|
|
|
|
%config %python_alternative %{_sysconfdir}/synapse/log_config.yaml
|
2017-07-04 12:19:47 +02:00
|
|
|
|
2017-06-18 20:49:01 +02:00
|
|
|
%changelog
|