A new user interface for you!

File python-pyhap.spec of Package python-pyhap

# spec file for package python-pyhap
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# 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 http://bugs.opensuse.org/

%{?!python_module:%define python_module() python3-%{**}}
%bcond_without test
%define skip_python2 1

%define pyname HAP-python

Name:           python-pyhap
Version:        0.1.1
Release:        0
Summary:        Python implementation of HomeKit Accessory Protocol
License:        MIT
Group:          Development/Languages/Python
Url:            https://github.com/ikalchev/HAP-python
Source0:        %{pyname}-%{version}.tar.xz
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module devel >= 3.6}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module packaging}
BuildRequires:  %{python_module pycryptodome}
BuildRequires:  %{python_module tlslite-ng}
BuildRequires:  %{python_module ed25519}
BuildRequires:  %{python_module zeroconf}
BuildRequires:  %{python_module curve25519-donna}
BuildRequires:  %{python_module pyqrcode}
BuildRequires:  %{python_module base36}
BuildRequires:  fdupes

%if %{with test}
BuildRequires:  %{python_module virtualenv >= 14.0.0}
BuildRequires:  %{python_module pytest}
BuildRequires:  %{python_module tox}
BuildArch:      noarch

Requires:       python-pycryptodome
Requires:       python-tlslite-ng
Requires:       python-ed25519
Requires:       python-zeroconf
Requires:       python-curve25519-donna
Requires:       python-pyqrcode
Requires:       python-base36


Python implementation of HomeKit Accessory Protocol.

%setup -q -n %{pyname}-%{version}


%python_expand %fdupes %{buildroot}%{$python_sitelib}

%if %{with test}
%{python_expand virtualenv-%$python_bin_suffix --system-site-packages --no-download testvenv-%$python_bin_suffix
testvenv-%$python_bin_suffix/bin/pip install -e .[test,build]
export PYTHONPATH=$PWD/testvenv-%$python_bin_suffix/lib/python%$python_bin_suffix/site-packages/:$PWD
testvenv-%$python_bin_suffix/bin/python -m pytest && rm -Rf testvenv-%$python_bin_suffix

%files %{python_files}
%license LICENSE
%doc README.md