2011-09-06 15:27:11 +00:00
|
|
|
#
|
|
|
|
# spec file for package python-pyserial
|
|
|
|
#
|
2016-05-20 17:13:12 +00:00
|
|
|
# Copyright (c) 2016 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2011-09-06 15:27:11 +00:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
2011-12-12 09:06:02 +00:00
|
|
|
|
2011-09-06 15:27:11 +00:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2011-12-12 09:06:02 +00:00
|
|
|
|
2011-09-06 15:27:11 +00:00
|
|
|
Name: python-pyserial
|
2016-05-20 17:13:12 +00:00
|
|
|
Version: 3.0.1
|
2011-09-06 15:27:11 +00:00
|
|
|
Release: 0
|
2016-05-20 17:13:12 +00:00
|
|
|
Url: https://github.com/pyserial/pyserial
|
2011-09-06 15:27:11 +00:00
|
|
|
Summary: Python Serial Port Extension
|
2011-12-06 17:57:27 +00:00
|
|
|
License: Python-2.0
|
2011-09-06 15:27:11 +00:00
|
|
|
Group: Development/Languages/Python
|
2016-05-20 17:13:12 +00:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/p/pyserial/pyserial-%{version}.tar.gz
|
2011-09-06 15:27:11 +00:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2016-05-20 17:13:12 +00:00
|
|
|
BuildRequires: python
|
2013-05-08 09:07:02 +00:00
|
|
|
BuildRequires: python-devel
|
2016-05-20 17:13:12 +00:00
|
|
|
BuildRequires: python-setuptools
|
|
|
|
BuildRequires: python-Sphinx
|
2013-11-24 21:06:40 +00:00
|
|
|
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
|
|
|
|
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
2016-05-20 17:13:12 +00:00
|
|
|
BuildRequires: python-importlib
|
|
|
|
Requires: python-importlib
|
2013-11-24 21:06:40 +00:00
|
|
|
%else
|
2011-09-06 15:27:11 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
%endif
|
|
|
|
Provides: python-serial = %{version}
|
2013-05-08 09:07:02 +00:00
|
|
|
Obsoletes: python-serial < %{version}
|
2016-05-20 17:13:12 +00:00
|
|
|
Requires(post): update-alternatives
|
|
|
|
Requires(postun): update-alternatives
|
2011-09-06 15:27:11 +00:00
|
|
|
|
|
|
|
%description
|
|
|
|
Python Serial Port Extension for Win32, Linux, BSD, Jython, IronPython
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n pyserial-%{version}
|
2013-05-08 09:07:02 +00:00
|
|
|
sed -i "s|#\!\/usr\/bin\/env python||" serial/{serialposix,__init__}.py # Fix non-executable scripts
|
2011-09-06 15:27:11 +00:00
|
|
|
sed -i "s/\r//" examples/port_publisher.py # Fix EOL encoding
|
|
|
|
|
|
|
|
%build
|
|
|
|
python setup.py build
|
|
|
|
make -C documentation html && rm documentation/_build/html/.buildinfo # Build HTML documentation
|
|
|
|
|
|
|
|
%install
|
|
|
|
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
|
|
|
|
|
2016-05-20 17:13:12 +00:00
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
|
|
|
|
mv %{buildroot}%{_bindir}/miniterm.py %{buildroot}%{_bindir}/miniterm-%{py_ver}
|
|
|
|
ln -s -f %{_sysconfdir}/alternatives/miniterm %{buildroot}%{_bindir}/miniterm
|
|
|
|
# create a dummy target for /etc/alternatives/miniterm
|
|
|
|
touch %{buildroot}%{_sysconfdir}/alternatives/miniterm
|
|
|
|
|
|
|
|
%post
|
|
|
|
"%_sbindir/update-alternatives" \
|
|
|
|
--install %{_bindir}/miniterm miniterm %{_bindir}/miniterm-%{py_ver} 30
|
|
|
|
|
|
|
|
%postun
|
|
|
|
if [ $1 -eq 0 ] ; then
|
|
|
|
"%_sbindir/update-alternatives" --remove miniterm %{_bindir}/miniterm-%{py_ver}
|
|
|
|
fi
|
|
|
|
|
2011-09-06 15:27:11 +00:00
|
|
|
%files
|
|
|
|
%defattr(-,root,root,-)
|
2016-05-20 17:13:12 +00:00
|
|
|
%doc CHANGES.rst LICENSE.txt README.rst examples documentation/_build/*
|
|
|
|
%{_bindir}/miniterm
|
|
|
|
%{_bindir}/miniterm-%{py_ver}
|
|
|
|
%ghost %{_sysconfdir}/alternatives/miniterm
|
2013-05-08 09:07:02 +00:00
|
|
|
%{python_sitelib}/serial/
|
2016-05-20 17:13:12 +00:00
|
|
|
%{python_sitelib}/pyserial-%{version}-py*.egg-info
|
2011-09-06 15:27:11 +00:00
|
|
|
|
|
|
|
%changelog
|