[packages/python-pyodbc] up to 2.0.58, builds fine

glen glen at pld-linux.org
Fri Oct 5 01:10:27 CEST 2012


commit 0f28096196399c02ff361f46cf60c16138d951bc
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Fri Oct 5 02:10:18 2012 +0300

    up to 2.0.58, builds fine

 python-pyodbc-py25.patch | 49 ------------------------------------------------
 python-pyodbc.spec       | 29 ++++++++++++++--------------
 2 files changed, 14 insertions(+), 64 deletions(-)
---
diff --git a/python-pyodbc.spec b/python-pyodbc.spec
index dde4f78..0bcd032 100644
--- a/python-pyodbc.spec
+++ b/python-pyodbc.spec
@@ -2,13 +2,12 @@
 Summary:	DB API 2.0 Module for ODBC
 Summary(pl.UTF-8):	Moduł DB API 2.0 dla ODBC
 Name:		python-%{module}
-Version:	2.0.30
-Release:	5
+Version:	2.0.58
+Release:	1
 License:	MIT
 Group:		Libraries/Python
-Source0:	http://dl.sourceforge.net/pyodbc/%{module}-%{version}.zip
-# Source0-md5:	348a7481c615c2db6d2f10a002e8a93a
-Patch0:		%{name}-py25.patch
+Source0:	http://downloads.sourceforge.net/pyodbc/%{module}-%{version}.zip
+# Source0-md5:	7252737ef4748a3cac50338cf9de9b96
 URL:		http://pyodbc.sourceforge.net/
 BuildRequires:	python-devel >= 1:2.5
 BuildRequires:	rpm-pythonprov
@@ -20,14 +19,14 @@ BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
 pyodbc is a Python module that allows you to access ODBC databases. It
-implements the Python Database API Specification v2.0.
-Some notable features include:
+implements the Python Database API Specification v2.0. Some notable
+features include:
  - The library is free for commercial and personal use.
  - It conforms to the DB API standard.
  - No 3rd party libraries are required. Only native Python datatypes
    are used, such as decimal and datetime.
- - Additional features have been added to simplify database
-   programming with Python.
+ - Additional features have been added to simplify database programming
+   with Python.
 
 %description -l pl.UTF-8
 pyodbc to moduł Pythona pozwalający na dostęp do baz danych ODBC.
@@ -42,15 +41,15 @@ znaczące cechy to:
 
 %prep
 %setup -q -n %{module}-%{version}
-%patch -p1
 
 %build
-python setup.PY build
+CC="%{__cc}" \
+CFLAGS="%{rpmcflags}" \
+%{__python} setup.py build
 
 %install
 rm -rf $RPM_BUILD_ROOT
-
-python setup.PY install \
+%{__python} setup.py install \
 	--optimize=2 \
 	--root $RPM_BUILD_ROOT
 
@@ -60,5 +59,5 @@ rm -rf $RPM_BUILD_ROOT
 %files
 %defattr(644,root,root,755)
 %doc README.txt
-%attr(755,root,root) %{py_sitedir}/*.so
-%{py_sitedir}/*.egg-info
+%attr(755,root,root) %{py_sitedir}/pyodbc.so
+%{py_sitedir}/pyodbc-%{version}-*.egg-info
diff --git a/python-pyodbc-py25.patch b/python-pyodbc-py25.patch
deleted file mode 100644
index 860f0fa..0000000
--- a/python-pyodbc-py25.patch
+++ /dev/null
@@ -1,49 +0,0 @@
---- pyodbc-2.0.30/cursor.cpp.wiget	2006-11-02 16:52:19.000000000 +0100
-+++ pyodbc-2.0.30/cursor.cpp	2006-11-02 17:06:36.000000000 +0100
-@@ -671,7 +671,7 @@
-     SQLINTEGER  bufsize   = 0;
- 
-     const char* pb;
--    int cb;
-+    Py_ssize_t cb;
- 
-     // If you don't want to use pcbData, set it to zero.  (Not its value -- the pointer.)
-     SQLINTEGER* pcbData = (SQLINTEGER*)&pbParams[*pibNext];
-@@ -1003,7 +1003,7 @@
- 
-     int params_offset = skip_first ? 1 : 0;
-     Py_ssize_t cParams = params == 0 ? 0 : PySequence_Length(params) - params_offset;
--    size_t cb = 0;
-+    Py_ssize_t cb = 0;
- 
-     // If parameters are provided and we need to convert them to a different format for ODBC, memory will be allocated
-     // here (using malloc).
-@@ -1097,7 +1097,7 @@
- 
-             BufferSegmentIterator it(pBuffer);
-             byte* pb;
--            int cb;
-+            Py_ssize_t cb;
-             while (it.Next(pb, cb))
-                 SQLPutData(cur->hstmt, pb, cb);
-         }
-@@ -1813,7 +1813,7 @@
-     // exception is set and zero is returned.  (To differentiate between the last two, use PyErr_Occurred.)
- 
-     SQLRETURN ret = 0;
--    int field_count, i;
-+    Py_ssize_t field_count, i;
-     PyObject** apValues;
- 
-     Py_BEGIN_ALLOW_THREADS
---- pyodbc-2.0.30/row.h.wiget	2006-11-02 17:08:31.000000000 +0100
-+++ pyodbc-2.0.30/row.h	2006-11-02 17:08:45.000000000 +0100
-@@ -19,7 +19,7 @@
- /*
-  * Used to make a new row from an array of column values.
-  */
--Row* Row_New(PyObject* map_name_to_index, int cValues, PyObject** apValues);
-+Row* Row_New(PyObject* map_name_to_index, Py_ssize_t cValues, PyObject** apValues);
- 
- /*
-  * Dereferences each object in apValues and frees apValue.  This is the internal format used by rows.
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-pyodbc.git/commitdiff/0f28096196399c02ff361f46cf60c16138d951bc



More information about the pld-cvs-commit mailing list