diff --git a/python-django-tastypie.spec b/python-django-tastypie.spec index b0ee24c..de1f535 100644 --- a/python-django-tastypie.spec +++ b/python-django-tastypie.spec @@ -2,10 +2,9 @@ %global sum A flexible and capable API layer for Django Name: python-%{pypi_name} Version: 0.13.3 -Release: 7%{?dist} +Release: 8%{?dist} Summary: %{sum} -Group: Development/Languages License: BSD URL: https://github.com/toastdriven/django-tastypie/ @@ -14,27 +13,8 @@ Source0: https://github.com/%{pypi_name}/%{pypi_name}/archive/v%{version} BuildArch: noarch # Let's keep Requires and BuildRequires sorted alphabetically -BuildRequires: python2-devel python3-devel -BuildRequires: python-setuptools -BuildRequires: python-sphinx - -%if 0%{?rhel} -Requires: python-dateutil15 -# also require setuptools to be able to use 'require' function from pkg_resources module -Requires: python-setuptools -%else -Requires: python-dateutil -%endif - -%if 0%{?fedora} >= 18 -Requires: python-django >= 1.2.0 -%else -Requires: Django >= 1.2.0 -%endif -Requires: python-mimeparse >= 0.1.3 - -Provides: %{pypi_name} = %{version}-%{release} -Obsoletes: %{pypi_name} < 0.9.11-3 +BuildRequires: python3-devel +BuildRequires: python3-sphinx %description Tastypie is an webservice API framework for Django. It provides a convenient, @@ -43,27 +23,24 @@ interfaces. %package doc Summary: Documentation for %{name} -Group: Documentation -Requires: %{name} = %{version}-%{release} +Requires: python3-%{pypi_name} = %{version}-%{release} %description doc This package contains documentation for %{name}. -%package -n python2-%{pypi_name} -Summary: %{sum} -%{?python_provide:%python_provide python2-%{pypi_name}} - -%description -n python2-%{pypi_name} -Tastypie is an webservice API framework for Django. It provides a convenient, -yet powerful and highly customizable, abstraction for creating REST-style -interfaces. - - %package -n python3-%{pypi_name} Summary: %{sum} %{?python_provide:%python_provide python3-%{pypi_name}} +Requires: python3-dateutil +Requires: python3-django +Requires: python3-mimeparse + +Obsoletes: %{pypi_name} < 0.9.11-3 +Obsoletes: python-%{pypi_name} <= 0.13.3-8 +Obsoletes: python2-%{pypi_name} <= 0.13.3-8 + %description -n python3-%{pypi_name} Tastypie is an webservice API framework for Django. It provides a convenient, yet powerful and highly customizable, abstraction for creating REST-style @@ -72,35 +49,20 @@ interfaces. %prep %setup -q -n %{pypi_name}-%{version} + +%build # (re)generate the documentation #pushd docs -sphinx-build docs docs/_build/html +sphinx-build-3 docs docs/_build/html #make html #popd rm -rf docs/_build/html/.??* -# if on RHEL, using dateutils15, we need to alter __init__.py to load them properly -%if 0%{?rhel} -cat << 'EOF' >> tastypie/__init__.py -from pkg_resources import require -require('python-dateutil') -EOF -%endif - -%build -%{__python2} setup.py build -%{__python3} setup.py build +%py3_build %install -%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT -%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT - -%files -n python2-%{pypi_name} -%doc README.rst AUTHORS LICENSE -%dir %{python2_sitelib}/tastypie -%{python2_sitelib}/django_tastypie* -%{python2_sitelib}/tastypie/* +%py3_install %files -n python3-%{pypi_name} %doc README.rst AUTHORS LICENSE @@ -112,6 +74,14 @@ EOF %doc docs/_build/html %changelog +* Tue Dec 05 2017 Miro HronĨok +- Remove Python 2 subpackage (#1494761) +- Remove Groups +- Use Python 3 for documentation +- Move docs build into %%build +- Use modern Python build+install macros +- Remove RHEL conditionals + * Thu Jul 27 2017 Fedora Release Engineering - 0.13.3-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild