Blob Blame Raw
%global         pkgname Django


%if 0%{fedora} >= 31
# python2-sphinx is no more
%bcond_with doc
%else
%bcond_without doc
%endif


Name:           python2-django1.11

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

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-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.


%if %{with doc}
%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.
%endif #{with doc}


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


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

# 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

%if %{with doc}
(cd docs && mkdir djangohtml && mkdir -p _build/{doctrees,html} && make html)
%endif #{with doc}

# 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=C.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


%if %{with doc}
%files doc
%doc docs/_build/html/*
%endif #{with doc}


%changelog
* Wed Jun 19 2019 Petr Viktorin <pviktori@redhat.com> - 1.11.22-1
- Update to the 1.11.22 security fix release

* Wed Jun 19 2019 Petr Viktorin <pviktori@redhat.com> - 1.11.21-1
- Update to the 1.11.21 security fix release
- CVE-2019-12308: AdminURLFieldWidget XSS
- Stop building the doc subpackage

* Mon Feb 18 2019 Petr Viktorin <pviktori@redhat.com> - 1.11.20-1
- Update to the 1.11.20 security fix release
- CVE-2019-6975: Memory exhaustion in django.utils.numberformat.format()

* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.18-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Tue Jan 08 2019 Petr Viktorin <pviktori@redhat.com> - 1.11.18-1
- Update to the 1.11.18 security fix release
- CVE-2019-3498: Content spoofing possibility in the default 404 page
- geo: Prevented repetitive calls to geos_version_tuple() in the WKBWriter class
- Officially supports Python 3.7

* Thu Nov 08 2018 Petr Viktorin <pviktori@redhat.com> - 1.11.16-2
- Switch locale from en_US.utf-8 to C.utf-8 for tests

* Fri Aug 03 2018 Petr Viktorin <pviktori@redhat.com> - 1.11.16-1
- Update to 1.11.16 release -- data loss bug fix
  Fixed a race condition in QuerySet.update_or_create() that could result in data loss
- Remove optional test dependencies
- Exclude templates from shebang mangling

* 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