copr-matrix-synapse/matrix-synapse.spec
Jeremy Cline 438af50e1b
Initial import (#1438842)
Signed-off-by: Jeremy Cline <jeremy@jcline.org>
2017-06-02 13:42:29 -04:00

156 lines
4.7 KiB
RPMSpec

%global srcname synapse
Name: matrix-%{srcname}
Version: 0.19.3
Release: 4%{?dist}
Summary: A Matrix reference homeserver written in Python using Twisted
License: ASL 2.0
URL: https://github.com/matrix-org/%{srcname}
Source0: %{url}/archive/v%{version}/%{srcname}-v%{version}.tar.gz
Source1: synapse.sysconfig
# Upstream pins its version of pynacl:
# https://github.com/matrix-org/synapse/issues/1642
Patch0: 0001-Remove-the-strict-version-requirement-for-pynacl.patch
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python-sphinx
BuildRequires: py-bcrypt
BuildRequires: pyOpenSSL >= 0.14
BuildRequires: python-bleach >= 1.4.2
BuildRequires: python-blist
BuildRequires: python-canonicaljson >= 1.0.0
BuildRequires: python-daemonize
BuildRequires: python-frozendict >= 0.4
BuildRequires: python-jinja2 >= 2.8
BuildRequires: python-jsonschema
BuildRequires: python-lxml
BuildRequires: python-matrix-synapse-ldap3 >= 0.1
BuildRequires: python-msgpack
BuildRequires: python-netaddr >= 0.7.18
BuildRequires: python-pillow
BuildRequires: python-psutil >= 2.0.0
BuildRequires: python-pyasn1
BuildRequires: python-pydenticon
BuildRequires: python-pymacaroons-pynacl
BuildRequires: python-pynacl >= 0.3.0
BuildRequires: python-pysaml2 >= 3.0.0
BuildRequires: python-service-identity >= 1.0.0
BuildRequires: python-signedjson >= 1.0.0
BuildRequires: python-systemd
BuildRequires: python-twisted >= 16.0.0
BuildRequires: python-ujson
BuildRequires: python-unpaddedbase64 >= 1.1.0
BuildRequires: python-yaml
BuildRequires: systemd
BuildRequires: python-mock
Requires: py-bcrypt
Requires: pyOpenSSL >= 0.14
Requires: python-bleach >= 1.4.2
Requires: python-blist
Requires: python-canonicaljson >= 1.0.0
Requires: python-daemonize
Requires: python-frozendict >= 0.4
Requires: python-jinja2 >= 2.8
Requires: python-jsonschema
Requires: python-lxml
Requires: python-matrix-synapse-ldap3 >= 0.1
Requires: python-msgpack
Requires: python-netaddr >= 0.7.18
Requires: python-pillow
Requires: python-psutil >= 2.0.0
Requires: python-pyasn1
Requires: python-pydenticon
Requires: python-pymacaroons-pynacl
Requires: python-pynacl >= 0.3.0
Requires: python-pysaml2 >= 3.0.0
Requires: python-service-identity >= 1.0.0
Requires: python-signedjson >= 1.0.0
Requires: python-systemd
Requires: python-twisted >= 16.0.0
Requires: python-ujson
Requires: python-unpaddedbase64 >= 1.1.0
Requires: python-yaml
Requires(pre): shadow-utils
Requires: systemd
%description
Matrix is an ambitious new ecosystem for open federated Instant Messaging and
VoIP. Synapse is a reference "homeserver" implementation of Matrix from the
core development team at matrix.org, written in Python/Twisted. It is intended
to showcase the concept of Matrix and let folks see the spec in the context of
a coded base and let you run your own homeserver and generally help bootstrap
the ecosystem.
%prep
%autosetup -p1 -n %{srcname}-%{version}
# We don't support the built-in client so remove all the bundled JS.
rm -rf synapse/static
%build
%py2_build
%install
%py2_install
install -p -D -T -m 0644 contrib/systemd/log_config.yaml %{buildroot}%{_sysconfdir}/synapse/log_config.yaml
install -p -D -T -m 0644 contrib/systemd/synapse.service %{buildroot}%{_unitdir}/synapse.service
install -p -D -T -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/sysconfig/synapse
install -p -d -m 755 %{buildroot}/%{_sharedstatedir}/synapse
%check
PYTHONPATH=. trial tests
%pre
getent group synapse >/dev/null || groupadd -r synapse
getent passwd synapse >/dev/null || \
useradd -r -g synapse -d %{_sharedstatedir}/synapse -s /sbin/nologin \
-c "The user for the Synapse Matrix server" synapse
exit 0
%post
%systemd_post synapse.service
%preun
%systemd_preun synapse.service
%postun
%systemd_postun_with_restart synapse.service
%files
%license LICENSE
%doc *.rst
%dir %{_sysconfdir}/synapse
%config(noreplace) %{_sysconfdir}/synapse/*
%config(noreplace) %{_sysconfdir}/sysconfig/synapse
%{python2_sitelib}/synapse/
%{python2_sitelib}/matrix_synapse*.egg-info/
%{_bindir}/*
%{_unitdir}/synapse.service
%attr(755,synapse,synapse) %dir %{_sharedstatedir}/synapse
%changelog
* Tue May 30 2017 Jeremy Cline <jeremy@jcline.org> - 0.19.3-4
- use _sharedstatedir rather than _localstatedir
* Wed May 17 2017 Jeremy Cline <jeremy@jcline.org> - 0.19.3-3
- Remove bundled JS
- Fix some typos in the summary and description
* Tue Apr 04 2017 Jeremy Cline <jeremy@jcline.org> - 0.19.3-2
- Remove the duplicate requirement on pysaml
* Tue Mar 28 2017 Jeremy Cline <jeremy@jcline.org> - 0.19.3-1
- Initial package