]> git.pld-linux.org Git - packages/python-serial.git/blob - python-serial.spec
afdcd8a3239cd4a9f58f7ce4044806de6de36c77
[packages/python-serial.git] / python-serial.spec
1 #
2 # Conditional build:
3 %bcond_without  python2         # Python 2.x module
4 %bcond_without  python3         # Python 3.x module
5
6 %define         module  serial
7 Summary:        Serial port interface module
8 Summary(pl.UTF-8):      Moduł interfejsu do portu szeregowego
9 Name:           python-serial
10 Version:        3.2.1
11 Release:        3
12 License:        GPL
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
19 BuildRequires:  unzip
20 %if %{with python2}
21 BuildRequires:  python-devel
22 BuildRequires:  python-modules
23 Requires:       python
24 %endif
25 %if %{with python3}
26 BuildRequires:  python3-2to3
27 BuildRequires:  python3-devel
28 BuildRequires:  python3-modules
29 %endif
30 BuildArch:      noarch
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %description
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.
38
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.
44
45 %package -n     python3-%{module}
46 Summary:        Serial port interface module
47 Group:          Libraries/Python
48 Requires:       python3
49
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.
55
56 %package -n miniterm
57 Summary:        Very simple serial terminal
58 Group:          Applications/Communications
59 Requires:       python%{?with_python3:3}-%{module} = %{version}-%{release}
60
61 %description -n miniterm
62 Very simple serial terminal written in Python.
63
64 %prep
65 %setup  -q -n pyserial-%{version}
66
67 %build
68 %if %{with python2}
69 %py_build
70 %endif
71 %if %{with python3}
72 %py3_build
73 %endif
74
75 %install
76 rm -rf $RPM_BUILD_ROOT
77 %if %{with python2}
78 install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
79 %py_install
80
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 {} \;
84 %endif
85
86 %if %{with python3}
87 # Always prefer python3 version
88 %{__rm} -f $RPM_BUILD_ROOT%{_bindir}/miniterm.py
89
90 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
91 %py3_install
92
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 {} \;
96 %endif
97
98 %clean
99 rm -rf $RPM_BUILD_ROOT
100
101 %if %{with python2}
102 %files
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}
108 %endif
109
110 %if %{with python3}
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}
117 %endif
118
119 %files -n miniterm
120 %defattr(644,root,root,755)
121 %attr(755,root,root) %{_bindir}/miniterm.py
This page took 0.105575 seconds and 2 git commands to generate.