3 %bcond_without python2 # Python 2.x module
4 %bcond_without python3 # Python 3.x module
7 Summary: Serial port interface module
8 Summary(pl.UTF-8): Moduł interfejsu do portu szeregowego
13 Group: Development/Languages/Python
14 Source0: https://github.com/pyserial/pyserial/archive/v%{version}.tar.gz
15 # Source0-md5: a4712d3a28ebc4d61c87a1c1bb6461c0
16 URL: http://pyserial.wiki.sourceforge.net/pySerial
17 BuildRequires: rpmbuild(macros) >= 1.710
18 BuildRequires: rpm-pythonprov
21 BuildRequires: python-devel
22 BuildRequires: python-modules
26 BuildRequires: python3-2to3
27 BuildRequires: python3-devel
28 BuildRequires: python3-modules
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 This module encapsulates the access for the serial port. It provides
35 backends for Python running on Windows, Linux, BSD (possibly any POSIX
36 compilant system) and Jython. The module named "serial" automatically
37 selects the appropriate backend.
39 %description -l pl.UTF-8
40 Ten moduł opakowuje dostęp do portu szeregowego. Dostarcza backendy
41 dla Pythona działającego na Windows, Linuksie, BSD (być może dowolnym
42 systemie zgodnym z POSIX) oraz Jythona. Moduł o nazwie "serial"
43 automatycznie wybiera właściwy backend.
45 %package -n python3-%{module}
46 Summary: Serial port interface module
47 Group: Libraries/Python
50 %description -n python3-%{module}
51 This module encapsulates the access for the serial port. It provides
52 backends for Python running on Windows, Linux, BSD (possibly any POSIX
53 compilant system) and Jython. The module named "serial" automatically
54 selects the appropriate backend.
57 Summary: Very simple serial terminal
58 Group: Applications/Communications
59 Requires: python%{?with_python3:3}-%{module} = %{version}-%{release}
61 %description -n miniterm
62 Very simple serial terminal written in Python.
65 %setup -q -n pyserial-%{version}
76 rm -rf $RPM_BUILD_ROOT
78 install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
81 cp -p examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
82 find $RPM_BUILD_ROOT%{py_sitescriptdir} -name "*serialjava*" -exec rm {} \;
83 find $RPM_BUILD_ROOT%{py_sitescriptdir} -name "*serialwin*" -exec rm {} \;
87 # Always prefer python3 version
88 %{__rm} -f $RPM_BUILD_ROOT%{_bindir}/miniterm.py
90 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
93 cp -p examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
94 find $RPM_BUILD_ROOT%{py3_sitescriptdir} -name "*serialjava*" -exec rm {} \;
95 find $RPM_BUILD_ROOT%{py3_sitescriptdir} -name "*serialwin*" -exec rm {} \;
99 rm -rf $RPM_BUILD_ROOT
103 %defattr(644,root,root,755)
104 %doc CHANGES.rst LICENSE.txt README.rst
105 %{py_sitescriptdir}/%{module}
106 %{py_sitescriptdir}/*egg-info
107 %{_examplesdir}/python-%{module}-%{version}
111 %files -n python3-%{module}
112 %defattr(644,root,root,755)
113 %doc CHANGES.rst LICENSE.txt README.rst
114 %{py3_sitescriptdir}/%{module}
115 %{py3_sitescriptdir}/*egg-info
116 %{_examplesdir}/python3-%{module}-%{version}
120 %defattr(644,root,root,755)
121 %attr(755,root,root) %{_bindir}/miniterm.py