2012-06-08 14:24:33 +00:00
|
|
|
%global pkgname qrcode
|
|
|
|
|
|
|
|
Name: python-%{pkgname}
|
2021-12-09 16:01:49 +00:00
|
|
|
Version: 7.3.1
|
2022-01-04 19:49:50 +00:00
|
|
|
Release: %autorelease
|
2012-06-08 14:24:33 +00:00
|
|
|
Summary: Python QR Code image generator
|
|
|
|
|
|
|
|
License: BSD
|
|
|
|
URL: https://github.com/lincolnloop/python-qrcode
|
2019-05-26 15:29:33 +00:00
|
|
|
Source0: https://pypi.python.org/packages/source/q/qrcode/qrcode-%{version}.tar.gz
|
2012-06-08 14:24:33 +00:00
|
|
|
BuildArch: noarch
|
2015-07-17 09:51:53 +00:00
|
|
|
|
|
|
|
BuildRequires: python3-devel
|
|
|
|
BuildRequires: python3-setuptools
|
|
|
|
BuildRequires: python3-six
|
2022-01-04 19:45:23 +00:00
|
|
|
%if ! 0%{?rhel}
|
|
|
|
# RHEL only ships qrcode-core and does not have pillow
|
|
|
|
BuildRequires: python3-imaging
|
|
|
|
%endif
|
2015-07-17 09:51:53 +00:00
|
|
|
|
2017-08-19 13:42:26 +00:00
|
|
|
%global _description\
|
|
|
|
This module uses the Python Imaging Library (PIL) to allow for the\
|
2018-10-11 20:15:47 +00:00
|
|
|
generation of QR Codes.
|
2017-08-19 13:42:26 +00:00
|
|
|
|
|
|
|
%description %_description
|
|
|
|
|
2015-07-17 09:51:53 +00:00
|
|
|
%package -n python3-%{pkgname}
|
|
|
|
Summary: Python QR Code image generator
|
|
|
|
Requires: python3-imaging
|
|
|
|
# For entry point:
|
|
|
|
Requires: python3-setuptools
|
|
|
|
Requires: python3-%{pkgname}-core = %{version}-%{release}
|
|
|
|
|
|
|
|
%description -n python3-%{pkgname}
|
|
|
|
This module uses the Python Imaging Library (PIL) to allow for the
|
|
|
|
generation of QR Codes. Python 3 version.
|
|
|
|
|
|
|
|
%package -n python3-%{pkgname}-core
|
|
|
|
Requires: python3-six
|
|
|
|
Summary: Python 3 QR Code image generator (core library)
|
|
|
|
|
|
|
|
%description -n python3-%{pkgname}-core
|
|
|
|
Core Python 3 module for QR code generation. Does not contain image rendering.
|
2014-09-10 18:00:29 +00:00
|
|
|
|
2012-06-08 14:24:33 +00:00
|
|
|
%prep
|
2019-05-26 15:29:33 +00:00
|
|
|
%autosetup -n qrcode-%{version}
|
2012-06-08 14:24:33 +00:00
|
|
|
|
2014-09-10 20:43:02 +00:00
|
|
|
# The pure plugin requires pymaging which is not packaged in Fedora.
|
2018-10-11 20:15:47 +00:00
|
|
|
rm qrcode/image/pure.py*
|
2015-07-17 09:51:53 +00:00
|
|
|
|
|
|
|
# Remove shebang
|
2018-10-11 20:15:47 +00:00
|
|
|
sed -i '1d' qrcode/console_scripts.py
|
2012-06-08 14:24:33 +00:00
|
|
|
|
|
|
|
%build
|
2018-10-11 20:15:47 +00:00
|
|
|
%py3_build
|
2012-06-08 14:24:33 +00:00
|
|
|
|
|
|
|
%install
|
2018-10-11 20:15:47 +00:00
|
|
|
%py3_install
|
2015-07-17 09:51:53 +00:00
|
|
|
|
|
|
|
# Do not install tests
|
|
|
|
rm -r %{buildroot}%{python3_sitelib}/%{pkgname}/tests
|
2012-06-08 14:24:33 +00:00
|
|
|
|
2014-09-10 20:43:02 +00:00
|
|
|
#
|
|
|
|
# In previous iterations of the package, the qr script had been
|
|
|
|
# renamed to qrcode. This was an unnecessary change from upstream.
|
|
|
|
#
|
|
|
|
# We cary this symlink to maintain compat with old packages.
|
|
|
|
#
|
|
|
|
ln -s qr %{buildroot}%{_bindir}/qrcode
|
2012-06-08 14:24:33 +00:00
|
|
|
|
|
|
|
%check
|
2022-01-04 19:45:23 +00:00
|
|
|
%if 0%{?rhel}
|
|
|
|
# test method requires PIL
|
|
|
|
sed -i s/test_render_pil/disabled_render_pil/g qrcode/tests/test_qrcode.py
|
|
|
|
%endif
|
|
|
|
PYTHONPATH=%{buildroot}%{python3_sitelib} \
|
|
|
|
%{__python3} -m unittest -v qrcode.tests.test_qrcode.QRCodeTests
|
2015-07-17 09:51:53 +00:00
|
|
|
|
|
|
|
%files -n python3-%{pkgname}
|
|
|
|
%{_bindir}/qr
|
|
|
|
%{_bindir}/qrcode
|
|
|
|
%{_mandir}/man1/qr.1*
|
|
|
|
%{python3_sitelib}/%{pkgname}/image/svg.py*
|
|
|
|
%{python3_sitelib}/%{pkgname}/image/pil.py*
|
2021-12-09 16:01:49 +00:00
|
|
|
%{python3_sitelib}/%{pkgname}/image/styledpil.py*
|
2015-07-17 09:51:53 +00:00
|
|
|
%{python3_sitelib}/%{pkgname}/image/__pycache__/svg.*
|
|
|
|
%{python3_sitelib}/%{pkgname}/image/__pycache__/pil.*
|
2021-12-09 16:01:49 +00:00
|
|
|
%{python3_sitelib}/%{pkgname}/image/__pycache__/styledpil.*
|
2015-07-17 09:51:53 +00:00
|
|
|
|
2019-05-26 15:29:33 +00:00
|
|
|
%files -n python3-%{pkgname}-core
|
2018-10-11 20:15:47 +00:00
|
|
|
%doc README.rst CHANGES.rst
|
|
|
|
%license LICENSE
|
2015-07-17 09:51:53 +00:00
|
|
|
%dir %{python3_sitelib}/%{pkgname}/
|
|
|
|
%dir %{python3_sitelib}/%{pkgname}/image
|
|
|
|
%dir %{python3_sitelib}/%{pkgname}/image/__pycache__
|
|
|
|
%{python3_sitelib}/%{pkgname}*.egg-info
|
|
|
|
%{python3_sitelib}/%{pkgname}/*.py*
|
|
|
|
%{python3_sitelib}/%{pkgname}/__pycache__
|
|
|
|
%{python3_sitelib}/%{pkgname}/image/__init__.py*
|
|
|
|
%{python3_sitelib}/%{pkgname}/image/base.py*
|
2021-12-09 16:01:49 +00:00
|
|
|
%{python3_sitelib}/%{pkgname}/image/styles/
|
2015-07-17 09:51:53 +00:00
|
|
|
%{python3_sitelib}/%{pkgname}/image/__pycache__/__init__.*
|
|
|
|
%{python3_sitelib}/%{pkgname}/image/__pycache__/base.*
|
2012-06-08 14:24:33 +00:00
|
|
|
|
|
|
|
%changelog
|
2022-01-04 19:49:50 +00:00
|
|
|
%autochangelog
|