File python-basemap.spec of Package python-basemap

#
# spec file for package python-basemap
#
# Copyright (c) 2012-2013 Wojciech Kazubski, wk@ire.pw.edu.pl
#
# 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 http://bugs.opensuse.org/
#

%define pyname basemap
%define ver 1.3.6
%define data_version 1.3.2

Name:           python-%{pyname}
Version:        %{ver}
Release:        21.1
Summary:        Plots map projections with boundaries
Group:          Development/Libraries/Python
License:        MIT
Url:            http://matplotlib.sourceforge.net/users/toolkits.html
Source0:        https://github.com/matplotlib/basemap/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1:        shapefile-brazil.tar.bz2
BuildRequires:  %{python_module base}
BuildRequires:  %{python_module Cython}
BuildRequires:  %{python_module matplotlib}
BuildRequires:  %{python_module numpy-devel}
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module pyproj}
BuildRequires:  %{python_module pyshp}
BuildRequires:  %{python_module setuptools}
BuildRequires:  libgeos-devel
BuildRequires:  fdupes
BuildRequires:  blas
BuildRequires:  lapack
BuildRequires:  python-rpm-macros
Requires:       python-matplotlib >= 0.98
Requires:       python-numpy
Requires:       python-imaging
%python_subpackages

%description
Basemap is a matplotlib toolkit that allows you to plot data on map
projections (with continental and political boundaries).

#data and example packages
%package        data
Version:        %{data_version}
Summary:        Data for python-%{pyname}
Group:          Development/Libraries/Python
License:        GPL-2.0 and Public Domain
Requires:       python-%{pyname}, python-%{pyname}-data
BuildArch:      noarch

%description    data
Data sets for python-%{pyname}

%package        data-hires
Version:        %{data_version}
Summary:        High resolution map data for python-%{pyname}
Group:          Development/Libraries/Python
License:        MIT
Requires:       python-%{pyname}, python-%{pyname}-data
BuildArch:      noarch

%description    data-hires
High resolution map data sets for python-%{pyname}

%package -n     python-%{pyname}-examples
Summary:        Example programs and data for python-%{pyname}
Group:          Development/Libraries/Python
License:        LGPL-3.0-or-later
Requires:       python-%{pyname}
BuildArch:      noarch

%description -n python-%{pyname}-examples
Example programs and data sets for python-%{pyname}

%prep
%setup -q -n %{pyname}-%{ver}

pushd packages/basemap_data/src/mpl_toolkits/basemap_data
tar xjvf %{SOURCE1}
popd

%build
#export GEOS_LIB="/usr/"
pushd packages/basemap
%python_build
popd
pushd packages/basemap_data
%python_build
popd
pushd packages/basemap_data_hires
%python_build
popd

%install
pushd packages/basemap
%python_install
popd
pushd packages/basemap_data
%python_install
popd
pushd packages/basemap_data_hires
%python_install
popd

%fdupes %{buildroot}/%{py_sitedir}

%files %{python_files}
%doc CHANGELOG.md FAQ README.md
%license LICENSE
%{python_sitearch}/mpl_toolkits/basemap
%{python_sitearch}/_geoslib.cpython-*-*-linux-gnu.so
%{python_sitearch}/basemap-%{ver}-py%{python_version}-nspkg.pth
%{python_sitearch}/basemap-%{ver}-py%{python_version}.egg-info

%files %{python_files data}
%doc packages/basemap_data/README.md 
%license packages/basemap_data/COPYING packages/basemap_data/COPYING.LESSER
%license packages/basemap_data/LICENSE.epsg packages/basemap_data/LICENSE.mit
%dir %{python_sitelib}/mpl_toolkits
%{python_sitelib}/mpl_toolkits/basemap_data
%exclude %{python_sitelib}/mpl_toolkits/basemap_data/*_f.dat
%exclude %{python_sitelib}/mpl_toolkits/basemap_data/*_h.dat
%{python_sitelib}/basemap_data-%{data_version}-py%{python_version}.egg-info
%{python_sitelib}/basemap_data-%{data_version}-py%{python_version}-nspkg.pth

%files %{python_files data-hires}
%doc packages/basemap_data_hires/README.md 
%license packages/basemap_data_hires/COPYING packages/basemap_data_hires/COPYING.LESSER
%{python_sitelib}/mpl_toolkits/basemap_data/*_f.dat
%{python_sitelib}/mpl_toolkits/basemap_data/*_h.dat
%{python_sitelib}/basemap_data_hires-%{data_version}-py%{python_version}.egg-info
%{python_sitelib}/basemap_data_hires-%{data_version}-py%{python_version}-nspkg.pth

%files -n python-%{pyname}-examples
%doc examples/*

%changelog
openSUSE Build Service is sponsored by