%define module django %define tarname Django Summary: A high-level Python Web framework Name: python-%{module} Version: 2.2.4 Release: %mkrel 1 License: BSD Group: Development/Python Url: http://www.djangoproject.com Source0: https://files.pythonhosted.org/packages/source/D/%{tarname}/%{tarname}-%{version}.tar.gz 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-%{module} Summary: A high-level Python 3 Web framework Group: Development/Python %{?python_provide:%python_provide python3-%{module}} Obsoletes: %{name}-bash-completion < 2.2.4 Obsoletes: python2-django < 2.2.4 %description -n python3-%{module} 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 %{tarname}-%{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-%{module} %doc AUTHORS LICENSE README.rst %doc docs/_build/html %{_mandir}/man1/* %{_bindir}/django-admin %{_sysconfdir}/bash_completion.d/django_bash_completion %{python3_sitelib}/%{module}/ %{python3_sitelib}/%{tarname}-*.egg-info