Name:          pyspinel
Version:       1.0.3
Release:       1%{?dist}
Summary:       Python CLI to configure and manage OpenThread NCPs and RCPs
License:       Apache-2.0
URL:           https://github.com/pyspinel/pyspinel
Source0:       %url/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz

BuildArch:     noarch
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-wheel
BuildRequires: python3-pyserial

%description
Pyspinel is a Python CLI for the Spinel protocol, used to configure and manage
OpenThread NCPs or RCPs. This CLI is primarily targeted to CI tests, but can
be used manually to experiment with and test OpenThread Co-Processor instances.

Pyspinel is used to:

    Add simulated Co-Processor testing to continuous integration.
    Automate testing of testbeds running Co-Processor firmware on hardware.
    Debug Co-Processor builds of OpenThread.
    Convert an OpenThread Co-Processor into a packet sniffer.

%package -n python3-%{name}
Summary:  Python CLI to configure and manage OpenThread NCPs and RCPs
Requires: python3-ipaddress
Requires: python3-pyserial

%description -n python3-%{name}
Pyspinel is a Python CLI for the Spinel protocol, used to configure and manage
OpenThread NCPs or RCPs. This CLI is primarily targeted to CI tests, but can
be used manually to experiment with and test OpenThread Co-Processor instances.

Pyspinel is used to:

    Add simulated Co-Processor testing to continuous integration.
    Automate testing of testbeds running Co-Processor firmware on hardware.
    Debug Co-Processor builds of OpenThread.
    Convert an OpenThread Co-Processor into a packet sniffer.


%prep
%autosetup -p1

%build
%py3_build

%install
%py3_install
rm -rf %{buildroot}%{python3_sitelib}/vendor

%files -n python3-%{name}
%license LICENSE
%doc README.md
%{_bindir}/extcap_ot.*
%{_bindir}/sniffer.py
%{_bindir}/spinel-cli.py
%{python3_sitelib}/spinel/
%{python3_sitelib}/pyspinel-*/

%changelog
* Sun Oct 27 2024 Peter Robinson <pbrobinson@fedoraproject.org> - 1.0.3-1
- Initial build