File python-aioesphomeapi.spec of Package python-aioesphomeapi

#
# spec file for package python-acme
#
# Copyright (c) 2020 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define libname aioesphomeapi
Name:           python-%{libname}
Version:        39.0.0
Release:        0
Summary:        ESPHome support for python
License:        MIT
URL:            https://github.com/esphome/aioesphomeapi
Source:         https://pypi.python.org/packages/source/a/%libname/%{libname}-%{version}.tar.gz
BuildRequires:  %{python_module pytest-runner}
BuildRequires:  %{python_module pip}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
BuildArch:      noarch
Requires(post): update-alternatives
Requires(postun): update-alternatives
Requires:       python-aiohappyeyeballs >= 2.3.0
Requires:       python-protobuf >= 3.19.0
Requires:       python-zeroconf >= 0.128.4
Requires:       python-chacha20poly1305-reuseable >= 0.12.0
Requires:       python-noiseprotocol >= 0.3.1
Requires:       python-async-timeout >= 4.0

%python_subpackages

%description
allows you to interact with devices flashed with ESPHome https://esphome.io/

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

%build
%python_build

%install
%python_install
# remove duplicates
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%python_clone -a %{buildroot}%{_bindir}/aioesphomeapi-discover
%python_clone -a %{buildroot}%{_bindir}/aioesphomeapi-logs

%post
%python_install_alternative aioesphomeapi-discover
%python_install_alternative aioesphomeapi-logs

%postun
%python_uninstall_alternative aioesphomeapi-discover
%python_uninstall_alternative aioesphomeapi-logs

%files %{python_files}
%license LICENSE
%doc README.rst
%python_alternative %{_bindir}/aioesphomeapi-discover
%python_alternative %{_bindir}/aioesphomeapi-logs
%{python_sitelib}/%{libname}
%{python_sitelib}/%{libname}-%{version}*.egg-info
%pycache_only %{python_sitelib}/%{libname}/__pycache__

%changelog
openSUSE Build Service is sponsored by