%global pypi_name Django %global package_name %(echo "%{pypi_name}" | tr '-' '_' | tr '[:upper:]' '[:lower:]') %{?scl:%global python3_pkgversion %{nil}} %{?scl:%scl_package python-%{package_name}} %{!?scl:%global pkg_name %{name}} Name: %{?scl_prefix}python%{python3_pkgversion}-%{package_name} Version: 2.1.4 Release: 2%{?dist} Summary: A high-level Python Web framework Group: Development/Languages License: BSD URL: https://pypi.io/project/%{pypi_name} Source0: https://pypi.io/packages/source/%(echo "%{pypi_name}" | cut -c 1)/%{pypi_name}/%{pypi_name}-%{version}.tar.gz Patch0: python-django-shebang.patch BuildArch: noarch BuildRequires: %{?scl_prefix_python}python%{python3_pkgversion}-devel BuildRequires: %{?scl_prefix_python}python%{python3_pkgversion}-setuptools BuildRequires: %{?scl_prefix_python}python%{python3_pkgversion}-docutils BuildRequires: %{?scl_prefix_python}python%{python3_pkgversion}-jinja2 BuildRequires: %{?scl_prefix}python%{python3_pkgversion}-pytz %{?scl:BuildRequires: %{scl}-build %{scl}-runtime} Requires: %{?scl_prefix}python%{python3_pkgversion}-pytz %{?scl:Requires: %{scl}-runtime} %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. %prep %setup -q -n %{pypi_name}-%{version} %patch0 -p1 %build %{?scl:scl enable %{scl} "} %{__python3} setup.py build %{?scl:"} %install %{?scl:scl enable %{scl} "} %{__python3} \ setup.py \ install \ -O1 \ --skip-build \ --root %{buildroot} \ --install-purelib %{python3_sitelib} \ --install-scripts %{_bindir} %{?scl:"} # Patch shebangs. for FILE in \ %{buildroot}%{python3_sitelib}/django/conf/project_template/manage.py-tpl \ %{buildroot}%{python3_sitelib}/django/bin/django-admin.py \ %{buildroot}%{_bindir}/django-admin.py \ %{buildroot}%{_bindir}/django-admin do sed -i -e '1 s"^#!/usr/bin/python3"#!%{__python3}"' $FILE done %files %license LICENSE %doc AUTHORS %doc README.rst %{_bindir}/django-admin.py %{_bindir}/django-admin %{python3_sitelib}/django %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %changelog * Wed Dec 19 2018 Daniel Uvehag - 2.1.4-2 - Patch shebangs to avoid python3 dependency in SCL * Tue Dec 11 2018 Daniel Uvehag - 2.1.4-1 - Update version to 2.1.4. * Thu Nov 22 2018 Daniel Uvehag - 2.1.3-1 - Initial package.