Blame python2-django1.11.spec

0f48ea9
%global         pkgname Django
0f48ea9
0f48ea9
0f48ea9
Name:           python2-django1.11
0f48ea9
08ecff4
Version:        1.11.9
08ecff4
Release:        1%{?dist}
0f48ea9
Summary:        Version 1.11 LTS of Django, a high-level Python Web framework
0f48ea9
0f48ea9
Group:          Development/Languages
0f48ea9
License:        BSD
0f48ea9
URL:            http://www.djangoproject.com/
0f48ea9
Source0:        https://files.pythonhosted.org/packages/source/D/Django/Django-%{version}.tar.gz
0f48ea9
0f48ea9
0f48ea9
BuildArch:      noarch
0f48ea9
0f48ea9
0f48ea9
BuildRequires:  python2-devel
0f48ea9
BuildRequires:  python2-bcrypt
ec78788
BuildRequires:  %{_bindir}/pathfix.py
0f48ea9
0f48ea9
# test requirements
0f48ea9
BuildRequires:  python2-docutils
0f48ea9
BuildRequires:  python2-jinja2
0f48ea9
BuildRequires:  python2-mock
0f48ea9
BuildRequires:  python2-numpy
0f48ea9
BuildRequires:  python2-pillow
0f48ea9
BuildRequires:  python2-pyyaml
0f48ea9
BuildRequires:  python2-pytz
0f48ea9
BuildRequires:  python2-selenium
0f48ea9
BuildRequires:  python2-sqlparse
b520115
BuildRequires:  python2-memcached
0f48ea9
b520115
Requires:       python2-pytz
0f48ea9
Obsoletes:      python-django < 2
0f48ea9
Obsoletes:      python2-django < 2
0f48ea9
0f48ea9
Provides: bundled(jquery) = 2.2.3
0f48ea9
Provides: bundled(xregexp) = 2.0.0
0f48ea9
c04c9e4
%{?python_provide:%python_provide %{name}}
c04c9e4
0f48ea9
0f48ea9
%description
0f48ea9
This package provides Django in version 1.11 LTS, the last release
0f48ea9
to support Python 2.
0f48ea9
0f48ea9
Django is a high-level Python Web framework that encourages rapid
0f48ea9
development and a clean, pragmatic design. It focuses on automating as
0f48ea9
much as possible and adhering to the DRY (Don't Repeat Yourself)
0f48ea9
principle.
0f48ea9
0f48ea9
0f48ea9
%package doc
0f48ea9
Summary:        Documentation for Django, version 1.11 LTS
0f48ea9
Requires:       %{name} = %{version}-%{release}
0f48ea9
b520115
BuildRequires:  python2-sphinx
0f48ea9
c04c9e4
Obsoletes:      python-django-doc < 2
c04c9e4
Obsoletes:      python2-django-doc < 2
c04c9e4
c04c9e4
%{?python_provide:%python_provide %{name}-doc}
c04c9e4
0f48ea9
%description doc
0f48ea9
This package contains the documentation for the Django high-level
0f48ea9
Python Web framework, version 1.11 LTS.
0f48ea9
0f48ea9
0f48ea9
%prep
0f48ea9
%autosetup -n %{pkgname}-%{version}
0f48ea9
ec78788
# Remove stray executable bit
ec78788
chmod -v -x django/contrib/admin/static/admin/js/vendor/xregexp/xregexp.js
0f48ea9
0f48ea9
0f48ea9
%build
0f48ea9
%py2_build
0f48ea9
0f48ea9
0f48ea9
%install
0f48ea9
0f48ea9
%py2_install
0f48ea9
0f48ea9
%find_lang django
0f48ea9
%find_lang djangojs
0f48ea9
# append djangojs.lang to django.lang
0f48ea9
cat djangojs.lang >> django.lang
0f48ea9
0f48ea9
# build documentation
0f48ea9
(cd docs && mkdir djangohtml && mkdir -p _build/{doctrees,html} && make html)
0f48ea9
0f48ea9
# Fix admin script in %%{_bindir}
0f48ea9
mv %{buildroot}%{_bindir}/django-admin %{buildroot}%{_bindir}/django-admin-1.11
0f48ea9
rm %{buildroot}%{_bindir}/django-admin.py
ec78788
0f48ea9
# Man page for django-admin-1.11 is not packaged -- the dot & number don't
0f48ea9
# play well with man
0f48ea9
0f48ea9
# remove .po files
b520115
find %{buildroot} -name "*.po" | xargs rm -f
0f48ea9
ec78788
# Fix shebang in internal script
ec78788
pathfix.py -i %{__python2} -p %{buildroot}%{python2_sitelib}/django/bin/*
ec78788
ec78788
# Remove stray backup file
ec78788
rm -f %{buildroot}%{python2_sitelib}/django/bin/*~
ec78788
0f48ea9
0f48ea9
%check
0f48ea9
export PYTHONPATH=$(pwd)
0f48ea9
export LANG=en_US.utf8
0f48ea9
cd tests
b520115
%{__python2} ./runtests.py --settings=test_sqlite --verbosity=2 --parallel 1
0f48ea9
0f48ea9
0f48ea9
%files -f django.lang
0f48ea9
%doc AUTHORS README.rst
0f48ea9
%license LICENSE
0f48ea9
%{_bindir}/django-admin-1.11
ec78788
ec78788
%{python2_sitelib}/django/
ec78788
# Note: this duplicates files in %%find_lang
ec78788
# The macro is meant to make it easy for packages to own .mo files in:
ec78788
#    %%{_datadir}/locale/??/LC_MESSAGES/*.mo
ec78788
# ... but not the LC_MESSAGES directory itself.
ec78788
# But Django's lang files are in site-packages/django, and we own all of that.
ec78788
# This does cause harmless build warnings about duplicate files.
0f48ea9
0f48ea9
%{python2_sitelib}/*.egg-info
0f48ea9
ec78788
0f48ea9
%files doc
0f48ea9
%doc docs/_build/html/*
0f48ea9
0f48ea9
0f48ea9
%changelog
08ecff4
* Wed Dec 13 2017 Petr Viktorin <pviktori@redhat.com> - 1.11.9-1
0f48ea9
- Initial compat package
08ecff4
- Based on Fedora's python-django 1.11.5-1; updated to 1.11.9