Blob Blame Raw
%global         pkgname Django


Name:           python2-django1.11

Version:        1.11.15
Release:        2%{?dist}
Summary:        Version 1.11 LTS of Django, a high-level Python Web framework

Group:          Development/Languages
License:        BSD
URL:            http://www.djangoproject.com/
Source0:        %{pypi_source %pkgname}


BuildArch:      noarch


BuildRequires:  python2-devel
BuildRequires:  python2-bcrypt
BuildRequires:  %{_bindir}/pathfix.py

# test requirements
BuildRequires:  python2-docutils
BuildRequires:  python2-jinja2
BuildRequires:  python2-mock
BuildRequires:  python2-numpy
BuildRequires:  python2-pillow
BuildRequires:  python2-pyyaml
BuildRequires:  python2-pytz
BuildRequires:  python2-selenium
BuildRequires:  python2-sqlparse
BuildRequires:  python2-memcached

Requires:       python2-pytz
Obsoletes:      python-django < 2
Obsoletes:      python2-django < 2

Provides: bundled(jquery) = 2.2.3
Provides: bundled(xregexp) = 2.0.0

%{?python_provide:%python_provide %{name}}


%description
This package provides Django in version 1.11 LTS, the last release
to support Python 2.

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.


%package doc
Summary:        Documentation for Django, version 1.11 LTS
Requires:       %{name} = %{version}-%{release}

BuildRequires:  python2-sphinx

Obsoletes:      python-django-doc < 2
Obsoletes:      python2-django-doc < 2

%{?python_provide:%python_provide %{name}-doc}

%description doc
This package contains the documentation for the Django high-level
Python Web framework, version 1.11 LTS.


# Exclude templates from shebang mangling
%global __brp_mangle_shebangs_exclude_from \\.py-tpl$


%prep
%autosetup -n %{pkgname}-%{version}

# Remove stray executable bit
chmod -v -x django/contrib/admin/static/admin/js/vendor/xregexp/xregexp.js

# Keep env shebang in templates, but use python2 explicitly
pathfix.py -pni "%{_bindir}/env python2" $(find -name '*.py-tpl')

%build
%py2_build


%install

%py2_install

%find_lang django
%find_lang djangojs
# append djangojs.lang to django.lang
cat djangojs.lang >> django.lang

# build documentation
(cd docs && mkdir djangohtml && mkdir -p _build/{doctrees,html} && make html)

# Fix admin script in %%{_bindir}
mv %{buildroot}%{_bindir}/django-admin %{buildroot}%{_bindir}/django-admin-1.11
rm %{buildroot}%{_bindir}/django-admin.py

# Man page for django-admin-1.11 is not packaged -- the dot & number don't
# play well with man

# remove .po files
find %{buildroot} -name "*.po" | xargs rm -f

# Fix shebang in internal script
pathfix.py -pni "%{__python2} %{py2_shbang_opts}" %{buildroot}%{python2_sitelib}/django/bin/*


%check
export PYTHONPATH=$(pwd)
export LANG=en_US.utf8
cd tests
%{__python2} ./runtests.py --settings=test_sqlite --verbosity=2 --parallel 1


%files -f django.lang
%doc AUTHORS README.rst
%license LICENSE
%{_bindir}/django-admin-1.11

%{python2_sitelib}/django/
# Note: this duplicates files in %%find_lang
# The macro is meant to make it easy for packages to own .mo files in:
#    %%{_datadir}/locale/??/LC_MESSAGES/*.mo
# ... but not the LC_MESSAGES directory itself.
# But Django's lang files are in site-packages/django, and we own all of that.
# This does cause harmless build warnings about duplicate files.

%{python2_sitelib}/*.egg-info


%files doc
%doc docs/_build/html/*


%changelog
* Fri Aug 03 2018 Petr Viktorin <pviktori@redhat.com> - 1.11.15-2
- Update to 1.11.15 security release (CVE-2018-14574)
  CVE-2018-14574: Open redirect possibility in CommonMiddleware
  https://docs.djangoproject.com/en/2.0/releases/1.11.15/

* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.14-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Mon Jun 04 2018 Petr Viktorin <pviktori@redhat.com> - 1.11.14-1
- update to 1.11.14, fixing a memory usage regression and a GIS bug
  https://docs.djangoproject.com/en/2.0/releases/1.11.14/

* Thu May 03 2018 Matthias Runge <mrunge@redhat.com> - 1.11.13-1
- update to 1.11.13, fixing regressions and a crash

* Mon Mar 12 2018 Petr Viktorin <pviktori@redhat.com> - 1.11.11-1
- Update to 1.11.11 security release
- Fixes CVE-2018-7536: DoS possibility in urlize and urlizetrunc template filters
- Fixes CVE-2018-7537: DoS possibility in truncatechars_html and
  truncatewords_html template filters

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.10-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Wed Dec 13 2017 Petr Viktorin <pviktori@redhat.com> - 1.11.10-1
- Update to 1.11.10 security release
- Fixes CVE-2018-6188: Information leakage in AuthenticationForm

* Wed Dec 13 2017 Petr Viktorin <pviktori@redhat.com> - 1.11.9-1
- Initial compat package
- Based on Fedora's python-django 1.11.5-1; updated to 1.11.9