forked from pool/python-pyserial
Clean up the SPEC file
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyserial?expand=0&rev=25
This commit is contained in:
@@ -20,22 +20,20 @@
|
||||
Name: python-pyserial
|
||||
Version: 3.4
|
||||
Release: 0
|
||||
Url: https://github.com/pyserial/pyserial
|
||||
Summary: Python Serial Port Extension
|
||||
License: Python-2.0
|
||||
Group: Development/Languages/Python
|
||||
URL: https://github.com/pyserial/pyserial
|
||||
Source: https://files.pythonhosted.org/packages/source/p/pyserial/pyserial-%{version}.tar.gz
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
BuildRequires: python3-Sphinx
|
||||
BuildArch: noarch
|
||||
Provides: python-serial = %{version}
|
||||
Obsoletes: python-serial < %{version}
|
||||
Requires(post): update-alternatives
|
||||
Requires(preun): update-alternatives
|
||||
|
||||
Provides: python-serial = %{version}
|
||||
Obsoletes: python-serial < %{version}
|
||||
BuildArch: noarch
|
||||
%python_subpackages
|
||||
|
||||
%description
|
||||
@@ -54,13 +52,13 @@ 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}|" {} \;
|
||||
find examples -name '*.py' -exec sed -i "s|^#!%{_bindir}/env python$|#!python3|" {} \;
|
||||
find examples -name '*.py' -exec sed -i "s|^#! %{_bindir}/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
|
||||
make %{?_smp_mflags} -C documentation html && rm documentation/_build/html/.buildinfo # Build HTML documentation
|
||||
|
||||
%install
|
||||
%python_install
|
||||
@@ -71,9 +69,9 @@ 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 python3$|#!%{__$python}|" serial/threaded/__init__.py
|
||||
sed -i "s|^#!/usr/bin/env python$|#!%{__$python}|" serial/rs485.py
|
||||
sed -i "s|^#!%{_bindir}/env python$|#!%{__$python}|" serial/tools/*.py
|
||||
sed -i "s|^#!%{_bindir}/env python3$|#!%{__$python}|" serial/threaded/__init__.py
|
||||
sed -i "s|^#!%{_bindir}/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
|
||||
@@ -95,14 +93,13 @@ popd
|
||||
%python_uninstall_alternative miniterm
|
||||
|
||||
%files %{python_files}
|
||||
%defattr(-,root,root,-)
|
||||
%doc CHANGES.rst LICENSE.txt README.rst
|
||||
%license LICENSE.txt
|
||||
%doc CHANGES.rst README.rst
|
||||
%python_alternative miniterm
|
||||
%{python_sitelib}/serial/
|
||||
%{python_sitelib}/pyserial-%{version}-py*.egg-info
|
||||
|
||||
%files -n %{name}-doc
|
||||
%defattr(-,root,root,-)
|
||||
%doc examples/
|
||||
%doc documentation/_build/*
|
||||
|
||||
|
Reference in New Issue
Block a user