forked from pool/python-pyserial
Accepting request 514816 from home:TheBlackCat:branches:devel:languages:python
- Update to version 3.4 - Fix shebangs OBS-URL: https://build.opensuse.org/request/show/514816 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyserial?expand=0&rev=21
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
Name: python-pyserial
|
||||
Version: 3.3
|
||||
Version: 3.4
|
||||
Release: 0
|
||||
Url: https://github.com/pyserial/pyserial
|
||||
Summary: Python Serial Port Extension
|
||||
@@ -55,20 +55,41 @@ Documentation, examples, and help files for %{name}.
|
||||
%setup -q -n pyserial-%{version}
|
||||
sed -i "s|#\!\/usr\/bin\/env python||" serial/{serialposix,__init__}.py # Fix non-executable scripts
|
||||
sed -i "s/\r//" examples/port_publisher.py # Fix EOL encoding
|
||||
find examples -name '*.py' -exec sed -i "s|#!/usr/bin/env python|#!%__python3|" {} \;
|
||||
find examples -name '*.py' -exec sed -i "s|#! /usr/bin/env python|#!%__python3|" {} \;
|
||||
find examples -name '*.py' -exec sed -i "s|#! python|#!%__python3|" {} \;
|
||||
|
||||
%build
|
||||
%python_build
|
||||
make -C documentation html && rm documentation/_build/html/.buildinfo # Build HTML documentation
|
||||
|
||||
|
||||
%install
|
||||
%python_install
|
||||
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
|
||||
mv %{buildroot}%{_bindir}/miniterm.py %{buildroot}%{_bindir}/miniterm
|
||||
%python_clone -a %{buildroot}%{_bindir}/miniterm
|
||||
rm documentation/_build/doctrees/environment.pickle
|
||||
|
||||
%{python_expand pushd %{buildroot}%{$python_sitelib}
|
||||
# Fix wrong-script-interpreter
|
||||
sed -i "s|#!/usr/bin/env python|#!%__$python|" serial/tools/*.py
|
||||
sed -i "s|#!/usr/bin/env python|#!%__$python|" serial/threaded/__init__.py
|
||||
sed -i "s|#!/usr/bin/env python|#!%__$python|" serial/rs485.py
|
||||
sed -i "s|#! python||#!%__$python|" serial/tools/*.py
|
||||
chmod a+x serial/tools/*.py
|
||||
chmod a-x serial/tools/__init__.py
|
||||
chmod a-x serial/tools/list_ports_windows.py
|
||||
chmod a-x serial/tools/hexlify_codec.py
|
||||
chmod a+x serial/threaded/__init__.py
|
||||
chmod a+x serial/rs485.py
|
||||
# Deduplicating files can generate a RPMLINT warning for pyc mtime
|
||||
$python -m compileall -d %{$python_sitelib} serial/
|
||||
$python -O -m compileall -d %{$python_sitelib} serial/
|
||||
%fdupes .
|
||||
popd
|
||||
}
|
||||
|
||||
%post
|
||||
%python_install_alternative miniterm
|
||||
|
||||
|
Reference in New Issue
Block a user