diff --git a/matrix-synapse.spec b/matrix-synapse.spec index 4fee036..f50ddaa 100644 --- a/matrix-synapse.spec +++ b/matrix-synapse.spec @@ -14,6 +14,7 @@ URL: https://github.com/matrix-org/%{srcname} Source0: %{url}/archive/v%{version}%{rcx}/%{srcname}-%{version}%{rcx}.tar.gz Source1: synapse.sysconfig Source2: synapse.service +Source3: matrix-synapse.sysusers # non-upstreamable patch to accept any version of python-cryptography, see RHBZ#1978949 Patch1: 0001-relax-cryptography-dependency-version-requirement.patch BuildArch: noarch @@ -103,6 +104,7 @@ install -p -D -T -m 0644 contrib/systemd/log_config.yaml %{buildroot}%{_sysconfd 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 -m 755 %{buildroot}/%{_sharedstatedir}/synapse +install -p -D -m 0644 %{SOURCE3} %{buildroot}%{_sysusersdir}/%{name}.conf %check @@ -110,11 +112,7 @@ PYTHONPATH=. trial-3 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 +%sysusers_create_compat %{SOURCE3} %post %systemd_post synapse.service @@ -137,6 +135,7 @@ exit 0 %attr(755,synapse,synapse) %dir %{_sharedstatedir}/synapse %attr(755,synapse,synapse) %dir %{_sysconfdir}/synapse %attr(644,synapse,synapse) %config(noreplace) %{_sysconfdir}/synapse/* +%{_sysusersdir}/%{name}.conf %changelog diff --git a/matrix-synapse.sysusers b/matrix-synapse.sysusers new file mode 100644 index 0000000..97adeeb --- /dev/null +++ b/matrix-synapse.sysusers @@ -0,0 +1,2 @@ +#Type Name ID GECOS Home directory Shell +u synapse - "Runs the Synapse Matrix homeserver" /run/synapse /sbin/nologin