Blob Blame History Raw
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?pyver: %define pyver %(%{__python} -c "import sys ; print sys.version[:3]")}

Name:           Django
Version:        1.1
Release:        4%{?dist}
Summary:        A high-level Python Web framework

Group:          Development/Languages
License:        BSD
URL:            http://www.djangoproject.com/
Source0:        http://media.djangoproject.com/releases/%{version}/Django-%{version}.tar.gz
# stub simplejson module that imports the system version
Source1:        simplejson-init.py
Patch0:         Django-ignore-pyo-bz-495046.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildArch:      noarch
# Note: No longer required in development version > 0.95
# BuildRequires:  python-setuptools
BuildRequires:  python-devel
%if 0%{?rhel} > 4 || 0%{?fedora} > 0
BuildRequires: python-sphinx
%endif

Requires:       python-simplejson

%description
Django is a high-level Python Web framework that encourages rapid
development and a clean, pragmatic design. It focuses on automating as
much as possible and adhering to the DRY (Don't Repeat Yourself)
principle.

%if 0%{?rhel} > 4 || 0%{?fedora} > 0
%package doc
Summary:        Documentation for Django
Group:          Documentation
Requires:       %{name} = %{version}-%{release}
Provides:       %{name}-docs = %{version}-%{release}
Obsoletes:      %{name}-docs < %{version}-%{release}

%description doc
This package contains the documentation for the Django high-level
Python Web framework.
%endif

%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
# 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
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
# Language files; not under /usr/share, need to be handled manually
(cd $RPM_BUILD_ROOT && find . -name 'django*.mo') | %{__sed} -e 's|^.||' | %{__sed} -e \
  's:\(.*/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:' \
  >> %{name}.lang

%if 0%{?rhel} > 4 || 0%{?fedora} > 0
    # build documentation
    (cd docs && make html)
%endif

# install man pages
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1/
cp -p docs/man/* $RPM_BUILD_ROOT%{_mandir}/man1/

# Fix items in %{_bindir}
mv $RPM_BUILD_ROOT%{_bindir}/django-admin.py $RPM_BUILD_ROOT%{_bindir}/django-admin

%clean
rm -rf $RPM_BUILD_ROOT


%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS LICENSE README
%{_bindir}/django-admin
%{_mandir}/man1/*
%attr(0755,root,root) %{python_sitelib}/django/conf/project_template/manage.py
%attr(0755,root,root) %{python_sitelib}/django/bin/profiling/gather_profile_stats.py
%attr(0755,root,root) %{python_sitelib}/django/bin/*-messages.py
%attr(0755,root,root) %{python_sitelib}/django/bin/daily_cleanup.py
%attr(0755,root,root) %{python_sitelib}/django/bin/django-admin.py
%{python_sitelib}/django

# Leaving these since people may want to rebuild on lower dists
%if 0%{?fedora} >= 9
%{python_sitelib}/*.egg-info
%endif

%if 0%{?fedora} > 0 && 0%{?fedora} <= 9
%ghost %{_bindir}/django-admin.pyc
%ghost %{_bindir}/django-admin.pyo
%endif
# -----------------
 

%if 0%{?rhel} > 4 || 0%{?fedora} > 0
%files doc
%defattr(-,root,root,-)
%doc docs/_build/html/*
%endif

%changelog
* Wed Aug 26 2009 Steve 'Ashcrow' Milner <stevem@gnulinux.net> - 1.1-4
- EL-4 shouldn't get the sphinx docs.

* Wed Aug 26 2009 Steve 'Ashcrow' Milner <stevem@gnulinux.net> - 1.1-3
- ghosting admin py* is now FC9 and under.

* Thu Aug  6 2009 Steve 'Ashcrow' Milner <stevem@gnulinux.net> - 1.1-2
- Applied Daniel Mach's patch from bz#516016.

* Sat Aug  1 2009 Steve 'Ashcrow' Milner <stevem@gnulinux.net> - 1.1-1
- Update for Django 1.1 release.
- Moved /usr/bin/django-admin.py to /usr/bin/django-admin
- sed macro is now being used
- Patch for bz#495046 applied.

* Wed Jul 29 2009 Steve 'Ashcrow' Milner <stevem@gnulinux.net> - 1.0.3-6
- Attempted combined spec for F12/11/10 and EL5

* Wed Jul 29 2009 Steve 'Ashcrow' Milner <stevem@gnulinux.net> - 1.0.3-4
- Older builds must ghost django-admin.py[c,o]

* Wed Jul 29 2009 Steve 'Ashcrow' Milner <stevem@gnulinux.net> - 1.0.3-3
- Bump for tag issue.

* Wed Jul 29 2009 Steve 'Ashcrow' Milner <stevem@gnulinux.net> - 1.0.3-2
- Fix changelog.

* Wed Jul 29 2009 Steve 'Ashcrow' Milner <stevem@gnulinux.net> - 1.0.3-1
- Upgrade for http://www.djangoproject.com/weblog/2009/jul/28/security/

* Thu Mar 12 2009 Michel Salim <salimma@fedoraproject.org> - 1.0.2-3
- Build HTML documentation (bug #484070)
- No longer excluding *.py? in bindir, F11's Python does not optimizes these

* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Sun Dec 14 2008 Michel Salim <salimma@fedoraproject.org> - 1.0.2-1
- Update to 1.0.2

* Sat Nov  1 2008 Steve 'Ashcrow' Milner <stevem@gnulinux.net> - 1.0.1-0.1.beta1
- Update to 1.0.1_beta_1

* Sat Sep  6 2008 Michel Salim <salimma@fedoraproject.org> - 1.0-1
- Update to final 1.0 release

* Tue Sep  2 2008 Michel Salim <salimma@fedoraproject.org> - 1.0-0.1.rc1%{?dist}
- CSRF security update: bz#460966

* Wed Aug 27 2008 Michel Salim <salimma@fedoraproject.org> - 1.0-0.1.beta2
- Update to 1.0 beta2

* Sat Aug 23 2008 Michel Salim <salimma@fedoraproject.org> - 1.0-0.1.beta1
- Update to 1.0 beta1

* Mon May 19 2008 Michel Salim <salimma@fedoraproject.org> - 0.96.2-1
- XSS security update: CVE-2008-2302 (bz# 442757-60)

* Sat Apr  5 2008 Michel Salim <salimma@fedoraproject.org> - 0.96.1-2
- Package .egg-info file on Fedora >= 9

* Thu Nov  1 2007 Michel Salim <michel.sylvan@gmail.com> 0.96.1-1
- i18n security update: CVE-2007-5712, bz#357051

* Sat Mar 24 2007 Michel Salim <michel.salim@gmail.com> - 0.96-1
- New upstream version

* Sun Jan 21 2007 Michel Salim <michel.salim@gmail.com> - 0.95.1-1
- Upstream security updates:
  http://www.djangoproject.com/weblog/2007/jan/21/0951/

* Sun Nov 12 2006 Michel Salim <michel.salim@gmail.com> - 0.95-1
- Initial package