]> git.pld-linux.org Git - packages/python-serial.git/blob - python-serial.spec
acbd30b34bc9202e3e9e957ccbfae32772ca6941
[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:        4
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:  rpm-pythonprov
18 BuildRequires:  unzip
19 %if %{with python2}
20 BuildRequires:  python-devel
21 BuildRequires:  python-modules
22 Requires:       python
23 %endif
24 %if %{with python3}
25 BuildRequires:  python3-2to3
26 BuildRequires:  python3-devel
27 BuildRequires:  python3-modules
28 %endif
29 BuildArch:      noarch
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32 %description
33 This module encapsulates the access for the serial port. It provides
34 backends for Python running on Windows, Linux, BSD (possibly any POSIX
35 compilant system) and Jython. The module named "serial" automatically
36 selects the appropriate backend.
37
38 %description -l pl.UTF-8
39 Ten moduł opakowuje dostęp do portu szeregowego. Dostarcza backendy
40 dla Pythona działającego na Windows, Linuksie, BSD (być może dowolnym
41 systemie zgodnym z POSIX) oraz Jythona. Moduł o nazwie "serial"
42 automatycznie wybiera właściwy backend.
43
44 %package -n     python3-%{module}
45 Summary:        Serial port interface module
46 Group:          Libraries/Python
47 Requires:       python3
48
49 %description -n python3-%{module}
50 This module encapsulates the access for the serial port. It provides
51 backends for Python running on Windows, Linux, BSD (possibly any POSIX
52 compilant system) and Jython. The module named "serial" automatically
53 selects the appropriate backend.
54
55 %package -n miniterm
56 Summary:        Very simple serial terminal
57 Group:          Applications/Communications
58 Requires:       python%{?with_python3:3}-%{module} = %{version}-%{release}
59
60 %description -n miniterm
61 Very simple serial terminal written in Python.
62
63 %prep
64 %setup  -q -n pyserial-%{version}
65
66 %build
67 %if %{with python2}
68 %{__python} setup.py build --build-base py2
69 %endif
70 %if %{with python3}
71 %{__python3} setup.py build --build-base py3
72 %endif
73
74 %install
75 rm -rf $RPM_BUILD_ROOT
76 %if %{with python2}
77 install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
78 %{__python} setup.py build \
79         --build-base py2 \
80         install \
81         --optimize 2 \
82         --root=$RPM_BUILD_ROOT
83 cp -p examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
84 find $RPM_BUILD_ROOT%{py_sitescriptdir} -name "*serialjava*" -exec rm {} \;
85 find $RPM_BUILD_ROOT%{py_sitescriptdir} -name "*serialwin*" -exec rm {} \;
86 %endif
87 %if %{with python3}
88 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
89 %{__python3} setup.py build \
90         --build-base py3 \
91         install \
92         --optimize 2 \
93         --root=$RPM_BUILD_ROOT
94 cp -p examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
95 find $RPM_BUILD_ROOT%{py3_sitescriptdir} -name "*serialjava*" -exec rm {} \;
96 find $RPM_BUILD_ROOT%{py3_sitescriptdir} -name "*serialwin*" -exec rm {} \;
97 %endif
98
99 %clean
100 rm -rf $RPM_BUILD_ROOT
101
102 %if %{with python2}
103 %files
104 %defattr(644,root,root,755)
105 %doc CHANGES.txt LICENSE.txt README.txt
106 %{py_sitescriptdir}/%{module}
107 %{py_sitescriptdir}/*egg-info
108 %{_examplesdir}/python-%{module}-%{version}
109 %endif
110
111 %if %{with python3}
112 %files -n python3-%{module}
113 %defattr(644,root,root,755)
114 %doc CHANGES.txt LICENSE.txt README.txt
115 %{py3_sitescriptdir}/%{module}
116 %{py3_sitescriptdir}/*egg-info
117 %{_examplesdir}/python3-%{module}-%{version}
118 %endif
119
120 %files -n miniterm
121 %defattr(644,root,root,755)
122 %attr(755,root,root) %{_bindir}/miniterm.py
This page took 0.207066 seconds and 2 git commands to generate.