%global srcname pyserial Name: python3-%{srcname} Version: 3.4 Release: 12%{?dist} Summary: Python serial port access library License: BSD URL: https://github.com/%{srcname}/%{srcname} Source0: https://github.com/%{srcname}/%{srcname}/archive/v%{version}/%{srcname}-%{version}.tar.gz BuildArch: noarch %description This module encapsulates the access for the serial port. It provides backends for standard Python running on Windows, Linux, BSD (possibly any POSIX compliant system) and Jython. The module named "serial" automatically selects the appropriate backend. %package doc Summary: Documentation for %{name} BuildRequires: make BuildRequires: %{_bindir}/sphinx-build %description doc HTML documentation and examples for %{name} %package -n python%{python3_pkgversion}-%{srcname} Summary: %{summary} BuildRequires: python%{python3_pkgversion}-devel %{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} %description -n python%{python3_pkgversion}-%{srcname} This module encapsulates the access for the serial port. It provides backends for standard Python running on Windows, Linux, BSD (possibly any POSIX compliant system) and Jython. The module named "serial" automatically selects the appropriate backend. %prep %autosetup -p1 -n %{srcname}-%{version} # Resolve shebang in examples find examples -name '*.py' -type f | xargs sed -i '1{s|^#! \?/usr/bin/\(env \)\?python[0-9]\?|#!%{__python3}|}' %build %py3_build # Remove shebang from files in the library find build/lib -name '*.py' -type f | xargs sed -i '1{s|^#! \?/usr/bin/\(env \)\?python[0-9]\?||}' # Add version-specific variants of the scripts mv build/scripts-%{python3_version}/miniterm.py build/scripts-%{python3_version}/miniterm-%{python3_version}.py ln -s miniterm-%{python3_version}.py build/scripts-%{python3_version}/miniterm-3.py ln -s miniterm-%{python3_version}.py build/scripts-%{python3_version}/miniterm.py %make_build -C documentation html SPHINXBUILD=%{_bindir}/sphinx-build rm documentation/_build/html/.buildinfo %install %py3_install %check %{__python3} test/run_all_tests.py loop:// %files doc %license LICENSE.txt %doc documentation/_build/html examples %files -n python%{python3_pkgversion}-%{srcname} %license LICENSE.txt %doc CHANGES.rst README.rst %{_bindir}/miniterm.py %{_bindir}/miniterm-3.py %{_bindir}/miniterm-%{python3_version}.py %{python3_sitelib}/serial/ %{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info/ %changelog * Sun Mar 14 2021 Scott K Logan - 3.4-12 - Initial package