c08573
%global pkgname qrcode
c08573
c08573
%if 0%{?rhel}
c08573
# RHEL only ships qrcode-core and does not have pillow
c08573
%bcond_without coreonly
c08573
%else
c08573
%bcond_with coreonly
c08573
%endif
c08573
c08573
Name:           python-%{pkgname}
c08573
Version:        6.1
c08573
Release:        12%{?dist}
c08573
Summary:        Python QR Code image generator
c08573
c08573
License:        BSD
c08573
URL:            https://github.com/lincolnloop/python-qrcode
c08573
Source0:        https://pypi.python.org/packages/source/q/qrcode/qrcode-%{version}.tar.gz
c08573
BuildArch:      noarch
c08573
c08573
BuildRequires:  python3-devel
c08573
BuildRequires:  python3-setuptools
c08573
BuildRequires:  python3-six
c08573
%if %{without coreonly}
c08573
BuildRequires:  python3-imaging
c08573
%endif
c08573
c08573
%global _description\
c08573
This module uses the Python Imaging Library (PIL) to allow for the\
c08573
generation of QR Codes.
c08573
c08573
%description %_description
c08573
c08573
%if %{without coreonly}
c08573
%package -n python3-%{pkgname}
c08573
Summary:        Python QR Code image generator
c08573
Requires:       python3-imaging
c08573
# For entry point:
c08573
Requires:       python3-setuptools
c08573
Requires:       python3-%{pkgname}-core = %{version}-%{release}
c08573
c08573
%description -n python3-%{pkgname}
c08573
This module uses the Python Imaging Library (PIL) to allow for the
c08573
generation of QR Codes. Python 3 version.
c08573
%endif
c08573
c08573
%package -n python3-%{pkgname}-core
c08573
Requires:       python3-six
c08573
Summary:        Python 3 QR Code image generator (core library)
c08573
c08573
%description -n python3-%{pkgname}-core
c08573
Core Python 3 module for QR code generation. Does not contain image rendering.
c08573
c08573
%prep
c08573
%autosetup -n qrcode-%{version}
c08573
c08573
# The pure plugin requires pymaging which is not packaged in Fedora.
c08573
rm qrcode/image/pure.py*
c08573
c08573
# Remove shebang
c08573
sed -i '1d' qrcode/console_scripts.py
c08573
c08573
%build
c08573
%py3_build
c08573
c08573
%install
c08573
%py3_install
c08573
c08573
# Do not install tests
c08573
rm -r %{buildroot}%{python3_sitelib}/%{pkgname}/tests
c08573
c08573
#
c08573
# In previous iterations of the package, the qr script had been
c08573
# renamed to qrcode. This was an unnecessary change from upstream.
c08573
#
c08573
# We cary this symlink to maintain compat with old packages.
c08573
#
c08573
ln -s qr %{buildroot}%{_bindir}/qrcode
c08573
c08573
%if %{with coreonly}
c08573
# remove files that were part of python3-qrcode package and not shipped in
c08573
# python3-qrcode-core
c08573
rm %{buildroot}%{_bindir}/qr
c08573
rm %{buildroot}%{_bindir}/qrcode
c08573
rm %{buildroot}%{_mandir}/man1/qr.1*
c08573
%pycached rm %{buildroot}%{python3_sitelib}/%{pkgname}/image/svg.py
c08573
%pycached rm %{buildroot}%{python3_sitelib}/%{pkgname}/image/pil.py
c08573
%endif
c08573
c08573
%check
c08573
%if %{with coreonly}
c08573
# test method requires PIL
c08573
sed -i s/test_render_pil/disabled_render_pil/g qrcode/tests/test_qrcode.py
c08573
%endif
c08573
PYTHONPATH=%{buildroot}%{python3_sitelib} \
c08573
    %{__python3} -m unittest -v qrcode.tests.test_qrcode.QRCodeTests
c08573
c08573
%if %{without coreonly}
c08573
%files -n python3-%{pkgname}
c08573
%{_bindir}/qr
c08573
%{_bindir}/qrcode
c08573
%{_mandir}/man1/qr.1*
c08573
%pycached %{python3_sitelib}/%{pkgname}/image/svg.py
c08573
%pycached %{python3_sitelib}/%{pkgname}/image/pil.py
c08573
%endif
c08573
c08573
%files -n python3-%{pkgname}-core
c08573
%doc README.rst CHANGES.rst
c08573
%license LICENSE
c08573
%{python3_sitelib}/%{pkgname}
c08573
%{python3_sitelib}/%{pkgname}*.egg-info
c08573
c08573
%if %{without coreonly}
c08573
%pycached %exclude %{python3_sitelib}/%{pkgname}/image/svg.py
c08573
%pycached %exclude %{python3_sitelib}/%{pkgname}/image/pil.py
c08573
%endif
c08573
c08573
c08573
%changelog
c08573
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 6.1-12
c08573
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
c08573
  Related: rhbz#1991688
