forked from pool/python-qrcode
- 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
This commit is contained in:
committed by
Git OBS Bridge
parent
ebdd0ba79a
commit
8d91c2f246
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:33bdee5e834fc99eb538e1dad198a3a5b70d0a88845629cacf4c592be1ce7f6a
|
||||
size 22259
|
||||
3
qrcode-5.3.tar.gz
Normal file
3
qrcode-5.3.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4115ccee832620df16b659d4653568331015c718a754855caf5930805d76924e
|
||||
size 24253
|
||||
Reference in New Issue
Block a user