%global srcname trezor
%global sum Python library for communicating with TREZOR Hardware Wallet
%global bashcompdir %(pkg-config --variable=completionsdir bash-completion 2>/dev/null)
%global bashcomproot %(dirname %{bashcompdir} 2>/dev/null)
Name: python-%{srcname}
Version: 0.7.15
Release: 3%{?dist}
Summary: %{sum}
# trezorlib/protobuf_json.py is BSD the rest is LGPLv3
License: LGPLv3 and BSD
URL: https://github.com/trezor/python-trezor
Source0: https://files.pythonhosted.org/packages/source/t/%{srcname}/%{srcname}-%{version}.tar.gz
Source1: 51-trezor.rules
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python2-pbkdf2
BuildRequires: python2-hidapi >= 0.7.99.post20
BuildRequires: python2-mnemonic >= 0.17
BuildRequires: python2-ecdsa
BuildRequires: python2-requests
BuildRequires: protobuf-python
BuildRequires: pkgconfig(bash-completion)
BuildRequires: systemd
%description
Python library for communicating with TREZOR Hardware Wallet
See https://trezor.io for more information.
%package -n python2-%{srcname}
Summary: %{sum}
Requires: python2-pbkdf2
Requires: python2-hidapi >= 0.7.99.post20
Requires: python2-mnemonic >= 0.17
Requires: python2-ecdsa
Requires: python2-requests
# https://github.com/trezor/python-trezor/issues/86
Provides: bundled(python-protobuf-json) = 0.0.6
%{?python_provide:%python_provide python2-%{srcname}}
%description -n python2-%{srcname}
Python library for communicating with TREZOR Hardware Wallet
See https://trezor.io for more information.
%prep
%autosetup -n %{srcname}-%{version}
rm -rf %{srcname}.egg-info
%build
%py2_build
%install
%py2_install
install -Dpm 644 bash_completion.d/trezorctl.sh %{buildroot}%{bashcompdir}/trezorctl
install -Dpm 644 %{SOURCE1} %{buildroot}%{_udevrulesdir}/51-trezor.rules
%check
%{__python2} setup.py test
%files -n python2-%{srcname}
%doc PKG-INFO
%doc README.rst
%license COPYING
%{python2_sitelib}/*
%{_bindir}/trezorctl
%{bashcomproot}
%{_udevrulesdir}/51-trezor.rules
%changelog
* Mon Jun 19 2017 Jonny Heggheim <hegjon@gmail.com> - 0.7.15-3
- Added missing python2-requests requires
* Mon Jun 19 2017 Jonny Heggheim <hegjon@gmail.com> - 0.7.15-2
- Included correct requires for python2-trezor
* Mon Jun 19 2017 Jonny Heggheim <hegjon@gmail.com> - 0.7.15-1
- new version
* Wed May 03 2017 Jonny Heggheim <hegjon@gmail.com> - 0.7.13-1
- new version
* Tue Apr 11 2017 Jonny Heggheim <hegjon@gmail.com> - 0.7.12-1
- new version
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.8-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Tue Jan 24 2017 Jonny Heggheim <hegjon@gmail.com> - 0.7.8-2
- Include udev-rules
* Sun Nov 27 2016 Jonny Heggheim <hegjon@gmail.com> - 0.7.8-1
- new version
* Fri Nov 25 2016 Jonny Heggheim <hegjon@gmail.com> - 0.7.7-2
- added bundled(python-protobuf-json)
- included BSD in the license
* Thu Nov 24 2016 Jonny Heggheim <hegjon@gmail.com> - 0.7.7-1
- new version
* Thu Nov 17 2016 Jonny Heggheim <hegjon@gmail.com> - 0.7.6-1
- initial package