Blob Blame History Raw
%if 0%{?fedora}
%global with_python3 1
%endif

%{!?_licensedir: %global license %%doc}

%global modname django-cors-headers

Name:               python-django-cors-headers
Version:            2.0.2
Release:            2%{?dist}
Summary:            A Django application for handling CORS headers

Group:              Development/Libraries
License:            MIT
URL:                https://pypi.io/project/django-cors-headers
Source0:            https://pypi.io/packages/source/d/%{modname}/%{modname}-%{version}.tar.gz
BuildArch:          noarch

BuildRequires:      python2-devel
BuildRequires:      python-setuptools
BuildRequires:      python-mock

%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).

%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).

%if 0%{?with_python3}
%package -n python3-%{modname}
Summary:            A Django application for handling CORS headers
%{?python_provide:%python_provide python3-%{modname}}

%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
%py2_build
%if 0%{?with_python3}
%py3_build
%endif

%install
%py2_install
%if 0%{?with_python3}
%py3_install
%endif

%files -n python2-%{modname}
%doc README.rst HISTORY.rst
%license LICENSE.txt
%{python2_sitelib}/corsheaders/
%{python2_sitelib}/django_cors_headers-%{version}*

%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
* 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.