2012-06-08 14:24:33 +00:00
|
|
|
%global pkgname qrcode
|
|
|
|
|
|
|
|
Name: python-%{pkgname}
|
2015-07-17 09:51:53 +00:00
|
|
|
Version: 5.1
|
2015-11-10 17:00:20 +00:00
|
|
|
Release: 2%{?dist}
|
2012-06-08 14:24:33 +00:00
|
|
|
Summary: Python QR Code image generator
|
|
|
|
|
|
|
|
License: BSD
|
|
|
|
URL: https://github.com/lincolnloop/python-qrcode
|
|
|
|
Source0: http://pypi.python.org/packages/source/q/qrcode/qrcode-%{version}.tar.gz
|
|
|
|
|
|
|
|
BuildArch: noarch
|
2015-07-17 09:51:53 +00:00
|
|
|
|
|
|
|
BuildRequires: python2-devel
|
2014-09-10 20:43:02 +00:00
|
|
|
BuildRequires: python-setuptools
|
2012-06-08 14:24:33 +00:00
|
|
|
BuildRequires: python-imaging
|
2014-09-10 20:43:02 +00:00
|
|
|
BuildRequires: python-six
|
2015-07-17 09:51:53 +00:00
|
|
|
|
|
|
|
BuildRequires: python3-devel
|
|
|
|
BuildRequires: python3-setuptools
|
|
|
|
BuildRequires: python3-imaging
|
|
|
|
BuildRequires: python3-six
|
|
|
|
|
2012-06-08 14:24:33 +00:00
|
|
|
Requires: python-imaging
|
2014-09-10 18:00:29 +00:00
|
|
|
Requires: %{name}-core = %{version}-%{release}
|
2012-06-08 14:24:33 +00:00
|
|
|
|
|
|
|
%description
|
|
|
|
This module uses the Python Imaging Library (PIL) to allow for the
|
|
|
|
generation of QR Codes.
|
|
|
|
|
|
|
|
|
2014-09-10 18:00:29 +00:00
|
|
|
%package core
|
2014-09-10 20:43:02 +00:00
|
|
|
Requires: python-six
|
2014-09-16 15:50:20 +00:00
|
|
|
Conflicts: python-qrcode < 5.0
|
2015-07-17 09:51:53 +00:00
|
|
|
Summary: Python 2 QR Code image generator (core library)
|
2014-09-10 18:00:29 +00:00
|
|
|
|
|
|
|
%description core
|
2015-07-17 09:51:53 +00:00
|
|
|
Core Python 2 module for QR code generation. Does not contain image rendering.
|
|
|
|
|
|
|
|
|
|
|
|
%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
|
2015-07-17 09:51:53 +00:00
|
|
|
%setup -qc
|
|
|
|
|
|
|
|
mv %{pkgname}-%{version} python2
|
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.
|
2015-07-17 09:51:53 +00:00
|
|
|
rm python2/qrcode/image/pure.py*
|
|
|
|
|
|
|
|
# Remove shebang
|
|
|
|
sed -i '1d' python2/qrcode/console_scripts.py
|
|
|
|
|
|
|
|
cp -a python{2,3}
|
2014-09-10 20:43:02 +00:00
|
|
|
|
2012-06-08 14:24:33 +00:00
|
|
|
|
|
|
|
%build
|
2015-07-17 09:51:53 +00:00
|
|
|
pushd python2
|
|
|
|
%{__python2} setup.py build
|
|
|
|
popd
|
2012-06-08 14:24:33 +00:00
|
|
|
|
2015-07-17 09:51:53 +00:00
|
|
|
pushd python3
|
|
|
|
%{__python3} setup.py build
|
|
|
|
popd
|
2012-06-08 14:24:33 +00:00
|
|
|
|
|
|
|
%install
|
2015-07-17 09:51:53 +00:00
|
|
|
pushd python2
|
|
|
|
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
|
|
|
|
|
|
|
|
# Be sure binscripts are Python 3
|
|
|
|
rm %{buildroot}%{_bindir}/*
|
|
|
|
|
|
|
|
# Do not install tests
|
|
|
|
rm -r %{buildroot}%{python2_sitelib}/%{pkgname}/tests
|
|
|
|
popd
|
|
|
|
|
|
|
|
pushd python3
|
|
|
|
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
|
|
|
|
|
|
|
|
# Do not install tests
|
|
|
|
rm -r %{buildroot}%{python3_sitelib}/%{pkgname}/tests
|
|
|
|
popd
|
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
|
|
|
|
# in lieue of a real test suite
|
2015-07-17 09:51:53 +00:00
|
|
|
modules=$(find qrcode -name '*.py' \
|
|
|
|
| grep -v __init__ \
|
|
|
|
| sort \
|
|
|
|
| sed -e 's|/|.|g' \
|
|
|
|
| sed -e 's|.py$||g');
|
|
|
|
|
|
|
|
|
|
|
|
pushd python2
|
|
|
|
for m in $modules;
|
|
|
|
do
|
|
|
|
%{__python2} -c "import $m"
|
|
|
|
done
|
|
|
|
popd
|
|
|
|
|
|
|
|
pushd python3
|
|
|
|
for m in $modules;
|
2012-06-08 14:24:33 +00:00
|
|
|
do
|
2015-07-17 09:51:53 +00:00
|
|
|
%{__python3} -c "import $m"
|
2012-06-08 14:24:33 +00:00
|
|
|
done
|
2015-07-17 09:51:53 +00:00
|
|
|
popd
|
|
|
|
|
2012-06-08 14:24:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
%files
|
2015-07-17 09:51:53 +00:00
|
|
|
%{python2_sitelib}/%{pkgname}/image/svg.py*
|
|
|
|
%{python2_sitelib}/%{pkgname}/image/pil.py*
|
2014-09-10 18:00:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
%files core
|
2015-07-17 09:51:53 +00:00
|
|
|
%doc python2/README.rst python2/CHANGES.rst
|
|
|
|
%license python2/LICENSE
|
|
|
|
%dir %{python2_sitelib}/%{pkgname}/
|
|
|
|
%dir %{python2_sitelib}/%{pkgname}/image
|
|
|
|
%{python2_sitelib}/%{pkgname}*.egg-info
|
|
|
|
%{python2_sitelib}/%{pkgname}/*.py*
|
|
|
|
%{python2_sitelib}/%{pkgname}/image/__init__.py*
|
|
|
|
%{python2_sitelib}/%{pkgname}/image/base.py*
|
|
|
|
|
|
|
|
|
|
|
|
%files -n python3-%{pkgname}
|
|
|
|
%{_bindir}/qr
|
|
|
|
%{_bindir}/qrcode
|
|
|
|
%{_mandir}/man1/qr.1*
|
|
|
|
%{python3_sitelib}/%{pkgname}/image/svg.py*
|
|
|
|
%{python3_sitelib}/%{pkgname}/image/pil.py*
|
|
|
|
%{python3_sitelib}/%{pkgname}/image/__pycache__/svg.*
|
|
|
|
%{python3_sitelib}/%{pkgname}/image/__pycache__/pil.*
|
|
|
|
|
|
|
|
|
|
|
|
%files -n python3-%{pkgname}-core
|
|
|
|
%doc python3/README.rst python3/CHANGES.rst
|
|
|
|
%license python3/LICENSE
|
|
|
|
%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*
|
|
|
|
%{python3_sitelib}/%{pkgname}/image/__pycache__/__init__.*
|
|
|
|
%{python3_sitelib}/%{pkgname}/image/__pycache__/base.*
|
2012-06-08 14:24:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
%changelog
|
2015-11-10 17:00:20 +00:00
|
|
|
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1-2
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
|
|
|
|
|
2015-07-17 09:51:53 +00:00
|
|
|
* Fri Jul 10 2015 Miro Hrončok <mhroncok@redhat.com> - 5.1-1
|
|
|
|
- Update to 5.1
|
|
|
|
- Introduce python3 subpackages (#1237118)
|
|
|
|
- Moved LICENSE from %%doc to %%license
|
|
|
|
|
2015-06-18 20:33:08 +00:00
|
|
|
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0.1-3
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
|
|
|
|
2014-09-16 15:50:20 +00:00
|
|
|
* Tue Sep 16 2014 Nathaniel McCallum <npmccallum@redhat.com> - 5.0.1-2
|
|
|
|
- Make python-qrcode-core conflicts with python-qrcode < 5.0
|
|
|
|
|
2014-09-10 20:43:02 +00:00
|
|
|
* Wed Sep 10 2014 Nathaniel McCallum <npmccallum@redhat.com> - 5.0.1-1
|
|
|
|
- Update to 5.0.1
|
|
|
|
|
2014-09-10 18:00:29 +00:00
|
|
|
* Tue Sep 09 2014 Nathaniel McCallum <npmccallum@redhat.com> - 2.4.1-7
|
|
|
|
- Create -core subpackage for minimal dependencies
|
|
|
|
|
2014-06-07 22:37:22 +00:00
|
|
|
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.1-6
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
|
|
|
|
|
2013-08-04 09:24:43 +00:00
|
|
|
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.1-5
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
|
|
|
|
|
2013-02-14 20:14:13 +00:00
|
|
|
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.1-4
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
|
|
|
|
|
2012-07-21 08:09:03 +00:00
|
|
|
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.1-3
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
|
|
|
|
2012-06-08 14:24:33 +00:00
|
|
|
* Wed Jun 6 2012 Michel Salim <salimma@fedoraproject.org> - 2.4.1-2
|
|
|
|
- Clean up spec, removing unnecessary declarations
|
|
|
|
- Rename tool in %%{_bindir} to the less ambiguous qrcode
|
|
|
|
|
|
|
|
* Sat Jun 2 2012 Michel Salim <salimma@fedoraproject.org> - 2.4.1-1
|
|
|
|
- Initial package
|