[python-django] add find_lang workaround for rhel6

Matthias Runge mrunge at fedoraproject.org
Wed Mar 26 08:33:36 UTC 2014


commit 8fb5b8b9f89338d6c198217acefa42069321bcc6
Author: Matthias Runge <mrunge at redhat.com>
Date:   Wed Mar 5 11:08:22 2014 +0100

    add find_lang workaround for rhel6

 python-django.spec |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/python-django.spec b/python-django.spec
index 836f0e3..2962335 100644
--- a/python-django.spec
+++ b/python-django.spec
@@ -138,11 +138,23 @@ popd
 
 %{__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
 %find_lang djangojs
 # append djangojs.lang to django.lang
 cat djangojs.lang >> django.lang
+%endif
 
 %if 0%{?with_python3}
 # When creating Python3 package, separate lang to Python 2 and Python 3 files


More information about the scm-commits mailing list