[python-django-tastypie] Updated to upstream version 0.9.12-alpha.

Bohuslav Kabrda bkabrda at fedoraproject.org
Tue Aug 14 13:21:38 UTC 2012


commit dfc41d0f8523dc255dd372b505dab73e1c8e5acc
Author: Bohuslav Kabrda <bkabrda at redhat.com>
Date:   Tue Aug 14 15:21:06 2012 +0200

    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.

 .gitignore                  |    1 +
 python-django-tastypie.spec |  100 +++++++++++++++++++++++++++++++++----------
 sources                     |    3 +-
 3 files changed, 79 insertions(+), 25 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 325f913..89cdfd3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 /django-tastypie-0.9.11.tar.gz
 /python-django-tastypie-tests.tgz
+/django-tastypie-0.9.12-alpha.tar.gz
diff --git a/python-django-tastypie.spec b/python-django-tastypie.spec
index 0e8d73d..ec44be0 100644
--- a/python-django-tastypie.spec
+++ b/python-django-tastypie.spec
@@ -1,36 +1,71 @@
-%global pkgname django-tastypie
-%global docdir %{_docdir}/%{name}-%{version}
-
-Name:           python-django-tastypie
-Version:        0.9.11
-Release:        5%{?dist}
+%global pypi_name django-tastypie
+%global docdir %{_docdir}/%{name}-%{fullver}
+
+%global majorver 0.9.12
+%global release 1
+# comment this out to get back to normal versioning
+%global preminorver alpha
+%global fullver %{majorver}%{?preminorver:-%{preminorver}}
+
+Name:           python-%{pypi_name}
+Version:        %{majorver}
+Release:        %{?preminorver:0.}%{release}%{?preminorver:.%{preminorver}}%{?dist}
 Summary:        A flexible and capable API layer for Django
 
 Group:          Development/Languages
 License:        BSD
-URL:            http://pypi.python.org/pypi/django-tastypie
-Source0:        http://pypi.python.org/packages/source/d/django-tastypie/django-tastypie-%{version}.tar.gz
+URL:            https://github.com/toastdriven/django-tastypie/
+# Only for snapshots:
+# git clone https://github.com/toastdriven/django-tastypie.git
+# mv django-tastypie django-tastypie-0.9.12-alpha
+# tar czf django-tastypie-0.9.12-alpha.tar.gz django-tastypie-0.9.12-alpha
+Source0:        %{pypi_name}-%{fullver}.tar.gz
+
+# Only for non-snapshot versions:
+#Source0:        http://pypi.python.org/packages/source/d/%%{pypi_name}/%%{pypi_name}-%%{version}.tar.gz
 # to get tests:
 # git clone https://github.com/toastdriven/django-tastypie.git && cd django-tastypie
-# git checkout v0.9.11
-# tar -czf python-django-tastypie-tests.tgz tests/
-Source1:        %{name}-tests.tgz
-
+# git checkout v0.9.12
+# tar -czf django-tastypie-0.9.12-tests.tgz tests/
+#Source1:        %%{pypi_name}-tests.tgz
 
 BuildArch:      noarch
+# Let's keep Requires and BuildRequires sorted alphabetically
 BuildRequires:  python2-devel
-BuildRequires:  python-setuptools
-BuildRequires:  python-mimeparse >= 0.1.3
+%if 0%{?rhel}
+BuildRequires:  python-dateutil15
+%else
 BuildRequires:  python-dateutil >= 1.5
 BuildRequires:  python-dateutil < 2.0
+%endif
+%if 0%{?fedora} >= 18
+BuildRequires:  python-django >= 1.2.0
+%else
 BuildRequires:  Django >= 1.2.0
-Requires:       python-mimeparse >= 0.1.3
+%endif
+BuildRequires:  python-lxml
+BuildRequires:  python-mimeparse >= 0.1.3
+BuildRequires:  python-setuptools
+BuildRequires:  python-sphinx
+BuildRequires:  PyYAML
+
+%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 >= 1.5
 Requires:       python-dateutil < 2.0
+%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:       %{pkgname} = %{version}-%{release}
-Obsoletes:      %{pkgname} < 0.9.11-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, 
@@ -48,27 +83,39 @@ This package contains documentation for %{name}.
 
 
 %prep 
-%setup -q -n django-tastypie-%{version}
+%setup -q -n django-tastypie-%{fullver}
 rm -rf *egg-info
-tar xzf %{SOURCE1}
+%{!?preminorver:tar xzf %{SOURCE1}}
 sed -i 's|django-admin.py|django-admin|' tests/run_all_tests.sh
+# (re)generate the documentation
+sphinx-build docs 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
 %{__python} setup.py build
 
-
 %install
 %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
 mkdir -p $RPM_BUILD_ROOT%{docdir}
-cp -pr docs/_build/html $RPM_BUILD_ROOT%{docdir}
 cp -p LICENSE README.rst AUTHORS -t $RPM_BUILD_ROOT%{docdir}
+cp -pr docs/_build/html -t $RPM_BUILD_ROOT%{docdir}
 
 %check
 # note: the oauth tests will work once the proper module gets into rawhide
 # from the authors documentation it is now not very clear if it is
 # django-oauth or django-oauth-provider or django-oauth-plus
 # anyway, it is not a hard requirement
+# also, the gis tests need a running postresql server, so they are skipped
 pushd tests
+# handle building on hosts with bad DNS
+find -type f -name '*.py' -print | xargs sed -i 's|localhost|127.0.0.1|'
 ./run_all_tests.sh
 popd
  
@@ -80,10 +127,17 @@ popd
 
 %files doc
 %doc %{docdir}
-%exclude %{docdir}/html/.buildinfo
-
+%exclude %{docdir}/html/.*
 
 %changelog
+* Tue Aug 14 2012 Bohuslav Kabrda <bkabrda at 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 at lists.fedoraproject.org> - 0.9.11-5
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
 
diff --git a/sources b/sources
index 36f074d..9fd5d4e 100644
--- a/sources
+++ b/sources
@@ -1,2 +1 @@
-711b29265917405c226f4594782e7e9b  django-tastypie-0.9.11.tar.gz
-e7dd2613d06db675375b693062cb3d5c  python-django-tastypie-tests.tgz
+0142a431e5a953abc207ca2a699ff60c  django-tastypie-0.9.12-alpha.tar.gz


More information about the scm-commits mailing list