Blob Blame History Raw
Name:           esptool
Version:        1.3
Release:        1%{?dist}
Summary:        A utility to communicate with the ROM bootloader in Espressif ESP8266

License:        GPLv2+
URL:            https://github.com/themadinventor/%{name}
Source0:        https://files.pythonhosted.org/packages/source/e/%{name}/%{name}-%{version}.tar.gz
BuildArch:      noarch

BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-flake8
Requires:       python3-pyserial
Provides:       %{name}.py = %{version}-%{release}

%description
%{name}.py A command line utility to communicate with the ROM bootloader in
Espressif ESP8266 WiFi microcontroller. Allows flashing firmware, reading back
firmware, querying chip parameters, etc. Developed by the community, not by
Espressif Systems.


%prep
%autosetup
sed -i 's|#!/usr/bin/env python|#!%{__python3}|' %{name}.py
sed -i 2d %{name}.py

%build
%py3_build

# Shebang in site-packages
sed -i 1d build/lib/%{name}.py

%install
%py3_install
ln -s ./%{name}.py %{buildroot}%{_bindir}/%{name}


%files
%license LICENSE
%doc README.md
%{_bindir}/%{name}
%{_bindir}/%{name}.py
%{python3_sitelib}/%{name}.py*
%{python3_sitelib}/%{name}-%{version}-py?.?.egg-info
%{python3_sitelib}/__pycache__/%{name}.*.pyc

%changelog
* Tue Jan 10 2017 Miro Hrončok <mhroncok@redhat.com> - 1.3-1
- New version (#1392643)
- Use Python 3

* Tue Sep 06 2016 Miro Hrončok <mhroncok@redhat.com> - 1.1-1
- Initial package.