2013-12-04 13:48:43 +01:00
|
|
|
#
|
|
|
|
# spec file for package python-Django
|
|
|
|
#
|
2021-02-15 13:40:03 +01:00
|
|
|
# Copyright (c) 2021 SUSE LLC
|
2013-12-04 13:48:43 +01:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2018-10-04 15:58:52 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2013-12-04 13:48:43 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2019-10-07 15:20:58 +02:00
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
|
|
|
%define skip_python2 1
|
2019-04-12 16:20:43 +02:00
|
|
|
# Selenium and memcached are not operational
|
|
|
|
%bcond_with selenium
|
|
|
|
%bcond_with memcached
|
2013-12-04 13:48:43 +01:00
|
|
|
Name: python-Django
|
2019-12-29 12:16:16 +01:00
|
|
|
# We want support LTS versions of Django - numbered 2.2 -> 3.2 -> 4.2 etc
|
2020-12-09 13:32:02 +01:00
|
|
|
Version: 3.1.4
|
2013-12-04 13:48:43 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: A high-level Python Web framework
|
|
|
|
License: BSD-3-Clause
|
2019-10-07 15:20:58 +02:00
|
|
|
URL: https://www.djangoproject.com
|
2020-08-12 09:29:18 +02:00
|
|
|
Source: https://www.djangoproject.com/m/releases/3.1/Django-%{version}.tar.gz
|
2015-07-14 17:43:44 +02:00
|
|
|
Source1: https://www.djangoproject.com/m/pgp/Django-%{version}.checksum.txt#/Django-%{version}.tar.gz.asc
|
|
|
|
Source2: %{name}.keyring
|
2014-10-09 12:52:23 +02:00
|
|
|
Source99: python-Django-rpmlintrc
|
2019-04-03 14:52:28 +02:00
|
|
|
Patch0: i18n_test.patch
|
2019-04-12 16:20:43 +02:00
|
|
|
Patch1: test_clear_site_cache-sort.patch
|
2020-08-12 09:29:18 +02:00
|
|
|
# PATCH-FIX-OPENSUSE i18n_test_extraction.patch
|
|
|
|
Patch2: i18n_test_extraction.patch
|
2018-08-08 15:34:16 +02:00
|
|
|
BuildRequires: %{python_module Jinja2 >= 2.9.2}
|
|
|
|
BuildRequires: %{python_module Pillow}
|
|
|
|
BuildRequires: %{python_module PyYAML}
|
|
|
|
BuildRequires: %{python_module argon2-cffi >= 16.1.0}
|
2020-09-09 08:16:14 +02:00
|
|
|
BuildRequires: %{python_module asgiref >= 3.2.10}
|
2018-08-08 11:56:05 +02:00
|
|
|
BuildRequires: %{python_module base >= 3.5}
|
2018-08-08 15:34:16 +02:00
|
|
|
BuildRequires: %{python_module bcrypt}
|
|
|
|
BuildRequires: %{python_module docutils}
|
|
|
|
BuildRequires: %{python_module geoip2}
|
|
|
|
BuildRequires: %{python_module pytz}
|
2017-05-09 17:59:50 +02:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2020-04-23 22:48:53 +02:00
|
|
|
BuildRequires: %{python_module sqlparse >= 0.2.2}
|
2018-08-08 15:34:16 +02:00
|
|
|
BuildRequires: %{python_module tblib}
|
2019-11-15 08:49:29 +01:00
|
|
|
BuildRequires: %{pythons}
|
2017-08-14 12:38:18 +02:00
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
2021-02-15 13:40:03 +01:00
|
|
|
BuildRequires: %{python_module numpy if (%python-base without python36-base)}
|
2019-11-15 08:49:29 +01:00
|
|
|
Requires: python
|
2017-05-09 17:59:50 +02:00
|
|
|
Requires: python-Pillow
|
2018-08-08 15:34:16 +02:00
|
|
|
Requires: python-argon2-cffi >= 16.1.0
|
2020-09-09 08:16:14 +02:00
|
|
|
Requires: python-asgiref >= 3.2.10
|
2017-08-14 12:38:18 +02:00
|
|
|
Requires: python-pytz
|
2015-11-11 10:31:32 +01:00
|
|
|
Requires: python-setuptools
|
2020-04-23 22:48:53 +02:00
|
|
|
Requires: python-sqlparse >= 0.2.2
|
2018-08-08 11:56:05 +02:00
|
|
|
Requires(post): update-alternatives
|
|
|
|
Requires(preun): update-alternatives
|
2018-08-08 15:34:16 +02:00
|
|
|
Recommends: python-Jinja2 >= 2.9.2
|
|
|
|
Recommends: python-PyYAML
|
|
|
|
Recommends: python-argon2-cffi >= 16.1.0
|
2017-08-14 12:38:18 +02:00
|
|
|
Recommends: python-bcrypt
|
2018-08-08 15:34:16 +02:00
|
|
|
Recommends: python-geoip2
|
|
|
|
Recommends: python-pylibmc
|
|
|
|
Recommends: python-python-memcached >= 1.59
|
2021-02-15 13:40:03 +01:00
|
|
|
Provides: python-django = %{version}
|
|
|
|
Obsoletes: python-django < %{version}
|
|
|
|
Provides: python-South = %{version}
|
|
|
|
Obsoletes: python-South < %{version}
|
2013-12-04 13:48:43 +01:00
|
|
|
BuildArch: noarch
|
2019-10-07 15:20:58 +02:00
|
|
|
%if %{with memcached}
|
|
|
|
BuildRequires: %{python_module pylibmc}
|
|
|
|
BuildRequires: %{python_module python-memcached >= 1.59}
|
|
|
|
%endif
|
|
|
|
%if %{with selenium}
|
|
|
|
# python-selenium is supported only on the Intel architecture.
|
|
|
|
# Additionally chromedriver is only available on x86_64.
|
|
|
|
%ifarch %{ix86} x86_64
|
|
|
|
BuildRequires: %{python_module selenium}
|
|
|
|
BuildRequires: chromedriver
|
|
|
|
BuildRequires: xvfb-run
|
|
|
|
%endif
|
|
|
|
%endif
|
2017-05-09 17:59:50 +02:00
|
|
|
%python_subpackages
|
2013-12-04 13:48:43 +01:00
|
|
|
|
|
|
|
%description
|
|
|
|
Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
|
|
|
|
|
|
|
|
%prep
|
2015-07-14 17:43:44 +02:00
|
|
|
# The publisher doesn't sign the source tarball, but a signatures file containing multiple hashes.
|
|
|
|
# Verify hashes in that file against source tarball.
|
|
|
|
echo "`grep -e '^[0-9a-f]\{32\} Django-%{version}.tar.gz' %{SOURCE1} | cut -c1-32` %{SOURCE0}" | md5sum -c
|
|
|
|
echo "`grep -e '^[0-9a-f]\{40\} Django-%{version}.tar.gz' %{SOURCE1} | cut -c1-40` %{SOURCE0}" | sha1sum -c
|
|
|
|
echo "`grep -e '^[0-9a-f]\{64\} Django-%{version}.tar.gz' %{SOURCE1} | cut -c1-64` %{SOURCE0}" | sha256sum -c
|
|
|
|
|
2013-12-04 13:48:43 +01:00
|
|
|
%setup -q -n Django-%{version}
|
2020-04-30 07:16:55 +02:00
|
|
|
%autopatch -p1
|
2019-04-12 16:20:43 +02:00
|
|
|
chmod a-x django/contrib/admin/static/admin/js/vendor/xregexp/xregexp.js
|
2013-12-04 13:48:43 +01:00
|
|
|
|
|
|
|
%build
|
2017-05-09 17:59:50 +02:00
|
|
|
%python_build
|
2013-12-04 13:48:43 +01:00
|
|
|
|
|
|
|
%install
|
2017-05-09 17:59:50 +02:00
|
|
|
%python_install
|
2014-10-09 12:52:23 +02:00
|
|
|
|
2017-05-09 17:59:50 +02:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/django-admin.py
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/django-admin
|
2014-02-26 06:55:11 +01:00
|
|
|
|
2018-08-08 11:56:05 +02:00
|
|
|
%{python_expand install -D -m 0644 extras/django_bash_completion %{buildroot}%%{_datadir}/bash-completion/completions/django_bash_completion-%{$python_bin_suffix}.sh
|
2017-07-30 11:19:59 +02:00
|
|
|
# Fix wrong-script-interpreter
|
2021-02-15 13:40:03 +01:00
|
|
|
sed -i "s|^#!%{_bindir}/env python$|#!%{_bindir}/$python|" \
|
2019-04-12 16:20:43 +02:00
|
|
|
%{buildroot}%{$python_sitelib}/django/bin/django-admin.py \
|
|
|
|
%{buildroot}%{$python_sitelib}/django/conf/project_template/manage.py-tpl
|
2021-02-15 13:40:03 +01:00
|
|
|
}
|
|
|
|
%python_compileall
|
|
|
|
%{python_expand #
|
2019-04-12 16:20:43 +02:00
|
|
|
%fdupes %{buildroot}%{$python_sitelib}/django/
|
|
|
|
%fdupes %{buildroot}%{$python_sitelib}/Django-%{version}-py*.egg-info/
|
2017-05-09 17:59:50 +02:00
|
|
|
}
|
2013-12-04 13:48:43 +01:00
|
|
|
|
2018-08-08 15:34:16 +02:00
|
|
|
%check
|
|
|
|
export LANG=en_US.UTF8
|
|
|
|
export PYTHONDONTWRITEBYTECODE=1
|
2019-04-12 16:20:43 +02:00
|
|
|
%if %{with selenium}
|
|
|
|
export PATH=%{_libdir}/chromium:$PATH
|
2019-11-15 12:01:10 +01:00
|
|
|
%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} xvfb-run $python tests/runtests.py -v 2 --selenium=chrome
|
2019-04-12 16:20:43 +02:00
|
|
|
%else
|
2021-02-15 13:40:03 +01:00
|
|
|
%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} $python tests/runtests.py -v 2
|
2019-04-12 16:20:43 +02:00
|
|
|
%endif
|
2018-08-08 15:34:16 +02:00
|
|
|
|
2013-12-04 13:48:43 +01:00
|
|
|
%post
|
2017-05-09 17:59:50 +02:00
|
|
|
%{python_install_alternative django-admin.py django-admin}
|
2013-12-04 13:48:43 +01:00
|
|
|
|
|
|
|
%preun
|
2017-05-09 17:59:50 +02:00
|
|
|
%python_uninstall_alternative django-admin
|
2013-12-04 13:48:43 +01:00
|
|
|
|
2017-05-09 17:59:50 +02:00
|
|
|
%files %{python_files}
|
2018-07-13 10:22:31 +02:00
|
|
|
%doc AUTHORS README.rst
|
|
|
|
%license LICENSE
|
2017-05-09 17:59:50 +02:00
|
|
|
%python_alternative %{_bindir}/django-admin
|
|
|
|
%python_alternative %{_bindir}/django-admin.py
|
2018-08-08 11:56:05 +02:00
|
|
|
%{_datadir}/bash-completion/completions/django_bash_completion-%{python_bin_suffix}.sh
|
2013-12-04 13:48:43 +01:00
|
|
|
%{python_sitelib}/django
|
2017-05-09 17:59:50 +02:00
|
|
|
%{python_sitelib}/Django-%{version}-py*.egg-info
|
2013-12-04 13:48:43 +01:00
|
|
|
|
|
|
|
%changelog
|