Accepting request 866513 from home:bnavigator:branches:network:messaging:matrix

- Remove python singlespec macro usage: This package only builds
  against the primary python3 flavor. No need to pull in and expand
  legacy python36 
- Remove Leap 42 python2 handling in matrix-synapse-test.spec

OBS-URL: https://build.opensuse.org/request/show/866513
OBS-URL: https://build.opensuse.org/package/show/network:messaging:matrix/matrix-synapse?expand=0&rev=157
This commit is contained in:
Marcus Rückert 2021-01-26 16:26:03 +00:00 committed by Git OBS Bridge
parent c4fa6a8d35
commit 3bcc3eeb19
3 changed files with 27 additions and 30 deletions

View File

@ -18,14 +18,9 @@
# synapse only supports python >= 3.5, which is not available on pre-15 Leap.
# However, future versions of matrix-synapse will no longer support python2 and
# continued use of python2 is not recommended, so on newer distributions we
# only use python3. As a result, at no point do we have two versions of the
# continued use of python2 is not recommended, so we only use the primary
# python3 flavor. As a result, at no point do we have two versions of the
# matrix-synapse package.
%if 0%{?suse_version} < 1500
%define skip_python3 1
%else
%define skip_python2 1
%endif
# Disable debug packages since we're not installing anything.
%define debug_package %{nil}
@ -37,7 +32,6 @@ Release: 0
Summary: Test package for %{pkgname}
License: Apache-2.0
BuildRequires: %{pkgname} == %{version}
BuildRequires: python-rpm-macros
%description
.
@ -53,7 +47,7 @@ touch %{_sourcedir}/%{pkgname}
# Following tests disabled which would need to be run as 'synapse' user which
# we can not do easily (or at all) within RPM
# Generate a sample config.
#%{python_flavor} -m synapse.app.homeserver \
#python3 -m synapse.app.homeserver \
# --generate-config \
# --server localhost \
# --config-path dummy-homeserver.yaml \
@ -64,7 +58,7 @@ touch %{_sourcedir}/%{pkgname}
# manually run the module.
#synctl start dummy-homeserver.yaml
#sleep 2s
#%{python_flavor} -m synapse._scripts.register_new_matrix_user \
#python3 -m synapse._scripts.register_new_matrix_user \
# http://localhost:8008 \
# --config dummy-homeserver.yaml \
# --admin --user opensuse --password opensuse

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Mon Jan 25 09:28:42 UTC 2021 - Ben Greiner <code@bnavigator.de>
- Remove python singlespec macro usage: This package only builds
against the primary python3 flavor. No need to pull in and expand
legacy python36
- Remove Leap 42 python2 handling in matrix-synapse-test.spec
-------------------------------------------------------------------
Wed Jan 13 12:28:54 UTC 2021 - Marcus Rueckert <mrueckert@suse.de>

View File

@ -41,12 +41,9 @@
# 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
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define modname synapse
%define pkgname matrix-synapse
%define eggname matrix_synapse
Name: %{pkgname}
Version: 1.25.0
Release: 0
@ -64,19 +61,17 @@ Source51: matrix-synapse-generate-config.sh
# to clean up your working copy afterwards: git reset --hard ; rm -rv .pc patches
Source99: series
Patch: matrix-synapse-1.4.1-paths.patch
BuildRequires: %{python_module base}
BuildRequires: %{python_module psutil >= 2.0.0}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module treq >= 15.1.0}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: python3-base
BuildRequires: python3-psutil >= 2.0.0
BuildRequires: python3-setuptools
BuildRequires: python3-treq >= 15.1.0
BuildRequires: systemd-rpm-macros
BuildRequires: unzip
%{?systemd_requires}
Requires(pre): shadow
%ifpython3
Requires: %{python_flavor} >= 3.5
%endif
Requires: python3-base >= 3.5
# NOTE: Keep this is in the same order as synapse/python_dependencie.py.
BuildRequires: python3-Pillow >= 4.3.0
%requires_eq python3-Pillow
@ -191,8 +186,6 @@ Provides: python2-matrix-synapse = %{version}-%{release}
Obsoletes: python3-matrix-synapse < %{version}-%{release}
Provides: python3-matrix-synapse = %{version}-%{release}
%python_subpackages
%description
Synapse is a Python-based reference "homeserver" implementation of
Matrix. Matrix is a system for federated Instant Messaging and VoIP.
@ -205,21 +198,21 @@ 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.
# Force the usage of the default python3 sys executable
find ./ -type f \
-exec sed -i '1s|^#!/usr/bin/python$|#!/usr/bin/%{python_flavor}|' {} \;
-exec sed -i '1s|^#!/usr/bin/python.*$|#!%{__python3}|' {} \;
# Update the python flavour in the service file.
sed -i 's|@PYTHON_FLAVOR@|%{_bindir}/%{python_flavor}|g' %{S:50}
sed -i 's|@PYTHON_FLAVOR@|%{__python3}|g' %{S:50}
%build
%python_build
%python3_build
%install
cp %{S:48} README.SUSE
# 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}/"
%python3_install "--install-scripts=%{_libexecdir}/%{pkgname}/"
# While we provide a systemd service, link synctl so it's simpler to use.
install -d -m 0755 %{buildroot}%{_bindir}
@ -251,7 +244,7 @@ install -d -m 0750 %{buildroot}%{_rundir}/%{pkgname}
install -d -m 0750 %{buildroot}%{_localstatedir}/lib/%{pkgname}
install -d -m 0750 %{buildroot}%{_localstatedir}/log/%{pkgname}
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%fdupes %{buildroot}%{python3_sitelib}
%pre
getent group synapse >/dev/null || groupadd -r synapse
@ -277,7 +270,9 @@ usermod --shell=/bin/false --home=%{_localstatedir}/lib/%{pkgname} --gid=synapse
%config(noreplace) %attr(-,root,synapse) %{_sysconfdir}/%{pkgname}/
%dir %attr(0750,%{modname},%{modname}) %{_localstatedir}/lib/%{pkgname}
%dir %attr(0750,%{modname},%{modname}) %{_localstatedir}/log/%{pkgname}
%{python_sitelib}
%{python3_sitelib}/%{modname}
%{python3_sitelib}/synmark
%{python3_sitelib}/%{eggname}-%{version}*-info
# Python helper scripts.
%{_bindir}/synctl
%{_libexecdir}/%{pkgname}