Browse Source

merged from Django

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@1742 ec354946-7b23-47d6-9f5a-488ba84defc7
owa 13 years ago
parent
commit
d0b57a106e
1 changed files with 84 additions and 20 deletions
  1. 84 20
      p/python-django/python-django-vl.spec

+ 84 - 20
p/python-django/python-django-vl.spec

@@ -2,18 +2,22 @@ Summary: A high-level Python Web framework
 Summary(ja): Python の高度なウェブフレームワーク
 Name: python-django
 Version: 1.2.1
-Release: 1%{?_dist_release}
+Release: 2%{?_dist_release}
 Group: Development/Languages
 BuildArch: noarch
 License: BSD
 URL: http://www.djangoproject.com/
 Source0: Django-%{version}.tar.gz
-
+Source1: simplejson-init.py
+Patch0: Django-hash-compat-13310.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
+BuildRequires: python-devel
+BuildRequires: python-sphinx
+Requires: python-simplejson
 
 Vendor: Project Vine
 Distribution: Vine Linux
-Packager: <owa>
+Packager: owa, munepi
 
 %description
 Django is a high-level Python Web framework that encourages rapid
@@ -36,48 +40,108 @@ Requires: %{name} = %{version}-%{release}
 This package contains the documentation for the Django high-level
 Python Web framework.
 
+
 %prep
 %setup -q -n Django-%{version}
+%patch0 -p3
+
+# remove bundled simplejson
+cd django/utils/simplejson/
+%__rm -rf *
+# and put the replacement stub in place
+%__cp -p %{SOURCE1} __init__.py
+
 
 %build
 %{__python} setup.py build
 
+
 %install
-rm -rf $RPM_BUILD_ROOT
+%__rm -rf $RPM_BUILD_ROOT
 %{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
 
-## Documentation
-#mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}
-#chmod +x examples/manage.py
-#mv examples $RPM_BUILD_ROOT%{_datadir}/%{name}/
-
 # Permission fixes
 pushd $RPM_BUILD_ROOT%{python_sitelib}/django
-	chmod +x conf/project_template/manage.py
-	chmod +x bin/compile-messages.py
-	chmod +x bin/daily_cleanup.py
-	chmod +x bin/django-admin.py
-	chmod +x bin/make-messages.py
-	chmod +x bin/unique-messages.py
-	chmod +x bin/profiling/gather_profile_stats.py
+	chmod +x conf/project_template/manage.py*
+	chmod +x contrib/admin/media/js/compress.py*
+	chmod +x bin/profiling/gather_profile_stats.py*
+	chmod +x bin/compile-messages.py*
+	chmod +x bin/daily_cleanup.py*
+	chmod +x bin/django-admin.py*
+	chmod +x bin/make-messages.py*
+	chmod +x bin/unique-messages.py*
 popd
 
+# Fix items in %{_bindir}
+%__mv $RPM_BUILD_ROOT%{_bindir}/django-admin.py $RPM_BUILD_ROOT%{_bindir}/django-admin
+
+# install man pages
+%__mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1/
+%__cp -p docs/man/* $RPM_BUILD_ROOT%{_mandir}/man1/
+
+# 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!
+%__rm -f %{name}.lang
+(cd $RPM_BUILD_ROOT && find . -name 'django*.mo') | %{__sed} -e 's|^.||' | %{__sed} -e \
+  's:\(.*/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:' \
+  >> %{name}.lang
+find $RPM_BUILD_ROOT -name "*.po" | xargs %__rm -f
+
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%files
+
+%files -f %{name}.lang
 %defattr(-,root,root,-)
 %doc AUTHORS LICENSE README
-%{_bindir}/django-admin.py
-%{python_sitelib}/django
+%{_bindir}/django-admin
+%{_mandir}/man1/*
+%{python_sitelib}/django/bin/*.py*
+%{python_sitelib}/django/bin/profiling/
+# Include everything but the locale data ...
+%{python_sitelib}/django/db/
+%{python_sitelib}/django/*.py*
+%{python_sitelib}/django/shortcuts/
+%{python_sitelib}/django/utils/
+%{python_sitelib}/django/dispatch/
+%{python_sitelib}/django/template/
+%{python_sitelib}/django/views/
+%{python_sitelib}/django/contrib/
+%{python_sitelib}/django/forms/
+%{python_sitelib}/django/templatetags/
+%{python_sitelib}/django/core/
+%{python_sitelib}/django/http/
+%{python_sitelib}/django/middleware/
+%{python_sitelib}/django/test/
+%{python_sitelib}/django/conf/*.py*
+%{python_sitelib}/django/conf/project_template/*.py*
+%{python_sitelib}/django/conf/app_template/
+%{python_sitelib}/django/conf/urls/
+%{python_sitelib}/django/conf/locale/*/*.py*
+%{python_sitelib}/django/conf/locale/*.py*
 %{python_sitelib}/Django-%{version}-py%{pyver}.egg-info
 
+
 %files docs
 %defattr(-,root,root,-)
 %doc docs/*
-#%{_datadir}/%{name}
+
 
 %changelog
+* Thu Sep 02 2010 Shu KONNO <owa@bg.wakwak.com> 1.2.1-2
+- added simplejson-init.py: removed bundled simplejson, and put the __init__.py
+- added Django-hash-compat-13310.patch: http://code.djangoproject.com/changeset/13310 per BZ#601212
+- added BR: python-devel python-sphinx
+- added RQ: python-simplejson
+- removed po files (per BZ#529188)
+- install man1
+  (merged from 'Mon Aug 23 2010 Munehiro Yamamoto <munepi@vinelinux.org> - Django-1.2.1-1')
+
 * Sun Aug 01 2010 Shu KONNO <owa@bg.wakwak.com> 1.2.1-1
 - updated Django to 1.2.1