%if 0%{?fedora}
%global with_python3 1
%endif
%global with_python2 0
%{!?_licensedir: %global license %%doc}
%global modname django-cors-headers
Name: python-django-cors-headers
Version: 2.0.2
Release: 8%{?dist}
Summary: A Django application for handling CORS headers
License: MIT
URL: https://pypi.io/project/django-cors-headers
Source0: https://pypi.io/packages/source/d/%{modname}/%{modname}-%{version}.tar.gz
BuildArch: noarch
%if 0%{?with_python2}
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python-mock
%endif
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-mock
%endif
%description
django-cors-headers is a Django application for handling the server headers
required for Cross-Origin Resource Sharing (CORS).
%if 0%{?with_python2}
%package -n python2-%{modname}
Summary: A Django application for handling CORS headers
%{?python_provide:%python_provide python2-%{modname}}
%description -n python2-%{modname}
django-cors-headers is a Django application for handling the server headers
required for Cross-Origin Resource Sharing (CORS).
%endif
%if 0%{?with_python3}
%package -n python3-%{modname}
Summary: A Django application for handling CORS headers
%{?python_provide:%python_provide python3-%{modname}}
%if 0%{?with_python2}
%else
Provides: python2-%{modname}
%endif
%description -n python3-%{modname}
django-cors-headers is a Django application for handling the server headers
required for Cross-Origin Resource Sharing (CORS).
%endif
%prep
%autosetup -n %{modname}-%{version}
%build
%if 0%{?with_python2}
%py2_build
%endif
%if 0%{?with_python3}
%py3_build
%endif
%install
%if 0%{?with_python2}
%py2_install
%endif
%if 0%{?with_python3}
%py3_install
%endif
%if 0%{?with_python2}
%files -n python2-%{modname}
%doc README.rst HISTORY.rst
%license LICENSE.txt
%{python2_sitelib}/corsheaders/
%{python2_sitelib}/django_cors_headers-%{version}*
%endif
%if 0%{?with_python3}
%files -n python3-%{modname}
%doc README.rst HISTORY.rst
%license LICENSE.txt
%{python3_sitelib}/corsheaders/
%{python3_sitelib}/django_cors_headers-%{version}*
%endif
%changelog
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.2-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jun 19 2018 Miro HronĨok <mhroncok@redhat.com> - 2.0.2-7
- Rebuilt for Python 3.7
* Tue Mar 06 2018 Ralph Bean <rbean@redhat.com> - 2.0.2-6
- Make py3 package provide the old py2 name.
* Mon Mar 05 2018 Ralph Bean <rbean@redhat.com> - 2.0.2-5
- Disable python2 for https://fedoraproject.org/wiki/Changes/Django20
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Tue Feb 28 2017 Ralph Bean <rbean@redhat.com> - 2.0.2-2
- Add missing doc and license declarations.
* Fri Feb 10 2017 Ralph Bean <rbean@redhat.com> - 2.0.2-1
- Latest upstream.
* Mon Jan 18 2016 Ralph Bean <rbean@redhat.com> - 1.1.0-2
- Initial packaging for Fedora.