From d005a22d83f3efc626b75763076ac2086af302e70ea7824866a95b7a809bb243 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Tue, 19 May 2020 12:12:23 +0000 Subject: [PATCH] Accepting request 807227 from home:pgajdos:python submit OBS-URL: https://build.opensuse.org/request/show/807227 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-qrcode?expand=0&rev=17 --- python-qrcode.changes | 5 +++++ python-qrcode.spec | 25 +++++++++++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/python-qrcode.changes b/python-qrcode.changes index fcc2dfb..bf5fddd 100644 --- a/python-qrcode.changes +++ b/python-qrcode.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue May 19 09:27:37 UTC 2020 - Petr Gajdos + +- %python3_only -> %python_alternative + ------------------------------------------------------------------- Wed Mar 27 13:04:46 UTC 2019 - pgajdos@suse.com diff --git a/python-qrcode.spec b/python-qrcode.spec index 0e8d73a..6fc4b86 100644 --- a/python-qrcode.spec +++ b/python-qrcode.spec @@ -1,7 +1,7 @@ # # spec file for package python-qrcode # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -23,7 +23,7 @@ Release: 0 Summary: QR Code image generator License: BSD-3-Clause Group: Development/Languages/Python -Url: https://github.com/lincolnloop/python-qrcode +URL: https://github.com/lincolnloop/python-qrcode Source: https://files.pythonhosted.org/packages/source/q/qrcode/qrcode-%{version}.tar.gz BuildRequires: %{python_module Pillow} BuildRequires: %{python_module mock} @@ -32,8 +32,9 @@ BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-setuptools +Requires(post): update-alternatives +Requires(postun): update-alternatives Recommends: python-Pillow -BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch %python_subpackages @@ -51,16 +52,24 @@ sed -i '1s@^#!.*@@' qrcode/console_scripts.py %install %python_install +%python_clone -a %{buildroot}%{_mandir}/man1/qr.1 +%python_clone -a %{buildroot}%{_bindir}/qr %fdupes %{buildroot}%{_prefix} %check -%python_exec -m pytest -s qrcode +%pytest -s qrcode + +%post +%python_install_alternative qr qr.1 + +%postun +%python_uninstall_alternative qr qr.1 %files %{python_files} -%defattr(-,root,root,-) -%doc CHANGES.rst LICENSE README.rst -%python3_only %{_bindir}/qr -%python3_only %{_mandir}/man1/qr.1%{?ext_man} +%license LICENSE +%doc CHANGES.rst README.rst +%python_alternative %{_bindir}/qr +%python_alternative %{_mandir}/man1/qr.1%{?ext_man} %{python_sitelib}/* %changelog