[python-django-openstack-auth/el6: 2/2] fix build by handling language files by hand

Matthias Runge mrunge at fedoraproject.org
Wed Oct 17 06:41:37 UTC 2012


commit ddf4e2a6f53e7a5b2ad2e8affe6e3f8f69486d9d
Author: Matthias Runge <mrunge at redhat.com>
Date:   Wed Oct 17 08:41:05 2012 +0200

    fix build by handling language files by hand

 python-django-openstack-auth.spec |   34 +++++++++++++++++++++++++++++++---
 1 files changed, 31 insertions(+), 3 deletions(-)
---
diff --git a/python-django-openstack-auth.spec b/python-django-openstack-auth.spec
index 99ad82a..ce72ca7 100644
--- a/python-django-openstack-auth.spec
+++ b/python-django-openstack-auth.spec
@@ -2,7 +2,7 @@
 
 Name:           python-django-openstack-auth
 Version:        1.0.2
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Django authentication backend for OpenStack Keystone 
 
 License:        BSD
@@ -11,13 +11,22 @@ Source0:        http://pypi.python.org/packages/source/d/%{pypi_name}/%{pypi_nam
 BuildArch:      noarch
  
 BuildRequires:  python2-devel
+%if 0%{?rhel}==6
+BuildRequires:  python-sphinx10
+%else
 BuildRequires:  python-sphinx
+%endif
 BuildRequires:  python-mox
 BuildRequires:  python-keystoneclient
 
 %if 0%{?rhel}<7 || 0%{?fedora} < 18
+%if 0%{?rhel}==6
+Requires:   Django14
+BuildRequires: Django14
+%else
 Requires:   Django
 BuildRequires:   Django
+%endif
 %else
 Requires:   python-django
 BuildRequires:   python-django
@@ -46,14 +55,29 @@ find . -name "django.po" -exec rm -f '{}' \;
 %{__python} setup.py build
 
 # generate html docs 
+%if 0%{?rhel}==6
+PYTHONPATH=.:$PYTHONPATH sphinx-1.0-build docs html
+%else
 PYTHONPATH=.:$PYTHONPATH sphinx-build docs html
-
+%endif
 
 %install
 %{__python} setup.py install --skip-build --root %{buildroot}
 
+%if 0%{?rhel}==6
+# Handling locale files
+# This is adapted from the %%find_lang macro, which cannot be directly
+# used since Django locale files are not located in %%{_datadir}
+#
+# The rest of the packaging guideline still apply -- do not list
+# locale files by hand!
+(cd $RPM_BUILD_ROOT && find . -name 'django*.mo') | %{__sed} -e 's|^.||' |
+%{__sed} -e \
+   's:\(.*/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:' \
+      >> django.lang
+%else
 %find_lang django
-
+%endif
 # don't include tests in the RPM
 rm -rf %{buildroot}/%{python_sitelib}/openstack_auth/tests
 
@@ -67,6 +91,10 @@ rm -rf %{buildroot}/%{python_sitelib}/openstack_auth/tests
 %{python_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
 
 %changelog
+* Tue Oct 16 2012 Matthias Runge <mrunge at redhat.com> - 1.0.2-3
+- fix build on EPEL6, require Django14 package on EPEL6
+- handle languages by hand on EL6
+
 * Mon Sep 24 2012 Matthias Runge <mrunge at redhat.com> - 1.0.2-2
 - also support f17, el6
 


More information about the scm-commits mailing list