summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2011-03-20 11:10:06 +0100
committerRemi Collet <fedora@famillecollet.com>2011-03-20 11:10:06 +0100
commitd389d8e4402a201f89f677e46895107a37ab16f8 (patch)
tree017acc51a81380c3a5fc09fd38144893a9786e80
parentd960b25276d927d6e3163d0e808f91b8dbd1eeee (diff)
make python3 conditionalHEADmaster
-rw-r--r--mysql-connector-python.spec18
1 files changed, 16 insertions, 2 deletions
diff --git a/mysql-connector-python.spec b/mysql-connector-python.spec
index a5d9d4a..40ada50 100644
--- a/mysql-connector-python.spec
+++ b/mysql-connector-python.spec
@@ -1,5 +1,11 @@
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+%if 0%{?fedora} >= 13
+%global with_python3 1
+%else
+%global with_python3 0
+%endif
+
Name: mysql-connector-python
Version: 0.3.2
Release: 2%{?dist}
@@ -13,7 +19,9 @@ Source0: http://launchpad.net/myconnpy/0.3/%{version}/+download/%{name}-%
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: python-devel
+%if 0%{?with_python3}
BuildRequires: python3-devel
+%endif
# for unittest
BuildRequires: mysql-server
@@ -23,6 +31,7 @@ MySQL Connector/Python is implementing the MySQL Client/Server protocol
completely in Python. No MySQL libraries are needed, and no compilation
is necessary to run this Python DB API v2.0 compliant driver.
+%if 0%{?with_python3}
%package -n mysql-connector-python3
Summary: MySQL Connector for Python 3
@@ -31,6 +40,7 @@ Summary: MySQL Connector for Python 3
MySQL Connector/Python is implementing the MySQL Client/Server protocol
completely in Python. No MySQL libraries are needed, and no compilation
is necessary to run this Python DB API v2.0 compliant driver.
+%endif
%prep
@@ -45,10 +55,13 @@ is necessary to run this Python DB API v2.0 compliant driver.
%install
%{__rm} -rf $RPM_BUILD_ROOT
+
+%if 0%{?with_python3}
# Python 3 build
%{__python3} setup.py install --root $RPM_BUILD_ROOT
-
%{__rm} -rf build
+%endif
+
# Python 2 build (end with this for tests)
%{__python} setup.py install --root $RPM_BUILD_ROOT
@@ -68,12 +81,13 @@ is necessary to run this Python DB API v2.0 compliant driver.
%{python_sitelib}/*
+%if 0%{?with_python3}
%files -n mysql-connector-python3
%defattr(-,root,root,-)
%doc ChangeLog COPYING EXCEPTIONS-CLIENT README
%doc python3/examples
%{python3_sitelib}/*
-
+%endif
%changelog
* Sun Mar 20 2011 Remi Collet <Fedora@famillecollet.com> 0.3.2-2