Update synapse, and add an entrypoint.

This commit is contained in:
Alex Manning 2021-06-16 01:39:27 +01:00
parent a08fff9724
commit b000650488
3 changed files with 13 additions and 2 deletions

View file

@ -1,7 +1,7 @@
%global srcname synapse %global srcname synapse
# Version suffix in URL when building release candidates # Version suffix in URL when building release candidates
%global rcx rc2 %global rcx %{nil}
%global ghversion 1.36.0 %global ghversion 1.36.0
%{?python_enable_dependency_generator} %{?python_enable_dependency_generator}
@ -21,6 +21,7 @@ URL: https://github.com/matrix-org/%{srcname}
Source0: %{url}/archive/v%{ghversion}%{rcx}/%{srcname}-%{ghversion}%{rcx}.tar.gz Source0: %{url}/archive/v%{ghversion}%{rcx}/%{srcname}-%{ghversion}%{rcx}.tar.gz
Source1: synapse.sysconfig Source1: synapse.sysconfig
Source2: synapse.service Source2: synapse.service
Source3: synapse-homeserver
BuildArch: noarch BuildArch: noarch
BuildRequires: python3-devel BuildRequires: python3-devel
@ -111,6 +112,7 @@ install -p -D -T -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/sysconfig/synapse
install -p -D -T -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/synapse.service install -p -D -T -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/synapse.service
install -p -d -m 755 %{buildroot}/%{_sharedstatedir}/synapse install -p -d -m 755 %{buildroot}/%{_sharedstatedir}/synapse
install -p -D -T -m 755 %{SOURCE3} %{buildroot}%{_bindir}/synapse-homeserver
%check %check
PYTHONPATH=. trial-3 tests PYTHONPATH=. trial-3 tests

9
synapse-homeserver Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/python3
import re
import sys
from synapse.app.homeserver import main
if __name__ == "__main__":
sys.argv[0] = re.sub(r"(-script\.pyw?|\.exe)?$", "", sys.argv[0])
sys.exit(main())

View file

@ -7,7 +7,7 @@ NotifyAccess=main
User=synapse User=synapse
Group=synapse Group=synapse
WorkingDirectory=/var/lib/synapse WorkingDirectory=/var/lib/synapse
ExecStart=/usr/bin/python3 -m synapse.app.homeserver --config-path=/etc/synapse/homeserver.yaml ExecStart=/usr/bin/synapse-homeserver --config-path=/etc/synapse/homeserver.yaml
ExecReload=/bin/kill -HUP $MAINPID ExecReload=/bin/kill -HUP $MAINPID
# EnvironmentFile=-/etc/sysconfig/synapse # Can be used to e.g. set SYNAPSE_CACHE_FACTOR # EnvironmentFile=-/etc/sysconfig/synapse # Can be used to e.g. set SYNAPSE_CACHE_FACTOR
SyslogIdentifier=synapse SyslogIdentifier=synapse