%define pypi_name Django %define pkg_name django Name: python-%{pkg_name} Version: 3.1.14 Release: %mkrel 1 Summary: A high-level Python Web framework License: BSD Group: Development/Python Url: https://pypi.org/project/Django Source0: %{pypi_source} BuildArch: noarch BuildRequires: pkgconfig(python3) BuildRequires: python3dist(setuptools) # for docs BuildRequires: python3dist(sphinx) BuildRequires: python3dist(sphinx-rtd-theme) %description Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Developed and used over the past two years by a fast-moving online-news operation, Django was designed from scratch to handle two challenges: the intensive deadlines of a newsroom and the stringent requirements of experienced Web developers. It has convenient niceties for developing content-management systems, but it's an excellent tool for building any Web site. Django focuses on automating as much as possible and adhering to the DRY principle. %package -n python3-%{pkg_name} Summary: %{summary} Group: Development/Python %{?python_provide:%python_provide python3-%{pkg_name}} Obsoletes: %{name}-bash-completion < 2.2.4 Obsoletes: python2-django < 2.2.4 %description -n python3-%{pkg_name} Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Developed and used over the past two years by a fast-moving online-news operation, Django was designed from scratch to handle two challenges: the intensive deadlines of a newsroom and the stringent requirements of experienced Web developers. It has convenient niceties for developing content-management systems, but it's an excellent tool for building any Web site. Django focuses on automating as much as possible and adhering to the DRY principle. %prep %setup -q -n %{pypi_name}-%{version} # drop bundled egg-info rm -rf Django.egg-info/ # fix shebangs find . \( -name "*.py" -o -name "*.py-tpl" \) -exec sed -i -e '1s|#!.*python[2,3]\?|#!%{__python3}|' {} \; # empty files for f in \ django/contrib/staticfiles/models.py \ django/contrib/humanize/models.py \ ; do echo "# just a comment" > $f done %build %py3_build %install %py3_install # build documentation rm -rf docs/{html,man}/* make -C docs man make -C docs html rm -rf docs/_build/html/.{buildinfo,doctrees} # install man pages mkdir -p %{buildroot}%{_mandir}/man1/ cp -a docs/_build/man/* %{buildroot}%{_mandir}/man1/ # install bash completion script mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d/ install -m 0644 -p extras/django_bash_completion \ %{buildroot}%{_sysconfdir}/bash_completion.d/ # Fix items in %%{_bindir} mv %{buildroot}%{_bindir}/django-admin{.py,} %files -n python3-%{pkg_name} %doc AUTHORS LICENSE README.rst %doc docs/_build/html %{_mandir}/man1/* %{_bindir}/django-admin %{_sysconfdir}/bash_completion.d/django_bash_completion %{python3_sitelib}/django %{python3_sitelib}/%{pypi_name}-*.egg-info