]> git.pld-linux.org Git - packages/python-serial.git/blobdiff - python-serial.spec
- up to 2.7
[packages/python-serial.git] / python-serial.spec
index a198bfe6a594e6bd8f7067f25e104199f547bb62..e29e58480ac90e91c5726e94e4db779ffb2b317d 100644 (file)
@@ -1,19 +1,31 @@
-
+#
+# Conditional build:
+%bcond_without python2         # Python 2.x module
+%bcond_without python3         # Python 3.x module
+#
 %define        module  serial
-
+#
 Summary:       Serial port interface module
-Summary(pl):   Modu³ interfejsu do portu szeregowego
+Summary(pl.UTF-8):     Moduł interfejsu do portu szeregowego
 Name:          python-serial
-Version:       2.1
+Version:       2.7
 Release:       1
 License:       GPL
 Group:         Development/Languages/Python
-Source0:       http://dl.sourceforge.net/pyserial/pyserial-%{version}.zip
-# Source0-md5: b2e11ffa387801f5f24b4aea0fa7d742
-URL:           http://pyserial.sf.net/
-%pyrequires_eq python
+Source0:       http://pypi.python.org/packages/source/p/pyserial/pyserial-%{version}.tar.gz
+# Source0-md5: 794506184df83ef2290de0d18803dd11
+URL:           http://pyserial.wiki.sourceforge.net/pySerial
+%if %{with python2}
 BuildRequires: python-devel
-BuildRequires: rpm-pythonprov >= 4.0.2-50
+BuildRequires: python-modules
+%pyrequires_eq python
+%endif
+%if %{with python3}
+BuildRequires: python3-devel
+BuildRequires: python3-modules
+BuildRequires: python3-2to3
+%endif
+BuildRequires: rpm-pythonprov
 BuildRequires: unzip
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -24,43 +36,78 @@ backends for Python running on Windows, Linux, BSD (possibly any POSIX
 compilant system) and Jython. The module named "serial" automatically
 selects the appropriate backend.
 
-%description -l pl
-Ten modu³ opakowuje dostêp do portu szeregowego. Dostarcza backendy
-dla Pythona dzia³aj±cego na Windows, Linuksie, BSD (byæ mo¿e dowolnym
-systemie zgodnym z POSIX) oraz Jythona. Modu³ o nazwie "serial"
-automatycznie wybiera w³a¶ciwy backend.
+%description -l pl.UTF-8
+Ten moduł opakowuje dostęp do portu szeregowego. Dostarcza backendy
+dla Pythona działającego na Windows, Linuksie, BSD (być może dowolnym
+systemie zgodnym z POSIX) oraz Jythona. Moduł o nazwie "serial"
+automatycznie wybiera właściwy backend.
+
+%package -n    python3-%{module}
+Summary:       Serial port interface module
+Version:       %{version}
+Release:       %{release}
+Group:         Libraries/Python
+%pyrequires_eq python3
+
+%description -n python3-%{module}
+This module encapsulates the access for the serial port. It provides
+backends for Python running on Windows, Linux, BSD (possibly any POSIX
+compilant system) and Jython. The module named "serial" automatically
+selects the appropriate backend.
 
 %prep
 %setup  -q -n pyserial-%{version}
 
 %build
-python ./setup.py build
+%if %{with python2}
+%{__python} ./setup.py build --build-base py2
+%endif
+%if %{with python3}
+%{__python3} ./setup.py build --build-base py3
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
-
-python ./setup.py install \
+%if %{with python2}
+install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
+%{__python} ./setup.py build \
+       --build-base py2 \
+       install \
        --optimize 2 \
        --root=$RPM_BUILD_ROOT
-
-mv examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
-
+cp examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
 find $RPM_BUILD_ROOT%{py_sitescriptdir} -name "*serialjava*" -exec rm {} \;
 find $RPM_BUILD_ROOT%{py_sitescriptdir} -name "*serialwin*" -exec rm {} \;
-find $RPM_BUILD_ROOT%{py_sitescriptdir} -name \*.py -exec rm {} \;
+%endif
+%if %{with python3}
+install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
+%{__python3} ./setup.py build \
+       --build-base py3 \
+       install \
+       --optimize 2 \
+       --root=$RPM_BUILD_ROOT
+cp examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
+find $RPM_BUILD_ROOT%{py3_sitescriptdir} -name "*serialjava*" -exec rm {} \;
+find $RPM_BUILD_ROOT%{py3_sitescriptdir} -name "*serialwin*" -exec rm {} \;
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%if %{with python2}
 %files
 %defattr(644,root,root,755)
 %doc CHANGES.txt LICENSE.txt README.txt
-%{_examplesdir}/%{name}-%{version}
-%dir %{py_sitescriptdir}/%{module}
-%{py_sitescriptdir}/%{module}/__init__.pyc
-%{py_sitescriptdir}/%{module}/__init__.pyo
-%{py_sitescriptdir}/%{module}/serialposix.pyc
-%{py_sitescriptdir}/%{module}/serialposix.pyo
-%{py_sitescriptdir}/%{module}/serialutil.pyc
-%{py_sitescriptdir}/%{module}/serialutil.pyo
+%{_examplesdir}/python-%{module}-%{version}
+%{py_sitescriptdir}/%{module}
+%{py_sitescriptdir}/*egg-info
+%endif
+
+%if %{with python3}
+%files -n python3-%{module}
+%defattr(644,root,root,755)
+%doc CHANGES.txt LICENSE.txt README.txt
+%{_examplesdir}/python3-%{module}-%{version}
+%{py3_sitescriptdir}/%{module}
+%{py3_sitescriptdir}/*egg-info
+%endif
This page took 0.031863 seconds and 4 git commands to generate.