|
|
dfc41d0 |
%global pypi_name django-tastypie
|
|
|
dfc41d0 |
Name: python-%{pypi_name}
|
|
|
c31293e |
Version: 0.9.14
|
|
|
c31293e |
Release: 1%{?dist}
|
|
|
9d10047 |
Summary: A flexible and capable API layer for Django
|
|
|
9d10047 |
|
|
|
9d10047 |
Group: Development/Languages
|
|
|
9d10047 |
License: BSD
|
|
|
dfc41d0 |
URL: https://github.com/toastdriven/django-tastypie/
|
|
|
c3f3a69 |
|
|
|
c31293e |
# Release version doesn't include tests
|
|
|
c31293e |
Source0: http://pypi.python.org/packages/source/d/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
|
|
|
c31293e |
# To get version with tests (last commit in tag v0.9.14):
|
|
|
c31293e |
%global commit 19218ef73dee4d85b6ec87bf0d2b6293da79758e
|
|
|
c31293e |
%global shortcommit %(c=%{commit}; echo ${c:0:7})
|
|
|
c31293e |
Source1: https://github.com/toastdriven/%{pypi_name}/archive/%{commit}/%{pypi_name}-%{version}-github.tar.gz
|
|
|
c31293e |
|
|
|
e8fd1e7 |
# Patch so this works with Django 1.5
|
|
|
e8fd1e7 |
Patch0: %{name}-django-1.5.patch
|
|
|
e8fd1e7 |
|
|
|
c31293e |
%global docdir %{_docdir}/%{name}-%{version}
|
|
|
9d10047 |
|
|
|
9d10047 |
BuildArch: noarch
|
|
|
dfc41d0 |
# Let's keep Requires and BuildRequires sorted alphabetically
|
|
|
9d10047 |
BuildRequires: python2-devel
|
|
|
dfc41d0 |
%if 0%{?rhel}
|
|
|
dfc41d0 |
BuildRequires: python-dateutil15
|
|
|
dfc41d0 |
%else
|
|
|
9d10047 |
BuildRequires: python-dateutil >= 1.5
|
|
|
9d10047 |
BuildRequires: python-dateutil < 2.0
|
|
|
dfc41d0 |
%endif
|
|
|
dfc41d0 |
%if 0%{?fedora} >= 18
|
|
|
dfc41d0 |
BuildRequires: python-django >= 1.2.0
|
|
|
dfc41d0 |
%else
|
|
|
9d10047 |
BuildRequires: Django >= 1.2.0
|
|
|
dfc41d0 |
%endif
|
|
|
c31293e |
BuildRequires: python-defusedxml
|
|
|
dfc41d0 |
BuildRequires: python-lxml
|
|
|
dfc41d0 |
BuildRequires: python-mimeparse >= 0.1.3
|
|
|
c31293e |
BuildRequires: python-mock
|
|
|
dfc41d0 |
BuildRequires: python-setuptools
|
|
|
dfc41d0 |
BuildRequires: python-sphinx
|
|
|
dfc41d0 |
BuildRequires: PyYAML
|
|
|
dfc41d0 |
|
|
|
dfc41d0 |
%if 0%{?rhel}
|
|
|
dfc41d0 |
Requires: python-dateutil15
|
|
|
dfc41d0 |
# also require setuptools to be able to use 'require' function from pkg_resources module
|
|
|
dfc41d0 |
Requires: python-setuptools
|
|
|
dfc41d0 |
%else
|
|
|
9d10047 |
Requires: python-dateutil >= 1.5
|
|
|
9d10047 |
Requires: python-dateutil < 2.0
|
|
|
dfc41d0 |
%endif
|
|
|
dfc41d0 |
%if 0%{?fedora} >= 18
|
|
|
dfc41d0 |
Requires: python-django >= 1.2.0
|
|
|
dfc41d0 |
%else
|
|
|
9d10047 |
Requires: Django >= 1.2.0
|
|
|
dfc41d0 |
%endif
|
|
|
dfc41d0 |
Requires: python-mimeparse >= 0.1.3
|
|
|
9d10047 |
|
|
|
dfc41d0 |
Provides: %{pypi_name} = %{version}-%{release}
|
|
|
dfc41d0 |
Obsoletes: %{pypi_name} < 0.9.11-3
|
|
|
9d10047 |
|
|
|
9d10047 |
%description
|
|
|
9d10047 |
Tastypie is an webservice API framework for Django. It provides a convenient,
|
|
|
9d10047 |
yet powerful and highly customizable, abstraction for creating REST-style
|
|
|
9d10047 |
interfaces.
|
|
|
9d10047 |
|
|
|
9d10047 |
%package doc
|
|
|
9d10047 |
Summary: Documentation for %{name}
|
|
|
9d10047 |
Group: Documentation
|
|
|
9d10047 |
|
|
|
9d10047 |
Requires: %{name} = %{version}-%{release}
|
|
|
9d10047 |
|
|
|
9d10047 |
%description doc
|
|
|
9d10047 |
This package contains documentation for %{name}.
|
|
|
9d10047 |
|
|
|
9d10047 |
|
|
|
9d10047 |
%prep
|
|
|
c31293e |
%setup -qb1 -n %{pypi_name}-%{commit}
|
|
|
c31293e |
%setup -q -n %{pypi_name}-%{version}
|
|
|
e8fd1e7 |
%patch0 -p1
|
|
|
c31293e |
cp -r ../%{pypi_name}-%{commit}/tests .
|
|
|
dfc41d0 |
# (re)generate the documentation
|
|
|
dfc41d0 |
sphinx-build docs docs/_build/html
|
|
|
dfc41d0 |
|
|
|
dfc41d0 |
# if on RHEL, using dateutils15, we need to alter __init__.py to load them properly
|
|
|
dfc41d0 |
%if 0%{?rhel}
|
|
|
dfc41d0 |
cat << 'EOF' >> tastypie/__init__.py
|
|
|
dfc41d0 |
from pkg_resources import require
|
|
|
dfc41d0 |
require('python-dateutil')
|
|
|
dfc41d0 |
EOF
|
|
|
dfc41d0 |
%endif
|
|
|
9d10047 |
|
|
|
9d10047 |
%build
|
|
|
9d10047 |
%{__python} setup.py build
|
|
|
9d10047 |
|
|
|
9d10047 |
%install
|
|
|
9d10047 |
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
|
|
|
9d10047 |
mkdir -p $RPM_BUILD_ROOT%{docdir}
|
|
|
9d10047 |
cp -p LICENSE README.rst AUTHORS -t $RPM_BUILD_ROOT%{docdir}
|
|
|
dfc41d0 |
cp -pr docs/_build/html -t $RPM_BUILD_ROOT%{docdir}
|
|
|
9d10047 |
|
|
|
9d10047 |
%check
|
|
|
9d10047 |
# note: the oauth tests will work once the proper module gets into rawhide
|
|
|
9d10047 |
# from the authors documentation it is now not very clear if it is
|
|
|
9d10047 |
# django-oauth or django-oauth-provider or django-oauth-plus
|
|
|
9d10047 |
# anyway, it is not a hard requirement
|
|
|
c31293e |
# also, the gis tests need a running postgresql server, so they are skipped
|
|
|
c31293e |
# run_all_tests.sh is no longer used, following commands are copied from tox.ini
|
|
|
9d10047 |
pushd tests
|
|
|
dfc41d0 |
# handle building on hosts with bad DNS
|
|
|
dfc41d0 |
find -type f -name '*.py' -print | xargs sed -i 's|localhost|127.0.0.1|'
|
|
|
6f1c00c |
PYTHONPATH=$PWD:$PWD/..${PYTHONPATH:+:$PYTHONPATH}
|
|
|
6f1c00c |
export PYTHONPATH
|
|
|
c31293e |
#django-admin test core --settings=settings_core
|
|
|
c31293e |
django-admin test basic --settings=settings_basic
|
|
|
c31293e |
django-admin test complex --settings=settings_complex
|
|
|
c31293e |
django-admin test alphanumeric --settings=settings_alphanumeric
|
|
|
c31293e |
django-admin test slashless --settings=settings_slashless
|
|
|
c31293e |
django-admin test namespaced --settings=settings_namespaced
|
|
|
c31293e |
django-admin test related_resource --settings=settings_related
|
|
|
c31293e |
django-admin test validation --settings=settings_validation
|
|
|
c31293e |
django-admin test content_gfk --settings=settings_content_gfk
|
|
|
9d10047 |
popd
|
|
|
9d10047 |
|
|
|
9d10047 |
%files
|
|
|
9d10047 |
%doc README.rst AUTHORS LICENSE
|
|
|
9d10047 |
%dir %{python_sitelib}/tastypie
|
|
|
9d10047 |
%{python_sitelib}/django_tastypie*
|
|
|
9d10047 |
%{python_sitelib}/tastypie/*
|
|
|
9d10047 |
|
|
|
9d10047 |
%files doc
|
|
|
9d10047 |
%doc %{docdir}
|
|
|
dfc41d0 |
%exclude %{docdir}/html/.*
|
|
|
9d10047 |
|
|
|
9d10047 |
%changelog
|
|
|
c3f3a69 |
* Tue Mar 26 2013 Miro Hrončok <mhroncok@redhat.com> - 0.9.14-1
|
|
|
c31293e |
- New version
|
|
|
c31293e |
- Using new GitHub rule to get archive with tests
|
|
|
c31293e |
- Run tests manually
|
|
|
c31293e |
- Added BR python-defusedxml
|
|
|
c31293e |
- Dropped dance around release and development versioning
|
|
|
e8fd1e7 |
- Added patch for Django 1.5
|
|
|
c31293e |
|
|
|
29a920c |
* Mon Mar 25 2013 Cédric OLIVIER <cedric.olivier@free.fr> 0.9.12-1
|
|
|
29a920c |
- Updated to upstream 0.9.12
|
|
|
29a920c |
|
|
|
4d466b0 |
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.12-0.2.alpha
|
|
|
4d466b0 |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
|
|
|
4d466b0 |
|
|
|
dfc41d0 |
* Tue Aug 14 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 0.9.12-0.1.alpha
|
|
|
dfc41d0 |
- Updated to upstream version 0.9.12-alpha.
|
|
|
dfc41d0 |
- Adapted the specfile to prerelease versioning.
|
|
|
dfc41d0 |
- Add some BuildRequires, so that more tests are run (these
|
|
|
dfc41d0 |
are soft requirements, so they aren't in Requires)
|
|
|
dfc41d0 |
- Fixed URL to point to upstream, not PyPI.
|
|
|
dfc41d0 |
- Made the spec compatible with EPEL6.
|
|
|
dfc41d0 |
|
|
|
440f44c |
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.11-5
|
|
|
440f44c |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
|
|
440f44c |
|
|
|
9d10047 |
* Sun Mar 18 2012 Cédric OLIVIER <cedric.olivier@free.fr> 0.9.11-4
|
|
|
9d10047 |
- Bugfix in obsoletes
|
|
|
9d10047 |
|
|
|
9d10047 |
* Sun Mar 18 2012 Cédric OLIVIER <cedric.olivier@free.fr> 0.9.11-3
|
|
|
9d10047 |
- Removing bundled .egg-info during prep
|
|
|
9d10047 |
|
|
|
9d10047 |
* Sat Mar 17 2012 Cédric OLIVIER <cedric.olivier@free.fr> 0.9.11-2
|
|
|
9d10047 |
- Adding missing buildrequires
|
|
|
9d10047 |
- Adding info about renaming django-tastypie
|
|
|
9d10047 |
- Adding check section
|
|
|
9d10047 |
- Adding documentation subpackage
|
|
|
9d10047 |
|
|
|
9d10047 |
* Wed Mar 02 2012 Cédric OLIVIER <cedric.olivier@free.fr> 0.9.11-1
|
|
|
9d10047 |
- Initial version of the package
|