Name:           python-netaddr
Version:        0.8.0
Release:        3
Summary:        A pure Python network address representation and manipulation library

License:        BSD
URL:            http://github.com/drkjam/netaddr
Source0:        https://pypi.python.org/packages/source/n/netaddr/netaddr-%{version}.tar.gz

Patch9000:	elimate-ROC-in-python-netaddr.patch
Patch9001:	disable-test-oui-information.patch

BuildArch:      noarch
BuildRequires:  python3-devel python3-setuptools python3-sphinx python3-pytest

%description
A network address manipulation library for Python
Provides support for:
Layer 3 addresses
 * dealing with various ranges formats (CIDR, arbitrary ranges and globs, nmap)
 * parsing a large variety of different formats and notations
Layer 2 addresses
 * generating derived IPv6 addresses

%package -n python3-netaddr
Summary: A pure Python network address representation and manipulation library
%{?python_provide:%python_provide python3-netaddr}

%description -n python3-netaddr
Based on Python3 network address representation and operation library Package

%prep
%autosetup -n netaddr-%{version} -p1

sed -i 's/\r//' netaddr/*.py netaddr/ip/*.py netaddr/eui/*.idx
find netaddr -name "*.py" | xargs sed -i -e '1 {/^#!\//d}'

%build
%py3_build

#docs
cd docs
PYTHONPATH='../' sphinx-build-%{python3_version} -b html -d build/doctrees source html
PYTHONPATH='../' sphinx-build-%{python3_version} -b html -d build/doctrees source python3/html

%install
%py3_install

%check
py.test-%{python3_version}

%files -n python3-netaddr
%license COPYRIGHT
%doc AUTHORS CHANGELOG README.rst docs/python3/html
%{python3_sitelib}/*
%{_bindir}/netaddr

%changelog
* Sat Mar 26 2022 hanhui <hanhui15@h-partners.com> - 0.8.0-3
- enable testcase

* Mon Jan 17 2022 xingxing <xingxing9@huawei.com> - 0.8.0-2
- delete more sensitive keyword

* Thu Jul 15 2021 huangtianhua <huangtianhua@huawei.com> - 0.8.0-1
- Upgrade to 0.8.0 to support OpenStack-W

* Mon Aug 10 2020 lingsheng<lingsheng@huawei.com> - 0.7.19-15
- Remove python2-netaddr subpackage

* Fri Feb 14 2020 gulining<gulining1@huawei.com> - 0.7.19-14
- Package init
