From 8d91c2f246cf910993ee691f60ac5e4835ccfc30df1b1ef6a7bfa95cfcc82819 Mon Sep 17 00:00:00 2001 From: Jan Matejek Date: Mon, 5 Jun 2017 12:44:07 +0000 Subject: [PATCH] - convert to singlespec - make binary python3-only - enable tests - add proper requirements (fixes boo#1040540) - update to 5.3 * better support for tty output in python3 * --error-correction option * fix incomplete block table for QR version 15 * fix BaseImage.get_image OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-qrcode?expand=0&rev=11 --- python-qrcode.changes | 13 ++++++++ python-qrcode.spec | 74 ++++++++++++++----------------------------- qrcode-5.1.tar.gz | 3 -- qrcode-5.3.tar.gz | 3 ++ 4 files changed, 39 insertions(+), 54 deletions(-) delete mode 100644 qrcode-5.1.tar.gz create mode 100644 qrcode-5.3.tar.gz diff --git a/python-qrcode.changes b/python-qrcode.changes index 069ccf2..b9c1c0d 100644 --- a/python-qrcode.changes +++ b/python-qrcode.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Mon Jun 5 12:38:43 UTC 2017 - jmatejek@suse.com + +- convert to singlespec +- make binary python3-only +- enable tests +- add proper requirements (fixes boo#1040540) +- update to 5.3 + * better support for tty output in python3 + * --error-correction option + * fix incomplete block table for QR version 15 + * fix BaseImage.get_image + ------------------------------------------------------------------- Sat Aug 22 07:58:58 UTC 2015 - bruno@ioda-net.ch diff --git a/python-qrcode.spec b/python-qrcode.spec index 4b7fe18..6648ecf 100644 --- a/python-qrcode.spec +++ b/python-qrcode.spec @@ -1,7 +1,7 @@ # # spec file for package python-qrcode # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,24 +16,26 @@ # +%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-qrcode -Version: 5.1 +Version: 5.3 Release: 0 Summary: QR Code image generator License: BSD-3-Clause Group: Development/Languages/Python Url: https://github.com/lincolnloop/python-qrcode -Source: http://pypi.python.org/packages/source/q/qrcode/qrcode-%{version}.tar.gz -BuildRequires: python-devel -BuildRequires: python-setuptools -Requires(post): update-alternatives -Requires(postun): update-alternatives +Source: https://files.pythonhosted.org/packages/source/q/qrcode/qrcode-%{version}.tar.gz +BuildRequires: %{python_module Pillow} +BuildRequires: %{python_module mock} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-setuptools +Recommends: python-Pillow BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if 0%{?suse_version} && 0%{?suse_version} <= 1110 -%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -%else BuildArch: noarch -%endif +%python_subpackages %description This module uses the Python Imaging Library (PIL) to allow for the generation @@ -41,54 +43,24 @@ of QR Codes. %prep %setup -q -n qrcode-%{version} +# drop shebang from console_scripts +sed -i '1s@^#!.*@@' qrcode/console_scripts.py %build -python setup.py build +%python_build %install -python setup.py install --prefix=%{_prefix} --root=%{buildroot} +%python_install +%fdupes %{buildroot}%{_prefix} -# Prepare for update-alternatives usage -mkdir -p %{buildroot}%{_sysconfdir}/alternatives -mv -v %{buildroot}%{_bindir}/qr %{buildroot}%{_bindir}/qr-%{py_ver} -# rename man page too -mv -v %{buildroot}%{_mandir}/man1/qr.1 %{buildroot}%{_mandir}/man1/qr-%{py_ver}.1 +%check +%python_exec -m pytest qrcode -ln -s -f %{_sysconfdir}/alternatives/qr %{buildroot}%{_bindir}/qr -ln -s -f %{_sysconfdir}/alternatives/qr.1%{?ext_man} %{buildroot}%{_mandir}/man1/qr.1%{?ext_man} - -# create a dummy targets for /etc/alternatives -touch %{buildroot}%{_sysconfdir}/alternatives/qr -touch %{buildroot}%{_sysconfdir}/alternatives/qr.1%{?ext_man} - -# Fix warning about missing +x mode -chmod +x %{buildroot}%{python_sitelib}/qrcode/console_scripts.py - -%pre -# Since /usr/bin/qr became ghosted to be used with update-alternatives, we have to get rid -# of the old binary resulting from the non-update-alternativies-ified package: -[ -h %{_bindir}/qr ] || rm -f %{_bindir}/qr -[ -h %{_mandir}/man1/qr.1%{?ext_man} ] || rm -f %{_mandir}/man1/qr.1%{?ext_man} - -%post -%_sbindir/update-alternatives \ - --install %{_bindir}/qr qr %{_bindir}/qr-%{py_ver} 30 \ - --slave %{_mandir}/man1/qr.1%{?ext_man} qr.1%{?ext_man} %{_mandir}/man1/qr-%{py_ver}.1%{?ext_man} - -%postun -if [ $1 -eq 0 ] ; then - %_sbindir/update-alternatives --remove qr %{_bindir}/qr-%{py_ver} -fi - -%files +%files %{python_files} %defattr(-,root,root,-) %doc CHANGES.rst LICENSE README.rst -%{_bindir}/qr -%{_bindir}/qr-%{py_ver} -%{_mandir}/man1/qr.1%{?ext_man} -%{_mandir}/man1/qr-%{py_ver}.1%{?ext_man} -%ghost %{_sysconfdir}/alternatives/qr -%ghost %{_sysconfdir}/alternatives/qr.1%{?ext_man} +%python3_only %{_bindir}/qr +%python3_only %{_mandir}/man1/qr.1%{?ext_man} %{python_sitelib}/* %changelog diff --git a/qrcode-5.1.tar.gz b/qrcode-5.1.tar.gz deleted file mode 100644 index 6931742..0000000 --- a/qrcode-5.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:33bdee5e834fc99eb538e1dad198a3a5b70d0a88845629cacf4c592be1ce7f6a -size 22259 diff --git a/qrcode-5.3.tar.gz b/qrcode-5.3.tar.gz new file mode 100644 index 0000000..d9544d6 --- /dev/null +++ b/qrcode-5.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4115ccee832620df16b659d4653568331015c718a754855caf5930805d76924e +size 24253