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
|
Name: python-pyserial
|
||||||
Version: 3.4
|
Version: 3.4
|
||||||
Release: 0
|
Release: 0
|
||||||
Url: https://github.com/pyserial/pyserial
|
|
||||||
Summary: Python Serial Port Extension
|
Summary: Python Serial Port Extension
|
||||||
License: Python-2.0
|
License: Python-2.0
|
||||||
Group: Development/Languages/Python
|
Group: Development/Languages/Python
|
||||||
|
URL: https://github.com/pyserial/pyserial
|
||||||
Source: https://files.pythonhosted.org/packages/source/p/pyserial/pyserial-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/p/pyserial/pyserial-%{version}.tar.gz
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
BuildRequires: python3-Sphinx
|
BuildRequires: python3-Sphinx
|
||||||
BuildArch: noarch
|
|
||||||
Provides: python-serial = %{version}
|
|
||||||
Obsoletes: python-serial < %{version}
|
|
||||||
Requires(post): update-alternatives
|
Requires(post): update-alternatives
|
||||||
Requires(preun): update-alternatives
|
Requires(preun): update-alternatives
|
||||||
|
Provides: python-serial = %{version}
|
||||||
|
Obsoletes: python-serial < %{version}
|
||||||
|
BuildArch: noarch
|
||||||
%python_subpackages
|
%python_subpackages
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@@ -54,13 +52,13 @@ Documentation, examples, and help files for %{name}.
|
|||||||
%setup -q -n pyserial-%{version}
|
%setup -q -n pyserial-%{version}
|
||||||
sed -i "s|^#\!\/usr\/bin\/env python$||" serial/{serialposix,__init__}.py # Fix non-executable scripts
|
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
|
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|^#!%{_bindir}/env python$|#!python3|" {} \;
|
||||||
find examples -name '*.py' -exec sed -i "s|^#! /usr/bin/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}|" {} \;
|
find examples -name '*.py' -exec sed -i "s|^#! python$|#!python3|" {} \;
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%python_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
|
%install
|
||||||
%python_install
|
%python_install
|
||||||
@@ -71,9 +69,9 @@ rm documentation/_build/doctrees/environment.pickle
|
|||||||
|
|
||||||
%{python_expand pushd %{buildroot}%{$python_sitelib}
|
%{python_expand pushd %{buildroot}%{$python_sitelib}
|
||||||
# Fix wrong-script-interpreter
|
# Fix wrong-script-interpreter
|
||||||
sed -i "s|^#!/usr/bin/env python$|#!%{__$python}|" serial/tools/*.py
|
sed -i "s|^#!%{_bindir}/env python$|#!%{__$python}|" serial/tools/*.py
|
||||||
sed -i "s|^#!/usr/bin/env python3$|#!%{__$python}|" serial/threaded/__init__.py
|
sed -i "s|^#!%{_bindir}/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/rs485.py
|
||||||
sed -i "s|^#! python$||#!%{__$python}|" serial/tools/*.py
|
sed -i "s|^#! python$||#!%{__$python}|" serial/tools/*.py
|
||||||
chmod a+x serial/tools/*.py
|
chmod a+x serial/tools/*.py
|
||||||
chmod a-x serial/tools/__init__.py
|
chmod a-x serial/tools/__init__.py
|
||||||
@@ -95,14 +93,13 @@ popd
|
|||||||
%python_uninstall_alternative miniterm
|
%python_uninstall_alternative miniterm
|
||||||
|
|
||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%defattr(-,root,root,-)
|
%license LICENSE.txt
|
||||||
%doc CHANGES.rst LICENSE.txt README.rst
|
%doc CHANGES.rst README.rst
|
||||||
%python_alternative miniterm
|
%python_alternative miniterm
|
||||||
%{python_sitelib}/serial/
|
%{python_sitelib}/serial/
|
||||||
%{python_sitelib}/pyserial-%{version}-py*.egg-info
|
%{python_sitelib}/pyserial-%{version}-py*.egg-info
|
||||||
|
|
||||||
%files -n %{name}-doc
|
%files -n %{name}-doc
|
||||||
%defattr(-,root,root,-)
|
|
||||||
%doc examples/
|
%doc examples/
|
||||||
%doc documentation/_build/*
|
%doc documentation/_build/*
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user