]>
Commit | Line | Data |
---|---|---|
01b42c11 ŁK |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # Python 2.x module | |
4 | %bcond_without python3 # Python 3.x module | |
d0f6a6f1 | 5 | |
376a9b1c | 6 | %define module serial |
6489d097 | 7 | Summary: Serial port interface module |
612b0b56 | 8 | Summary(pl.UTF-8): Moduł interfejsu do portu szeregowego |
e08ccba4 | 9 | Name: python-serial |
7080d450 | 10 | Version: 2.7 |
376a9b1c | 11 | Release: 6 |
e08ccba4 | 12 | License: GPL |
5dd0867a | 13 | Group: Development/Languages/Python |
0fc3a8ea | 14 | Source0: http://pypi.python.org/packages/source/p/pyserial/pyserial-%{version}.tar.gz |
7080d450 | 15 | # Source0-md5: 794506184df83ef2290de0d18803dd11 |
379e2312 | 16 | URL: http://pyserial.wiki.sourceforge.net/pySerial |
0971cf19 | 17 | BuildRequires: rpmbuild(macros) >= 1.710 |
d0f6a6f1 ER |
18 | BuildRequires: rpm-pythonprov |
19 | BuildRequires: unzip | |
01b42c11 | 20 | %if %{with python2} |
e08ccba4 | 21 | BuildRequires: python-devel |
23994b50 | 22 | BuildRequires: python-modules |
d0f6a6f1 | 23 | Requires: python |
01b42c11 ŁK |
24 | %endif |
25 | %if %{with python3} | |
d0f6a6f1 | 26 | BuildRequires: python3-2to3 |
96dd273c | 27 | BuildRequires: python3-devel |
28 | BuildRequires: python3-modules | |
01b42c11 | 29 | %endif |
e08ccba4 | 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 | ||
f04dc3d2 JR |
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. | |
e08ccba4 | 44 | |
96dd273c | 45 | %package -n python3-%{module} |
46 | Summary: Serial port interface module | |
96dd273c | 47 | Group: Libraries/Python |
d0f6a6f1 | 48 | Requires: python3 |
96dd273c | 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 | ||
d0f6a6f1 | 56 | %package -n miniterm |
d44bac7c | 57 | Summary: Very simple serial terminal |
d44bac7c AM |
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 | ||
e08ccba4 | 64 | %prep |
65 | %setup -q -n pyserial-%{version} | |
66 | ||
67 | %build | |
01b42c11 | 68 | %if %{with python2} |
376a9b1c | 69 | %py_build |
01b42c11 ŁK |
70 | %endif |
71 | %if %{with python3} | |
376a9b1c | 72 | %py3_build |
01b42c11 | 73 | %endif |
e08ccba4 | 74 | |
75 | %install | |
76 | rm -rf $RPM_BUILD_ROOT | |
01b42c11 ŁK |
77 | %if %{with python2} |
78 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} | |
376a9b1c JR |
79 | %py_install |
80 | ||
d0f6a6f1 | 81 | cp -p examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} |
01b42c11 ŁK |
82 | find $RPM_BUILD_ROOT%{py_sitescriptdir} -name "*serialjava*" -exec rm {} \; |
83 | find $RPM_BUILD_ROOT%{py_sitescriptdir} -name "*serialwin*" -exec rm {} \; | |
84 | %endif | |
376a9b1c | 85 | |
01b42c11 ŁK |
86 | %if %{with python3} |
87 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
376a9b1c JR |
88 | %py3_install |
89 | ||
d0f6a6f1 | 90 | cp -p examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} |
b284450f | 91 | find $RPM_BUILD_ROOT%{py3_sitescriptdir} -name "*serialjava*" -exec rm {} \; |
92 | find $RPM_BUILD_ROOT%{py3_sitescriptdir} -name "*serialwin*" -exec rm {} \; | |
01b42c11 | 93 | %endif |
7d5fe39c | 94 | |
e08ccba4 | 95 | %clean |
96 | rm -rf $RPM_BUILD_ROOT | |
97 | ||
01b42c11 | 98 | %if %{with python2} |
e08ccba4 | 99 | %files |
100 | %defattr(644,root,root,755) | |
a1aab51a | 101 | %doc CHANGES.txt LICENSE.txt README.txt |
96dd273c | 102 | %{py_sitescriptdir}/%{module} |
103 | %{py_sitescriptdir}/*egg-info | |
d0f6a6f1 | 104 | %{_examplesdir}/python-%{module}-%{version} |
01b42c11 | 105 | %endif |
96dd273c | 106 | |
01b42c11 | 107 | %if %{with python3} |
96dd273c | 108 | %files -n python3-%{module} |
109 | %defattr(644,root,root,755) | |
110 | %doc CHANGES.txt LICENSE.txt README.txt | |
b284450f | 111 | %{py3_sitescriptdir}/%{module} |
112 | %{py3_sitescriptdir}/*egg-info | |
d0f6a6f1 | 113 | %{_examplesdir}/python3-%{module}-%{version} |
01b42c11 | 114 | %endif |
d44bac7c AM |
115 | |
116 | %files -n miniterm | |
117 | %defattr(644,root,root,755) | |
118 | %attr(755,root,root) %{_bindir}/miniterm.py |