packages: python-mysql-connector/python-mysql-connector.spec - tests, pytho...

glen glen at pld-linux.org
Mon May 14 08:54:37 CEST 2012


Author: glen                         Date: Mon May 14 06:54:37 2012 GMT
Module: packages                      Tag: HEAD
---- Log message:
- tests, python3 bconds, cleanups, formatting

---- Files affected:
packages/python-mysql-connector:
   python-mysql-connector.spec (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: packages/python-mysql-connector/python-mysql-connector.spec
diff -u packages/python-mysql-connector/python-mysql-connector.spec:1.1 packages/python-mysql-connector/python-mysql-connector.spec:1.2
--- packages/python-mysql-connector/python-mysql-connector.spec:1.1	Sat Sep 17 20:37:46 2011
+++ packages/python-mysql-connector/python-mysql-connector.spec	Mon May 14 08:54:31 2012
@@ -1,16 +1,21 @@
 # $Revision$, $Date$
-%define	pname	mysql-connector
-Summary:	the MySQL Client/Protocol implemented in Python
+#
+# Conditional build:
+%bcond_with		tests		# build with tests (requires mysql server)
+%bcond_without	python3		# build without python3
+
+%define		pname	mysql-connector
+Summary:	The MySQL Client/Protocol implemented in Python
 Name:		python-%{pname}
 Version:	0.3.2
 Release:	1
 License:	GPL v2
 Group:		Libraries/Python
-Source0:	http://launchpad.net/myconnpy/0.3/0.3.2/+download/mysql-connector-python-%{version}-devel.tar.gz
+Source0:	http://launchpad.net/myconnpy/0.3/%{version}/+download/mysql-connector-python-%{version}-devel.tar.gz
 # Source0-md5:	2ffdfa21c0a870cc7080f9f9a5ee3d87
 URL:		https://launchpad.net/myconnpy/
 BuildRequires:	python-modules
-BuildRequires:	python3-modules
+%{?with_python3:BuildRequires:	python3-modules}
 BuildRequires:	rpm-pythonprov
 %pyrequires_eq	python-modules
 BuildArch:	noarch
@@ -23,7 +28,7 @@
 driver. An interface to the popular MySQL database server for Python.
 
 %package -n python3-%{pname}
-Summary:	the MySQL Client/Protocol implemented in Python
+Summary:	The MySQL Client/Protocol implemented in Python
 Group:		Development/Languages/Python
 %pyrequires_eq	python3-modules
 
@@ -34,13 +39,16 @@
 driver. An interface to the popular MySQL database server for Python.
 
 %prep
-%setup  -q -n mysql-connector-python-%{version}-devel
+%setup -q -n mysql-connector-python-%{version}-devel
 
 %build
 %{__python} setup.py build
-#%{__python} setup.py test
+%{?with_tests:%{__python} setup.py test}
+
+%if %{with python3}
 %{__python3} setup.py build -b build-3
-#%{__python3} setup.py test
+%{?with_tests:%{__python3} setup.py test}
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -52,11 +60,13 @@
 
 %py_postclean
 
+%if %{with python3}
 %{__python3} -- setup.py \
-        build -b build-3 \
-        install \
-        --root=$RPM_BUILD_ROOT \
-        --optimize=2
+	build -b build-3 \
+	install \
+	--root=$RPM_BUILD_ROOT \
+	--optimize=2
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -64,12 +74,15 @@
 %files
 %defattr(644,root,root,755)
 %doc ChangeLog README
-%{py_sitescriptdir}/mysql*.egg-info
 %dir %{py_sitescriptdir}/mysql
-%{py_sitescriptdir}/mysql/*.py?
+%{py_sitescriptdir}/mysql/*.py[co]
 %dir %{py_sitescriptdir}/mysql/connector
-%{py_sitescriptdir}/mysql/connector/*.py?
+%{py_sitescriptdir}/mysql/connector/*.py[co]
+%if "%{py_ver}" > "2.4"
+%{py_sitescriptdir}/mysql_connector_python-*.egg-info
+%endif
 
+%if %{with python3}
 %files -n python3-%{pname}
 %defattr(644,root,root,755)
 %doc ChangeLog README
@@ -77,12 +90,12 @@
 %dir %{py3_sitescriptdir}/mysql
 %{py3_sitescriptdir}/mysql/*.py
 %dir %{py3_sitescriptdir}/mysql/__pycache__
-%{py3_sitescriptdir}/mysql/__pycache__/*.py?
+%{py3_sitescriptdir}/mysql/__pycache__/*.py[co]
 %dir %{py3_sitescriptdir}/mysql/connector
 %{py3_sitescriptdir}/mysql/connector/*.py
 %dir %{py3_sitescriptdir}/mysql/connector/__pycache__
-%{py3_sitescriptdir}/mysql/connector/__pycache__/*.py?
-
+%{py3_sitescriptdir}/mysql/connector/__pycache__/*.py[co]
+%endif
 
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
@@ -90,7 +103,8 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.2  2012/05/14 06:54:31  glen
+- tests, python3 bconds, cleanups, formatting
+
 Revision 1.1  2011/09/17 18:37:46  arekm
 - initial
-
-
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/packages/python-mysql-connector/python-mysql-connector.spec?r1=1.1&r2=1.2



More information about the pld-cvs-commit mailing list