2012-06-08 14:24:33 +00:00
|
|
|
%global pkgname qrcode
|
|
|
|
|
|
|
|
Name: python-%{pkgname}
|
2023-05-01 13:10:08 +00:00
|
|
|
Version: 7.4.2
|
2022-01-04 19:49:50 +00:00
|
|
|
Release: %autorelease
|
2012-06-08 14:24:33 +00:00
|
|
|
Summary: Python QR Code image generator
|
|
|
|
|
2023-08-23 17:05:49 +00:00
|
|
|
License: BSD-3-Clause
|
2012-06-08 14:24:33 +00:00
|
|
|
URL: https://github.com/lincolnloop/python-qrcode
|
2023-05-01 13:48:14 +00:00
|
|
|
Source0: %{pypi_source qrcode}
|
2012-06-08 14:24:33 +00:00
|
|
|
BuildArch: noarch
|
2015-07-17 09:51:53 +00:00
|
|
|
|
|
|
|
BuildRequires: python3-devel
|
2023-05-23 21:51:59 +00:00
|
|
|
BuildRequires: python3-pytest
|
2023-05-01 13:48:14 +00:00
|
|
|
|
|
|
|
# Comment out failing test
|
|
|
|
Patch0: qrcode_test.patch
|
2023-05-12 12:13:59 +00:00
|
|
|
# Fix failure with Python3.12
|
|
|
|
Patch1: qrcode_assert-has-calls.patch
|
2023-07-25 02:34:09 +00:00
|
|
|
# Make pypng requirement optional
|
|
|
|
# https://github.com/lincolnloop/python-qrcode/pull/338
|
|
|
|
Patch2: qrcode-optional-pypng.patch
|
2023-05-01 13:48:14 +00:00
|
|
|
|
|
|
|
%description
|
2017-08-19 13:42:26 +00:00
|
|
|
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
|
|
|
|
2023-05-01 13:10:08 +00:00
|
|
|
|
2015-07-17 09:51:53 +00:00
|
|
|
%package -n python3-%{pkgname}
|
|
|
|
Summary: Python QR Code image generator
|
2023-05-01 13:48:14 +00:00
|
|
|
Obsoletes: python3-qrcode-core < 7.4.2-2
|
|
|
|
Provides: python3-qrcode-core = %{version}-%{release}
|
2015-07-17 09:51:53 +00:00
|
|
|
|
|
|
|
%description -n python3-%{pkgname}
|
|
|
|
This module uses the Python Imaging Library (PIL) to allow for the
|
|
|
|
generation of QR Codes. Python 3 version.
|
|
|
|
|
2023-05-01 13:10:08 +00:00
|
|
|
|
2023-05-01 13:48:14 +00:00
|
|
|
%generate_buildrequires
|
2023-05-23 21:51:59 +00:00
|
|
|
# RHEL does not include the extra test dependencies (coverage, pillow)
|
2023-07-25 02:34:09 +00:00
|
|
|
%pyproject_buildrequires %{?!rhel:-x test -x pil -x png}
|
2014-09-10 18:00:29 +00:00
|
|
|
|
2023-05-01 13:10:08 +00:00
|
|
|
|
2012-06-08 14:24:33 +00:00
|
|
|
%prep
|
2022-11-25 19:38:38 +00:00
|
|
|
%autosetup -n qrcode-%{version} -p1
|
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
|
|
|
|
2023-05-01 13:10:08 +00:00
|
|
|
|
2012-06-08 14:24:33 +00:00
|
|
|
%build
|
2023-05-01 13:48:14 +00:00
|
|
|
%pyproject_wheel
|
2012-06-08 14:24:33 +00:00
|
|
|
|
2023-05-01 13:10:08 +00:00
|
|
|
|
2012-06-08 14:24:33 +00:00
|
|
|
%install
|
2023-05-01 13:48:14 +00:00
|
|
|
%pyproject_install
|
|
|
|
%pyproject_save_files qrcode
|
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
|
|
|
|
2023-05-01 13:48:14 +00:00
|
|
|
|
2012-06-08 14:24:33 +00:00
|
|
|
%check
|
2023-07-25 02:34:09 +00:00
|
|
|
%pytest -v
|
2015-07-17 09:51:53 +00:00
|
|
|
|
2023-05-01 13:10:08 +00:00
|
|
|
|
2023-05-01 13:48:14 +00:00
|
|
|
%files -n python3-%{pkgname} -f %{pyproject_files}
|
|
|
|
%doc README.rst CHANGES.rst
|
|
|
|
%license LICENSE
|
2015-07-17 09:51:53 +00:00
|
|
|
%{_bindir}/qr
|
|
|
|
%{_bindir}/qrcode
|
|
|
|
%{_mandir}/man1/qr.1*
|
2012-06-08 14:24:33 +00:00
|
|
|
|
|
|
|
%changelog
|
2022-01-04 19:49:50 +00:00
|
|
|
%autochangelog
|