LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File python-pyhap.spec of Package python-pyhap (Project home:smarty12:testing)

#
# 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

#tests
%if %{with test}
BuildRequires:  %{python_module virtualenv >= 14.0.0}
BuildRequires:  %{python_module pytest}
BuildRequires:  %{python_module tox}
%endif
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_subpackages

%description
Python implementation of HomeKit Accessory Protocol.

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

%build
%python_build

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

%if %{with test}
%check
%{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
}
%endif

%files %{python_files}
%defattr(-,root,root,-)
%license LICENSE
%doc README.md
%{python_sitelib}/*

%changelog