Blob Blame History Raw
%global __python3 /usr/bin/python3.9
%global python3_pkgversion 39

Name:           python39-netaddr-epel
Version:        0.8.0
Release:        1%{?dist}
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

BuildArch:      noarch

%global desc A network address manipulation library for Python\
\
Provides support for:\
\
Layer 3 addresses\
\
 * IPv4 and IPv6 addresses, subnets, masks, prefixes\
 * iterating, slicing, sorting, summarizing and classifying IP networks\
 * dealing with various ranges formats (CIDR, arbitrary ranges and globs, nmap)\
 * set based operations (unions, intersections etc) over IP addresses and\
   subnets\
 * parsing a large variety of different formats and notations\
 * looking up IANA IP block information\
 * generating DNS reverse lookups\
 * supernetting and subnetting\
\
Layer 2 addresses\
\
 * representation and manipulation MAC addresses and EUI-64 identifiers\
 * looking up IEEE organisational information (OUI, IAB)\
 * generating derived IPv6 addresses


%global _description\
%{desc}

%description %_description

%package -n python39-netaddr
Summary: A pure Python network address representation and manipulation library
BuildRequires:  python39-devel
BuildRequires:  python39-rpm-macros
BuildRequires:  python39-setuptools
# No python39-sphinx yet
BuildRequires:  python3-sphinx
BuildRequires:  python39-pytest

%description -n python39-netaddr
%{desc}

%package -n python39-netaddr-shell
Summary: An IPython-based shell environment for the netaddr library
Requires:  python39-netaddr = %{version}-%{release}
Requires:  python39-ipython

%description -n python39-netaddr-shell
An IPython-based shell environment for the netaddr library

%prep
%setup -q -n netaddr-%{version}

# Make rpmlint happy, rip out python shebang lines from most python
# modules
find netaddr -name "*.py" | \
  xargs sed -i -e '1 {/^#!\//d}'

# Make rpmlint happy, fix permissions on documentation files
chmod 0644 README.rst AUTHORS CHANGELOG COPYRIGHT LICENSE PKG-INFO

%build
%py3_build

#docs
pushd docs
PYTHONPATH='../' sphinx-build -b html -d build/doctrees source html
rm -f python3/html/.buildinfo
popd

%install
%py3_install

%check
py.test-%{python3_version}

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

%files -n python39-netaddr-shell
%{_bindir}/netaddr

%changelog
* Tue May 31 2022 Orion Poplawski <orion@nwra.com> - 0.8.0-1
- Build for EPEL8