[python-django15/el6] handle language files on rhel6 as well

Matthias Runge mrunge at fedoraproject.org
Wed Apr 30 21:02:57 UTC 2014


commit a4dedb8e4885335e78da321a333a17fbf0e87b1e
Author: Matthias Runge <mrunge at redhat.com>
Date:   Wed Apr 30 23:02:55 2014 +0200

    handle language files on rhel6 as well

 python-django15.spec |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/python-django15.spec b/python-django15.spec
index 0032510..bc7d972 100644
--- a/python-django15.spec
+++ b/python-django15.spec
@@ -159,11 +159,23 @@ find %{buildroot}%{python2_sitelib} \
 -o -name manage.py -prune \
 -o -name "*.py" -exec chmod ugo-x {} \;
 
+%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
 grep py3.3 django.lang > python3-django.lang


More information about the scm-commits mailing list