14
0
forked from pool/python-pyodbc

Accepting request 630807 from home:Monex:Database

I've also added the previous suggested changes to the spec file, but I've found not a really good solution for the %check section. The problem is, that the library path is hard-coded and expects everything inside the build directory. So solve this I rename the build directory between the different test runs. I hope this will be ok or if you have a better solution I will try to add this.

The failed sqlite tests are fixed in the upstream project and a new version was released.

OBS-URL: https://build.opensuse.org/request/show/630807
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyodbc?expand=0&rev=1
This commit is contained in:
Tomáš Chvátal
2018-08-22 07:27:47 +00:00
committed by Git OBS Bridge
commit 247fa14760
5 changed files with 181 additions and 0 deletions

52
python-pyodbc.spec Normal file
View File

@@ -0,0 +1,52 @@
#
# spec file for package python-pyodbc
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-pyodbc
Version: 4.0.24
Release: 0
Url: https://github.com/mkleehammer/pyodbc
Summary: Python ODBC API
License: MIT
Group: Development/Languages/Python
Source: https://files.pythonhosted.org/packages/source/p/pyodbc/pyodbc-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: %{python_module devel}
BuildRequires: unixODBC-devel
BuildRequires: gcc-c++
BuildRequires: python-rpm-macros
BuildRequires: sqliteodbc
%python_subpackages
%description
pyodbc is a Python 2.x and 3.x module that allows you to use ODBC
to connect to almost any database from Windows, Linux, OS/X, and more.
It implements the Python Database API Specification v2.0, but additional features
have been added to simplify database programming even more.
%prep
%setup -q -n pyodbc-%{version}
%build
%python_build
%install
%python_install
%check
python3 tests3/sqlitetests.py -v "Driver=SQLITE3;Database=sqlite.db"
mv build/ _build.python3/ && mv _build.python2/ build/
python2 tests2/sqlitetests.py -v "Driver=SQLITE3;Database=sqlite.db"
mv build/ _build.python2/ && mv _build.python3/ build/
%files %python_files
%defattr(-,root,root,-)
%{python_sitearch}/*
%license LICENSE.txt
%doc README.md
%changelog