]> git.pld-linux.org Git - packages/python-serial.git/blob - python-serial.spec
4f10259c475c4d21e7ce576ba6da653a13956f9f
[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:        2.7
11 Release:        5
12 License:        GPL
13 Group:          Development/Languages/Python
14 Source0:        http://pypi.python.org/packages/source/p/pyserial/pyserial-%{version}.tar.gz
15 # Source0-md5:  794506184df83ef2290de0d18803dd11
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 --build-base py2
70 %endif
71 %if %{with python3}
72 %py3_build --build-base py3
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_build \
80         --build-base py2 \
81         install \
82         --optimize 2 \
83         --root=$RPM_BUILD_ROOT
84 cp -p examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
85 find $RPM_BUILD_ROOT%{py_sitescriptdir} -name "*serialjava*" -exec rm {} \;
86 find $RPM_BUILD_ROOT%{py_sitescriptdir} -name "*serialwin*" -exec rm {} \;
87 %endif
88 %if %{with python3}
89 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
90 %py3_build \
91         --build-base py3 \
92         install \
93         --optimize 2 \
94         --root=$RPM_BUILD_ROOT
95 cp -p examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
96 find $RPM_BUILD_ROOT%{py3_sitescriptdir} -name "*serialjava*" -exec rm {} \;
97 find $RPM_BUILD_ROOT%{py3_sitescriptdir} -name "*serialwin*" -exec rm {} \;
98 %endif
99
100 %clean
101 rm -rf $RPM_BUILD_ROOT
102
103 %if %{with python2}
104 %files
105 %defattr(644,root,root,755)
106 %doc CHANGES.txt LICENSE.txt README.txt
107 %{py_sitescriptdir}/%{module}
108 %{py_sitescriptdir}/*egg-info
109 %{_examplesdir}/python-%{module}-%{version}
110 %endif
111
112 %if %{with python3}
113 %files -n python3-%{module}
114 %defattr(644,root,root,755)
115 %doc CHANGES.txt LICENSE.txt README.txt
116 %{py3_sitescriptdir}/%{module}
117 %{py3_sitescriptdir}/*egg-info
118 %{_examplesdir}/python3-%{module}-%{version}
119 %endif
120
121 %files -n miniterm
122 %defattr(644,root,root,755)
123 %attr(755,root,root) %{_bindir}/miniterm.py
This page took 0.046458 seconds and 2 git commands to generate.