File python-Flask-Cors.spec of Package python-Flask-Cors

#
# spec file for package python-Flask-Cors
#
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without test
Name:           python-Flask-Cors
Version:        3.0.3
Release:        0
Summary:        A Flask extension adding a decorator for CORS support
License:        MIT
Group:          Development/Languages/Python
URL:            https://github.com/corydolphin/flask-cors
Source:         https://files.pythonhosted.org/packages/source/F/Flask-Cors/Flask-Cors-%{version}.tar.gz
Patch0:         0001-Handle-request_headers-None.patch
# PATCH-FIX-UPSTREAM alarrosa@suse.com -- boo#1175986 CVE-2020-25032
Patch1:         0002-Fix-request-path-normalization.patch
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
%if %{with test}
BuildRequires:  %{python_module Flask >= 0.9}
BuildRequires:  %{python_module nose}
BuildRequires:  %{python_module six}
%endif
# /SECTION
Requires:       python-Flask >= 0.9
Requires:       python-six
BuildArch:      noarch

%python_subpackages

%description
A Flask extension for handling Cross Origin Resource Sharing (CORS),
making cross-origin AJAX possible.

This package has a simple philosophy, when you want to enable CORS, you
wish to enable it for all use cases on a domain. This means no mucking
around with different allowed headers, methods, etc. By default,
submission of cookies across domains is disabled due to the security
implications, please see the documentation for how to enable
credential'ed requests, and please make sure you add some sort of
`CSRF <http://en.wikipedia.org/wiki/Cross-site_request_forgery>`__
protection before doing so!

%prep
%setup -q -n Flask-Cors-%{version}
%patch0 -p1
%patch1 -p1

%build
%python_build

%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%if %{with test}
%check
%python_exec setup.py test
%endif

%files %{python_files}
%defattr(-,root,root,-)
%doc LICENSE README.rst
%{python_sitelib}/*

%changelog
openSUSE Build Service is sponsored by