%define module django %define tarname Django Summary: A high-level Python Web framework Name: python-%{module} Version: 1.8.2 Release: %mkrel 1 Source0: https://pypi.python.org/packages/source/D/%{tarname}/%{tarname}-%{version}.tar.gz Patch0: python-django-1.7-py3-admin-completion License: BSD Group: Development/Python Url: http://www.djangoproject.com BuildArch: noarch BuildRequires: python-setuptools BuildRequires: python-sphinx BuildRequires: python-devel BuildRequires: python3-devel BuildRequires: python3-setuptools 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 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 Web framework Group: Development/Python 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} %patch0 # empty files for f in \ django/contrib/staticfiles/models.py \ django/contrib/webdesign/models.py \ django/contrib/humanize/models.py \ ; do echo "# just a comment" > $f done cp -a . %{py3dir} %build %{__python} setup.py build pushd %{py3dir} %{__python3} setup.py 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} %{__python3} setup.py install --skip-build --root %{buildroot} mv %{buildroot}%{_bindir}/django-admin.py %{buildroot}%{_bindir}/python3-django-admin popd %{__python} setup.py install --skip-build --root %{buildroot} # 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 %doc AUTHORS LICENSE README.rst %{_mandir}/man1/* # except the python3 prefix %exclude %{_mandir}/man1/python3-* %{_bindir}/django-admin %{python_sitelib}/%{module} %{python_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