]> git.pld-linux.org Git - packages/python-serial.git/blob - python-serial.spec
f61cedccb46d96ddf2f2a58964e70f3961856241
[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 #
8 Summary:        Serial port interface module
9 Summary(pl.UTF-8):      Moduł interfejsu do portu szeregowego
10 Name:           python-serial
11 Version:        2.6
12 Release:        2
13 License:        GPL
14 Group:          Development/Languages/Python
15 Source0:        http://pypi.python.org/packages/source/p/pyserial/pyserial-%{version}.tar.gz
16 # Source0-md5:  cde799970b7c1ce1f7d6e9ceebe64c98
17 URL:            http://pyserial.wiki.sourceforge.net/pySerial
18 %if %{with python2}
19 BuildRequires:  python-devel
20 BuildRequires:  python-modules
21 %pyrequires_eq  python
22 %endif
23 %if %{with python3}
24 BuildRequires:  python3-devel
25 BuildRequires:  python3-modules
26 %endif
27 BuildRequires:  rpm-pythonprov
28 BuildRequires:  unzip
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 Version:        %{version}
47 Release:        %{release}
48 Group:          Libraries/Python
49 %pyrequires_eq  python3
50
51 %description -n python3-%{module}
52 This module encapsulates the access for the serial port. It provides
53 backends for Python running on Windows, Linux, BSD (possibly any POSIX
54 compilant system) and Jython. The module named "serial" automatically
55 selects the appropriate backend.
56
57 %prep
58 %setup  -q -n pyserial-%{version}
59
60 %build
61 %if %{with python2}
62 %{__python} ./setup.py build --build-base py2
63 %endif
64 %if %{with python3}
65 %{__python3} ./setup.py build --build-base py3
66 %endif
67
68 %install
69 rm -rf $RPM_BUILD_ROOT
70 %if %{with python2}
71 install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
72 %{__python} ./setup.py build \
73         --build-base py2 \
74         install \
75         --optimize 2 \
76         --root=$RPM_BUILD_ROOT
77 cp examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
78 find $RPM_BUILD_ROOT%{py_sitescriptdir} -name "*serialjava*" -exec rm {} \;
79 find $RPM_BUILD_ROOT%{py_sitescriptdir} -name "*serialwin*" -exec rm {} \;
80 %endif
81 %if %{with python3}
82 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
83 %{__python3} ./setup.py build \
84         --build-base py3 \
85         install \
86         --optimize 2 \
87         --root=$RPM_BUILD_ROOT
88 cp examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
89 find $RPM_BUILD_ROOT%{py3_sitescriptdir} -name "*serialjava*" -exec rm {} \;
90 find $RPM_BUILD_ROOT%{py3_sitescriptdir} -name "*serialwin*" -exec rm {} \;
91 %endif
92
93 %clean
94 rm -rf $RPM_BUILD_ROOT
95
96 %if %{with python2}
97 %files
98 %defattr(644,root,root,755)
99 %doc CHANGES.txt LICENSE.txt README.txt
100 %{_examplesdir}/python-%{module}-%{version}
101 %{py_sitescriptdir}/%{module}
102 %{py_sitescriptdir}/*egg-info
103 %endif
104
105 %if %{with python3}
106 %files -n python3-%{module}
107 %defattr(644,root,root,755)
108 %doc CHANGES.txt LICENSE.txt README.txt
109 %{_examplesdir}/python3-%{module}-%{version}
110 %{py3_sitescriptdir}/%{module}
111 %{py3_sitescriptdir}/*egg-info
112 %endif
This page took 0.030871 seconds and 3 git commands to generate.