File python-Shapely.spec of Package python-Shapely

# spec file for package python-Shapely
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# 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

%bcond_without test

%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define oldpython python
Name:           python-Shapely
Version:        1.5.17
Release:        0
Summary:        Geospatial geometries, predicates, and operations
License:        BSD-3-Clause
Group:          Development/Libraries/Python
BuildRequires:  %{python_module Cython >= 0.19}
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module numpy-devel}
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
BuildRequires:  geos-devel >= 3.3
BuildRequires:  python-rpm-macros
%if %{with test}
BuildRequires:  %{python_module pytest-cov}
BuildRequires:  %{python_module pytest}
%if 0%{?suse_version} > 1320
BuildRequires:  %{python_module matplotlib}
Requires:       geos >= 3.3
Obsoletes:      %{oldpython}-shapely < %{version}
Provides:       %{oldpython}-shapely = %{version}
Obsoletes:      python3-shapely < %{version}
Provides:       python3-shapely = %{version}

Shapely is a Python package for manipulation and analysis of
planar geometric objects. It is based on the GEOS (the
engine of PostGIS) and JTS (from which GEOS is ported) libraries.
Shapely is not concerned with data formats or coordinate systems,
but can be readily integrated with packages that are like WorldMill
and pyproj.

%setup -q -n Shapely-%{version}

CFLAGS="%{optflags} `geos-config --cflags` LDFLAGS=`geos-config --clibs`"

%python_expand %fdupes %{buildroot}%{$python_sitearch}

# Those are just needed to build cython extension
# Not for distribute
rm -fv %{buildroot}%{_prefix}/shapely/_geos.pxi
rm -frv %{buildroot}%{_prefix}/shapely

%if %{with test}
%python_exec test

%files %{python_files}
%doc CREDITS.txt LICENSE.txt README.rst docs/*

openSUSE Build Service is sponsored by