%define module django %define tarname Django Summary: A high-level Python Web framework Name: python-%{module} Version: 1.11.11 Release: %mkrel 2 Source0: https://files.pythonhosted.org/packages/source/D/%{tarname}/%{tarname}-%{version}.tar.gz License: BSD Group: Development/Python Url: http://www.djangoproject.com BuildArch: noarch BuildRequires: python2dist(setuptools) BuildRequires: python2dist(sphinx) BuildRequires: python2dist(sphinx_rtd_theme) BuildRequires: pkgconfig(python2) BuildRequires: pkgconfig(python3) BuildRequires: python3dist(setuptools) BuildRequires: python3dist(sphinx_rtd_theme) Requires: %{name}-bash-completion = %{version}-%{release} %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 python2-%{module} Summary: A high-level Python 2 Web framework Group: Development/Python Requires: %{name}-bash-completion = %{version}-%{release} %{?python_provide:%python_provide python2-%{module}} Obsoletes: python-django < 1.11.11-1 Provides: python-django = %{version}-%{release} %description -n python2-%{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. %package bash-completion Group: Development/Python Summary: bash completion files for Django %description bash-completion This package contains the bash completion files form Django high-level Python Web framework. %package -n python3-%{module} Summary: A high-level Python 3 Web framework Group: Development/Python %{?python_provide:%python_provide python3-%{module}} Requires: %{name}-bash-completion = %{version}-%{release} %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. %package doc Summary: Documentation for django Group: Development/Python Provides: python3-%{module}-doc = %{version}-%{release} %description doc This package contains documentation for Django, a high-level Python Web framework. %prep %setup -q -n %{tarname}-%{version} # empty files for f in \ django/contrib/staticfiles/models.py \ django/contrib/humanize/models.py \ ; do echo "# just a comment" > $f done cp -a . %{py3dir} %build %py2_build pushd %{py3dir} %py3_build popd %install # must do install of python 3 subpackage first, so that we don't # overwrite django-admin script with the python 3 version pushd %{py3dir} %py3_install mv %{buildroot}%{_bindir}/django-admin.py %{buildroot}%{_bindir}/python3-django-admin popd %py2_install # build documentation (cd docs && mkdir djangohtml && mkdir -p _build/{doctrees,html} && make html) # install man pages mkdir -p %{buildroot}%{_mandir}/man1/ cp -p docs/man/* %{buildroot}%{_mandir}/man1/ cp -a %{buildroot}%{_mandir}/man1/django-admin.1 %{buildroot}%{_mandir}/man1/python3-django-admin.1 # 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 %{buildroot}%{_bindir}/django-admin %files -n python2-%{module} %doc AUTHORS LICENSE README.rst %{_mandir}/man1/* # except the python3 prefix %exclude %{_mandir}/man1/python3-* %{_bindir}/django-admin %{python2_sitelib}/%{module} %{python2_sitelib}/%{tarname}-*.egg-info %files -n python3-%{module} %doc AUTHORS LICENSE README.rst %{_mandir}/man1/python3-* %{_bindir}/python3-django-admin %{python3_sitelib}/%{module} %{python3_sitelib}/%{tarname}-*.egg-info %files doc %doc docs/_build/html %files bash-completion %dir %{_sysconfdir}/bash_completion.d/ %config(noreplace) %{_sysconfdir}/bash_completion.d/django_bash_completion