Blob Blame History Raw
%global pypi_name django-tastypie
%global sum A flexible and capable API layer for Django
Name:           python-%{pypi_name}
Version:        0.13.3
Release:        4%{?dist}
Summary:        %{sum}

Group:          Development/Languages
License:        BSD
URL:            https://github.com/toastdriven/django-tastypie/

# Release version doesn't include tests
Source0:        https://github.com/%{pypi_name}/%{pypi_name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz

BuildArch:      noarch
# Let's keep Requires and BuildRequires sorted alphabetically
BuildRequires:  python2-devel python3-devel
BuildRequires:  python-setuptools
BuildRequires:  python-sphinx

%if 0%{?rhel}
Requires:       python-dateutil15
# also require setuptools to be able to use 'require' function from pkg_resources module
Requires:       python-setuptools
%else
Requires:       python-dateutil
%endif

%if 0%{?fedora} >= 18
Requires:       python-django >= 1.2.0
%else
Requires:       Django >= 1.2.0
%endif
Requires:       python-mimeparse >= 0.1.3

Provides:       %{pypi_name} = %{version}-%{release}
Obsoletes:      %{pypi_name} < 0.9.11-3 

%description
Tastypie is an webservice API framework for Django. It provides a convenient, 
yet powerful and highly customizable, abstraction for creating REST-style 
interfaces.

%package doc
Summary: Documentation for %{name}
Group: Documentation

Requires: %{name} = %{version}-%{release}

%description doc
This package contains documentation for %{name}.

%package -n python2-%{pypi_name}
Summary:        %{sum}
%{?python_provide:%python_provide python2-%{pypi_name}}

%description -n python2-%{pypi_name}
Tastypie is an webservice API framework for Django. It provides a convenient, 
yet powerful and highly customizable, abstraction for creating REST-style 
interfaces.


%package -n python3-%{pypi_name}
Summary:        %{sum}
%{?python_provide:%python_provide python3-%{pypi_name}}

%description -n python3-%{pypi_name}
Tastypie is an webservice API framework for Django. It provides a convenient, 
yet powerful and highly customizable, abstraction for creating REST-style 
interfaces.

%prep 
%setup -q -n %{pypi_name}-%{version}

# (re)generate the documentation
#pushd docs
sphinx-build docs docs/_build/html
#make html
#popd
rm -rf docs/_build/html/.??*

# if on RHEL, using dateutils15, we need to alter __init__.py to load them properly
%if 0%{?rhel}
cat << 'EOF' >> tastypie/__init__.py
from pkg_resources import require
require('python-dateutil')
EOF
%endif

%build
%{__python2} setup.py build
%{__python3} setup.py build


%install
%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT

%files -n python2-%{pypi_name}
%doc README.rst AUTHORS LICENSE
%dir %{python2_sitelib}/tastypie
%{python2_sitelib}/django_tastypie*
%{python2_sitelib}/tastypie/*

%files -n python3-%{pypi_name}
%doc README.rst AUTHORS LICENSE
%dir %{python3_sitelib}/tastypie
%{python3_sitelib}/django_tastypie*
%{python3_sitelib}/tastypie/*

%files doc
%doc docs/_build/html

%changelog
* Sun Jul 31 2016 Petr Viktorin <pviktori@redhat.com> - 0.13.3-4
- Fix Python sitelib directories

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.13.3-3
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Sat Feb 27 2016 Cédric OLIVIER <cedric.olivier@free.fr> - 0.13.3-2
- provide python3 subpackage (rhbz#1312325)

* Thu Feb 18 2016 Cédric OLIVIER <cedric.olivier@free.fr> - 0.13.3-1
- Update to 0.13.3 (rhbz#1308500)

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.13.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Tue Jan 26 2016 Cédric OLIVIER <cedric.olivier@free.fr> - 0.13.1-1
- Update to 0.13.1 (rhbz#1244039)

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Mon Oct 27 2014 Cédric OLIVIER <cedric.olivier@free.fr> - 0.12.1-1
- Update to 0.12.1 (rhbz#1142992)

* Thu Aug 07 2014 Matthias Runge <mrunge@redhat.com> - 0.11.1-4
- Fix python-dateutil requires

* Wed Aug 06 2014 Jon Ciesla <limburgher@gmail.com> - 0.11.1-3
- Fix python-dateutil Requires.

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Mon May 26 2014 Matthias Runge <mrunge@redhat.com> - 0.11.1-1
- update to 0.11.1 (rhbz#1100733)

* Mon May 19 2014 Matthias Runge <mrunge@redhat.com> - 0.11.0-1
- update to 0.11.0 (rhbz#959137)
- remove check section :-(, upstream does not provide tests in tarballs

* Tue Aug 27 2013 Bohuslav Kabrda <bkabrda@redhat.com> - 0.9.14-4
- Fix unversioned docdir issue (rhbz#1001252).
- Fix bogus changelog entry.

* Sun Aug 11 2013 Cédric OLIVIER <cedric.olivier@free.fr> 0.9.14-3
- Change Docdir to Unversioned Docdir

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.14-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Tue Mar 26 2013 Miro Hrončok <mhroncok@redhat.com> - 0.9.14-1
- New version
- Using new GitHub rule to get archive with tests
- Run tests manually
- Added BR python-defusedxml
- Dropped dance around release and development versioning
- Added patch for Django 1.5

* Mon Mar 25 2013 Cédric OLIVIER <cedric.olivier@free.fr> 0.9.12-1
- Updated to upstream 0.9.12

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.12-0.2.alpha
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Tue Aug 14 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 0.9.12-0.1.alpha
- Updated to upstream version 0.9.12-alpha.
- Adapted the specfile to prerelease versioning.
- Add some BuildRequires, so that more tests are run (these
are soft requirements, so they aren't in Requires)
- Fixed URL to point to upstream, not PyPI.
- Made the spec compatible with EPEL6.

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.11-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sun Mar 18 2012 Cédric OLIVIER <cedric.olivier@free.fr> 0.9.11-4
- Bugfix in obsoletes

* Sun Mar 18 2012 Cédric OLIVIER <cedric.olivier@free.fr> 0.9.11-3
- Removing bundled .egg-info during prep

* Sat Mar 17 2012 Cédric OLIVIER <cedric.olivier@free.fr> 0.9.11-2
- Adding missing buildrequires
- Adding info about renaming django-tastypie
- Adding check section
- Adding documentation subpackage

* Fri Mar 02 2012 Cédric OLIVIER <cedric.olivier@free.fr> 0.9.11-1
- Initial version of the package