50e610
%if 0%{?rhel} > 7
50e610
# Disable python2 build by default
50e610
%bcond_with python2
50e610
%else
50e610
%bcond_without python2
50e610
%endif
50e610
50e610
Summary: Python serial port access library
50e610
Name: pyserial
50e610
Version: 3.1.1
50e610
Release: 8%{?dist}
50e610
Source0: http://easynews.dl.sourceforge.net/sourceforge/%{name}/%{name}-%{version}.tar.gz
50e610
License: Python
50e610
Group: Development/Libraries
50e610
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
50e610
URL: http://pyserial.sourceforge.net
50e610
50e610
%if %{with python2}
50e610
BuildRequires: python2-devel
50e610
%endif
50e610
50e610
BuildRequires: python3-devel
50e610
BuildArch: noarch
50e610
50e610
%global _description\
50e610
This module encapsulates the access for the serial port. It provides backends\
50e610
for standard Python running on Windows, Linux, BSD (possibly any POSIX\
50e610
compilant system) and Jython. The module named "serial" automaticaly selects\
50e610
the appropriate backend.
50e610
50e610
%description %_description
50e610
50e610
%if %{with python2}
50e610
%package -n python2-pyserial
50e610
Summary: %summary
50e610
%{?python_provide:%python_provide python2-pyserial}
50e610
# Remove before F30
50e610
Provides: pyserial%{?_isa} = %{version}-%{release}
50e610
Obsoletes: pyserial < %{version}-%{release}
50e610
50e610
%description -n python2-pyserial %_description
50e610
%endif
50e610
50e610
%package -n python3-pyserial
50e610
Summary: Python serial port access library
50e610
50e610
%description -n python3-pyserial
50e610
This module encapsulates the access for the serial port. It provides backends
50e610
for standard Python running on Windows, Linux, BSD (possibly any POSIX
50e610
compilant system) and Jython. The module named "serial" automaticaly selects
50e610
the appropriate backend.
50e610
50e610
50e610
%prep
50e610
export UNZIP="-aa"
50e610
%setup -q
50e610
rm -rf %{py3dir}
50e610
cp -a . %{py3dir}
50e610
50e610
%build
50e610
%if %{with python2}
50e610
CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build
50e610
%endif
50e610
pushd %{py3dir}
50e610
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
50e610
popd
50e610
50e610
%install
50e610
rm -rf $RPM_BUILD_ROOT
50e610
pushd %{py3dir}
50e610
%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
50e610
mv %{buildroot}/%{_bindir}/miniterm.py %{buildroot}/%{_bindir}/miniterm-3.py
50e610
ln -sf %{_bindir}/miniterm.py-3 %{buildroot}/%{_bindir}/miniterm-%{python3_version}.py
50e610
50e610
popd
50e610
%if %{with python2}
50e610
%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
50e610
cp %{buildroot}/%{_bindir}/miniterm.py %{buildroot}/%{_bindir}/miniterm-2.py
50e610
ln -sf %{_bindir}/miniterm.py-2 %{buildroot}/%{_bindir}/miniterm-%{python2_version}.py
50e610
%endif
50e610
50e610
%clean
50e610
rm -rf $RPM_BUILD_ROOT
50e610
50e610
%if %{with python2}
50e610
%files -n python2-pyserial
50e610
%defattr(-,root,root)
50e610
%doc LICENSE.txt CHANGES.rst README.rst examples
50e610
%{python_sitelib}/*
50e610
%{_bindir}/miniterm.py
50e610
%{_bindir}/miniterm-2.py
50e610
%{_bindir}/miniterm-%{python2_version}.py
50e610
%endif
50e610
50e610
%files -n python3-pyserial
50e610
%doc LICENSE.txt CHANGES.rst README.rst examples
50e610
%{python3_sitelib}/*
50e610
%{_bindir}/miniterm-3.py
50e610
%{_bindir}/miniterm-%{python3_version}.py
50e610
50e610
%changelog
50e610
* Fri Jun 15 2018 Lumir Balhar <lbalhar@redhat.com> - 3.1.1-8
50e610
- Conditions for Python 2 subpackage
50e610
- Python 2 subpackage disabled by default
50e610
50e610
* Wed Feb 14 2018 Iryna Shcherbina <ishcherb@redhat.com> - 3.1.1-7
50e610
- Update Python 2 dependency declarations to new packaging standards
50e610
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
50e610
50e610
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.1-6
50e610
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
50e610
50e610
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 3.1.1-5
50e610
- Python 2 binary package renamed to python2-pyserial
50e610
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
50e610
50e610
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.1-4
50e610
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
50e610
50e610
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.1-3
50e610
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
50e610
50e610
* Fri Dec 09 2016 Charalampos Stratakis <cstratak@redhat.com> - 3.1.1-2
50e610
- Rebuild for Python 3.6
50e610
50e610
* Mon Aug 1 2016 Paul Komkoff <i@stingr.net> 3.1.1-1
50e610
- new upstream version
50e610
50e610
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7-6
50e610
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
50e610
50e610
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.7-5
50e610
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
50e610
50e610
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7-4
50e610
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
50e610
50e610
* Mon Nov 02 2015 Michal Cyprian <mcyprian@redhat.com> - 2.7-3
50e610
- Resolve python3 dependency problem, make miniterm.py python2 script, add
50e610
  python3 version of the script
50e610
50e610
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7-2
50e610
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
50e610
50e610
* Sun Mar 08 2015 Paul Komkoff <i@stingr.net> 2.7-1
50e610
- new upstream version
50e610
50e610
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6-9
50e610
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
50e610
50e610
* Tue May 27 2014 Kalev Lember <kalevlember@gmail.com> - 2.6-8
50e610
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
50e610
50e610
* Sat Sep 07 2013 Till Maas <opensource@till.name> - 2.6-7
50e610
- Add python3 package
50e610
50e610
* Sat Sep 07 2013 Paul P. Komkoff <i@stingr.net> - 2.6-6
50e610
- patched to allow arbitrary speeds bz#982368
50e610
50e610
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6-5
50e610
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
50e610
50e610
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6-4
50e610
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
50e610
50e610
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6-3
50e610
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
50e610
50e610
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6-2
50e610
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
50e610
50e610
* Mon Nov 28 2011 Paul P. Komkoff Jr <i@stingr.net> - 2.6-1
50e610
- new upstream version.
50e610
50e610
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5-2
50e610
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
50e610
50e610
* Fri Nov 19 2010 Paul P. Komkoff Jr <i@stingr.net> - 2.5-1
50e610
- new upstream version
50e610
50e610
* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 2.4-2
50e610
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
50e610
50e610
* Sun Oct 18 2009 Paul P Komkoff Jr <i@stingr.net> - 2.4-1
50e610
- new upstream version
50e610
50e610
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2-9
50e610
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
50e610
50e610
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2-8
50e610
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
50e610
50e610
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 2.2-7
50e610
- Rebuild for Python 2.6
50e610
50e610
* Fri Aug 29 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 2.2-6
50e610
- fix license tag
50e610
50e610
* Tue Dec 12 2006 Paul P. Komkoff Jr <i@stingr.net>
50e610
- rebuilt
50e610
50e610
* Mon Nov  6 2006 Paul P Komkoff Jr <i@stingr.net> - 2.2-4
50e610
- remove "export libdirname"
50e610
50e610
* Tue Oct 24 2006 Paul P Komkoff Jr <i@stingr.net> - 2.2-3
50e610
- Minor specfile fixes
50e610
50e610
* Sat Oct 14 2006 Paul P Komkoff Jr <i@stingr.net> - 2.2-2
50e610
- Minor specfile fixes
50e610
50e610
* Tue May  9 2006 Paul P Komkoff Jr <i@stingr.net> - 2.2-1
50e610
- Fedora Extras submission