[pyodbc] Start compiling for python3
Honza Horak
hhorak at fedoraproject.org
Tue Feb 17 13:42:49 UTC 2015
commit 53e8334b0426a6296941c02f33d6bae127bcd63c
Author: Honza Horak <hhorak at redhat.com>
Date: Tue Feb 17 14:39:54 2015 +0100
Start compiling for python3
Thanks Ganapathi Kamath
pyodbc.spec | 49 ++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 48 insertions(+), 1 deletions(-)
---
diff --git a/pyodbc.spec b/pyodbc.spec
index 213e058..24646e6 100644
--- a/pyodbc.spec
+++ b/pyodbc.spec
@@ -1,8 +1,12 @@
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
+%{!?python3_sitearch: %define python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
+
+%global modulename pyodbc
+%bcond_without python3 1
Name: pyodbc
Version: 3.0.7
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Python DB API 2.0 Module for ODBC
Group: Development/Languages
License: MIT
@@ -13,30 +17,73 @@ Requires: unixODBC, python >= 2.4
BuildRequires: unixODBC-devel
BuildRequires: python-devel
+%if 0%{?with_python3}
+BuildRequires: python3-devel
+%endif
+
%description
A Python DB API 2 and 3 module for ODBC. This project provides an up-to-date,
convenient interface to ODBC using native data types like datetime and
decimal.
+%if 0%{?with_python3}
+%package -n python3-%{modulename}
+Summary: Python DB API 2.0 Module for ODBC
+Group: Development/Languages
+Requires: python3 >= 3.4
+
+%description -n python3-%{modulename}
+A Python DB API 2 and 3 module for ODBC. This project provides an up-to-date,
+convenient interface to ODBC using native data types like datetime and
+decimal.
+%endif
+
+
%prep
%setup -q
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+%endif
%build
%{__python} setup.py build
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py build
+popd
+%endif
%install
%{__rm} -rf %{buildroot}
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
+popd
+%endif
%clean
%{__rm} -rf %{buildroot}
+
%files
%defattr(-,root,root,-)
%doc LICENSE.txt README.rst
%{python_sitearch}/*
+%if 0%{?with_python3}
+%files -n python3-%{name}
+%defattr(-,root,root,-)
+%doc LICENSE.txt README.rst
+%{python3_sitearch}/*
+%endif
+
%changelog
+* Tue Feb 17 2015 Honza Horak <hhorak at redhat.com> - 3.0.7-2
+- Start compiling for python3
+ Thanks Ganapathi Kamath
+
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.0.7-1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
More information about the scm-commits
mailing list