5ae989
%global pkgname qrcode
5ae989
5ae989
Name:           python-%{pkgname}
5ae989
Version:        5.0.1
5ae989
Release:        1%{?dist}
5ae989
Summary:        Python QR Code image generator
5ae989
5ae989
License:        BSD
5ae989
URL:            https://github.com/lincolnloop/python-qrcode
5ae989
Source0:        http://pypi.python.org/packages/source/q/qrcode/qrcode-%{version}.tar.gz
5ae989
5ae989
BuildArch:      noarch
5ae989
BuildRequires:  python-devel
5ae989
BuildRequires:  python-setuptools
5ae989
BuildRequires:  python-imaging
5ae989
BuildRequires:  python-six
5ae989
Requires:       python-imaging
5ae989
Requires:       %{name}-core = %{version}-%{release}
5ae989
5ae989
%description
5ae989
This module uses the Python Imaging Library (PIL) to allow for the
5ae989
generation of QR Codes.
5ae989
5ae989
5ae989
%package core
5ae989
Requires:       python-six
5ae989
Summary:        Python QR Code image generator (core library)
5ae989
5ae989
%description core
5ae989
Core Python module for QR code generation. Does not contain image rendering.
5ae989
5ae989
5ae989
%prep
5ae989
%setup -q -n %{pkgname}-%{version}
5ae989
5ae989
# The pure plugin requires pymaging which is not packaged in Fedora.
5ae989
rm qrcode/image/pure.py*
5ae989
5ae989
5ae989
%build
5ae989
%{__python} setup.py build
5ae989
5ae989
5ae989
%install
5ae989
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
5ae989
5ae989
5ae989
%check
5ae989
# in lieue of a real test suite
5ae989
for m in $(find qrcode -name '*.py' \
5ae989
    | grep -v __init__ \
5ae989
    | sort \
5ae989
    | sed -e 's|/|.|g' \
5ae989
    | sed -e 's|.py$||g');
5ae989
do
5ae989
    %{__python} -c "import $m"
5ae989
done
5ae989
5ae989
5ae989
%files
5ae989
%{_bindir}/qr
5ae989
%{_mandir}/man1/qr.1*
5ae989
%{python_sitelib}/%{pkgname}/image/svg.py*
5ae989
%{python_sitelib}/%{pkgname}/image/pil.py*
5ae989
5ae989
5ae989
%files core
5ae989
%doc LICENSE README.rst CHANGES.rst
5ae989
%dir %{python_sitelib}/%{pkgname}/
5ae989
%dir %{python_sitelib}/%{pkgname}/image
5ae989
%{python_sitelib}/%{pkgname}*.egg-info
5ae989
%{python_sitelib}/%{pkgname}/*.py*
5ae989
%{python_sitelib}/%{pkgname}/image/__init__.py*
5ae989
%{python_sitelib}/%{pkgname}/image/base.py*
5ae989
5ae989
5ae989
%changelog
5ae989
* Wed Sep 10 2014 Nathaniel McCallum <npmccallum@redhat.com> - 5.0.1-1
5ae989
- Update to 5.0.1
5ae989
5ae989
* Tue Sep 09 2014 Nathaniel McCallum <npmccallum@redhat.com> - 2.4.1-7
5ae989
- Create -core subpackage for minimal dependencies
5ae989
5ae989
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.1-6
5ae989
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
5ae989
5ae989
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.1-5
5ae989
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
5ae989
5ae989
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.1-4
5ae989
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
5ae989
5ae989
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.1-3
5ae989
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
5ae989
5ae989
* Wed Jun  6 2012 Michel Salim <salimma@fedoraproject.org> - 2.4.1-2
5ae989
- Clean up spec, removing unnecessary declarations
5ae989
- Rename tool in %%{_bindir} to the less ambiguous qrcode
5ae989
5ae989
* Sat Jun  2 2012 Michel Salim <salimma@fedoraproject.org> - 2.4.1-1
5ae989
- Initial package