c08573
c08573
* Thu Apr 22 2021 Christian Heimes <cheimes@redhat.com> - 6.1-11
c08573
- Build only python3-qrcode-core on RHEL
c08573
- Related: #1935839
c08573
c08573
* Thu Apr 22 2021 Christian Heimes <cheimes@redhat.com> - 6.1-10
c08573
- Resolves: #1935839 Remove python-imaging build requirements for RHEL
c08573
- Run unit tests during build
c08573
c08573
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 6.1-9
c08573
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
c08573
c08573
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 6.1-8
c08573
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
c08573
c08573
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 6.1-7
c08573
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
c08573
c08573
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 6.1-6
c08573
- Rebuilt for Python 3.9
c08573
c08573
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 6.1-5
c08573
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
c08573
c08573
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 6.1-4
c08573
- Rebuilt for Python 3.8.0rc1 (#1748018)
c08573
c08573
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 6.1-3
c08573
- Rebuilt for Python 3.8
c08573
c08573
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 6.1-2
c08573
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
c08573
c08573
* Sun May 26 2019 Fabian Affolter <mail@fabian-affolter.ch> - 6.1-1
c08573
- Update to latest upstream release 6.1
c08573
c08573
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5.1-15
c08573
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
c08573
c08573
* Thu Oct 11 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 5.1-14
c08573
- Python2 binary package has been removed
c08573
  See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
c08573
c08573
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5.1-13
c08573
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
c08573
c08573
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 5.1-12
c08573
- Rebuilt for Python 3.7
c08573
c08573
* Fri Mar 23 2018 Iryna Shcherbina <ishcherb@redhat.com> - 5.1-11
c08573
- Update Python 2 dependency declarations to new packaging standards
c08573
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
c08573
c08573
* Tue Mar 20 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 5.1-10
c08573
- Also rename python-qrcode-core to python2-qrcode-core
c08573
c08573
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5.1-9
c08573
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
c08573
c08573
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 5.1-8
c08573
- Python 2 binary package renamed to python2-qrcode
c08573
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
c08573
c08573
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 5.1-7
c08573
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
c08573
c08573
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 5.1-6
c08573
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
c08573
c08573
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 5.1-5
c08573
- Rebuild for Python 3.6
c08573
c08573
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1-4
c08573
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
c08573
c08573
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 5.1-3
c08573
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
c08573
c08573
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1-2
c08573
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
c08573
c08573
* Fri Jul 10 2015 Miro Hrončok <mhroncok@redhat.com> - 5.1-1
c08573
- Update to 5.1
c08573
- Introduce python3 subpackages (#1237118)
c08573
- Moved LICENSE from %%doc to %%license
c08573
c08573
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0.1-3
c08573
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
c08573
c08573
* Tue Sep 16 2014 Nathaniel McCallum <npmccallum@redhat.com> - 5.0.1-2
c08573
- Make python-qrcode-core conflicts with python-qrcode < 5.0
c08573
c08573
* Wed Sep 10 2014 Nathaniel McCallum <npmccallum@redhat.com> - 5.0.1-1
c08573
- Update to 5.0.1
c08573
c08573
* Tue Sep 09 2014 Nathaniel McCallum <npmccallum@redhat.com> - 2.4.1-7
c08573
- Create -core subpackage for minimal dependencies
c08573
c08573
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.1-6
c08573
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
c08573
c08573
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.1-5
c08573
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
c08573
c08573
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.1-4
c08573
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
c08573
c08573
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.1-3
c08573
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
c08573
c08573
* Wed Jun  6 2012 Michel Salim <salimma@fedoraproject.org> - 2.4.1-2
c08573
- Clean up spec, removing unnecessary declarations
c08573
- Rename tool in %%{_bindir} to the less ambiguous qrcode
c08573
c08573
* Sat Jun  2 2012 Michel Salim <salimma@fedoraproject.org> - 2.4.1-1
c08573
- Initial package