From 05db9d1f175499da3ac7bd86fada2ddd2516a35d7e2d53e451bf114cf1a2fac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 27 May 2020 14:46:02 +0000 Subject: [PATCH] Accepting request 809592 from home:pgajdos:python submit OBS-URL: https://build.opensuse.org/request/show/809592 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-devpi-server?expand=0&rev=9 --- python-devpi-server.changes | 5 +++++ python-devpi-server.spec | 35 ++++++++++++++++++++++++++++++++--- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/python-devpi-server.changes b/python-devpi-server.changes index bef1b98..5d1ef97 100644 --- a/python-devpi-server.changes +++ b/python-devpi-server.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue May 26 07:22:39 UTC 2020 - Petr Gajdos + +- %python3_only -> %python_alternative + ------------------------------------------------------------------- Thu Apr 2 11:26:56 UTC 2020 - Marketa Calabkova diff --git a/python-devpi-server.spec b/python-devpi-server.spec index 03a2849..ffcead9 100644 --- a/python-devpi-server.spec +++ b/python-devpi-server.spec @@ -17,6 +17,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} +%define commands export fsck gen-config import init passwd server %define skip_python2 1 Name: python-devpi-server Version: 5.4.1 @@ -42,6 +43,8 @@ Requires: python-repoze.lru >= 0.6 Requires: python-ruamel.yaml >= 0.15.94 Requires: python-strictyaml Requires: python-waitress >= 1.0.1 +Requires(post): update-alternatives +Requires(postun): update-alternatives # nginx tests failing when not skipped, likely due to rpmbuild environment Suggests: nginx Suggests: python-WebTest @@ -83,17 +86,43 @@ sed -i "s/--flake8//" tox.ini %install %python_install +for c in %{commands}; do + %python_clone -a %{buildroot}%{_bindir}/devpi-$c +done %python_expand %fdupes %{buildroot}%{$python_sitelib} %check export PYTHONDONTWRITEBYTECODE=1 -export PATH=$PATH:%{buildroot}/%{_bindir} -%pytest --slow --ignore test_devpi_server %{buildroot}%{$python_sitelib}/test_devpi_server +%{python_expand \ +mkdir bin-%{$python_version} +for c in %{commands}; do + ln -s %{buildroot}%{_bindir}/devpi-$c-%{$python_version} bin-%{$python_version}/devpi-$c +done +export PATH=$PATH:`pwd`/bin-%{$python_version} +export PYTHONPATH=:%{buildroot}%{$python_sitelib} +$python -m pytest --slow --ignore test_devpi_server %{buildroot}%{$python_sitelib}/test_devpi_server +} + +%post +for c in %{commands}; do + %python_install_alternative devpi-$c +done + +%postun +for c in %{commands}; do + %python_uninstall_alternative devpi-$c +done %files %{python_files} %doc CHANGELOG README.rst %license LICENSE -%python3_only %{_bindir}/devpi* +%python_alternative %{_bindir}/devpi-export +%python_alternative %{_bindir}/devpi-fsck +%python_alternative %{_bindir}/devpi-gen-config +%python_alternative %{_bindir}/devpi-import +%python_alternative %{_bindir}/devpi-init +%python_alternative %{_bindir}/devpi-passwd +%python_alternative %{_bindir}/devpi-server %{python_sitelib}/* %changelog