%global pypi_name ipranges
%global pypi_version 0.1.10
%global __python /usr/bin/python3

%if "x%{?python3_pkgversion}" == "x"
%global python3_pkgversion 3
%endif

Name:           python-%{pypi_name}
Version:        %{pypi_version}
Release:        1%{?dist}
Summary:        Python library for working with IP addressess.

License:        ISC
URL:            https://homeproj.cesnet.cz/git/idea.git
Source0:        https://files.pythonhosted.org/packages/source/i/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch:      noarch
 
BuildRequires:  python%{python3_pkgversion}-devel
BuildRequires:  python%{python3_pkgversion}-setuptools

%description
Python 2 library for working with IPv4 and IPv6 addressess in many notations (sible IP, CIDR, range).

This README file is work in progress, for more information please visit home page at https://idea.cesnet.cz/en/index.

%package -n     python%{python3_pkgversion}-%{pypi_name}
Summary:        %{summary}
%{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}}


%description -n python%{python3_pkgversion}-%{pypi_name}
Python 3 library for working with IPv4 and IPv6 addressess in many notations (sible IP, CIDR, range).

This README file is work in progress, for more information please visit home page at https://idea.cesnet.cz/en/index.


%prep
%setup -n %{pypi_name}-%{version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info

%build
%py3_build

%install
%{__python3} setup.py install --skip-build --single-version-externally-managed --root %{buildroot}

%check
# %{__python3} setup.py test

%files -n python%{python3_pkgversion}-%{pypi_name}
%doc README.rst
%{python3_sitelib}