packages: python-serial/python-serial.spec - fixed python version requireme...
kiesiu
kiesiu at pld-linux.org
Thu Feb 23 10:01:14 CET 2012
Author: kiesiu Date: Thu Feb 23 09:01:14 2012 GMT
Module: packages Tag: HEAD
---- Log message:
- fixed python version requirements for python2 modules
- added bconds for both python2 and python3 modules
- rel. 2
---- Files affected:
packages/python-serial:
python-serial.spec (1.25 -> 1.26)
---- Diffs:
================================================================
Index: packages/python-serial/python-serial.spec
diff -u packages/python-serial/python-serial.spec:1.25 packages/python-serial/python-serial.spec:1.26
--- packages/python-serial/python-serial.spec:1.25 Thu Jan 26 20:21:50 2012
+++ packages/python-serial/python-serial.spec Thu Feb 23 10:01:09 2012
@@ -1,23 +1,30 @@
# $Revision$, $Date$
-
+#
+# 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.UTF-8): Moduł interfejsu do portu szeregowego
Name: python-serial
Version: 2.6
-Release: 1
+Release: 2
License: GPL
Group: Development/Languages/Python
Source0: http://pypi.python.org/packages/source/p/pyserial/pyserial-%{version}.tar.gz
# Source0-md5: cde799970b7c1ce1f7d6e9ceebe64c98
URL: http://pyserial.wiki.sourceforge.net/pySerial
-%pyrequires_eq python
+%if %{with python2}
BuildRequires: python-devel
BuildRequires: python-modules
-%pyrequires_eq python3
+%pyrequires_eq python
+%endif
+%if %{with python3}
BuildRequires: python3-devel
BuildRequires: python3-modules
+%endif
BuildRequires: rpm-pythonprov
BuildRequires: unzip
BuildArch: noarch
@@ -40,6 +47,7 @@
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
@@ -51,50 +59,58 @@
%setup -q -n pyserial-%{version}
%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}/python-%{module}-%{version} \
- $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
-
+%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
-
+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 {} \;
+%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}/python-%{module}-%{version}
cp examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python3-%{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%{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}/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
%define date %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
%changelog
@@ -102,6 +118,11 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.26 2012/02/23 09:01:09 kiesiu
+- fixed python version requirements for python2 modules
+- added bconds for both python2 and python3 modules
+- rel. 2
+
Revision 1.25 2012/01/26 19:21:50 wrobell
- ver. 2.6
- user pypi download uri
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/python-serial/python-serial.spec?r1=1.25&r2=1.26&f=u
More information about the pld-cvs-commit
mailing list