]> git.pld-linux.org Git - packages/python-serial.git/blob - python-serial.spec
- use rpm python macros
[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:        6
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
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 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
88 %py3_install
89
90 cp -p examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
91 find $RPM_BUILD_ROOT%{py3_sitescriptdir} -name "*serialjava*" -exec rm {} \;
92 find $RPM_BUILD_ROOT%{py3_sitescriptdir} -name "*serialwin*" -exec rm {} \;
93 %endif
94
95 %clean
96 rm -rf $RPM_BUILD_ROOT
97
98 %if %{with python2}
99 %files
100 %defattr(644,root,root,755)
101 %doc CHANGES.txt LICENSE.txt README.txt
102 %{py_sitescriptdir}/%{module}
103 %{py_sitescriptdir}/*egg-info
104 %{_examplesdir}/python-%{module}-%{version}
105 %endif
106
107 %if %{with python3}
108 %files -n python3-%{module}
109 %defattr(644,root,root,755)
110 %doc CHANGES.txt LICENSE.txt README.txt
111 %{py3_sitescriptdir}/%{module}
112 %{py3_sitescriptdir}/*egg-info
113 %{_examplesdir}/python3-%{module}-%{version}
114 %endif
115
116 %files -n miniterm
117 %defattr(644,root,root,755)
118 %attr(755,root,root) %{_bindir}/miniterm.py
This page took 0.113907 seconds and 3 git commands to generate.