File mingw64-libdbi-drivers.spec of Package mingw64-libdbi-drivers

#
# spec file for package mingw64-libdbi-drivers
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           mingw64-libdbi-drivers
Version:        0.9.0.g51
Release:        0
#Snapshot:      libdbi-drivers-0.9.0-51-gfe23caa
Summary:        Database drivers for libdbi on MinGW
License:        LGPL-2.1-or-later
Group:          Productivity/Databases/Servers
URL:            http://libdbi-drivers.sf.net/
#Git-Clone:	git://git.code.sf.net/p/libdbi-drivers/libdbi-drivers
#Source:	http://downloads.sf.net/libdbi-drivers/%name-%version.tar.gz
Source:         libdbi-drivers-%version.tar.xz
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  gettext
BuildRequires:  libtool
BuildRequires:  mingw64-cross-gcc
BuildRequires:  mingw64-filesystem
BuildRequires:  mingw64-libdbi-devel >= 0.9.0.g30
BuildRequires:  mingw64-mysql-connector-c-devel
BuildRequires:  mingw64-sqlite-devel
BuildRequires:  xz
%_mingw64_package_header_debug
BuildArch:      noarch
#!BuildIgnore:  post-build-checks

%description
libdbi implements a database-independent abstraction layer in C,
similar to the DBI/DBD layer in Perl. Drivers are distributed
separately from the library itself.

%package dbd-mysql
Summary:        MySQL driver for libdbi
Group:          System/Libraries

%description dbd-mysql
This driver provides connectivity to MySQL database servers through
the libdbi database independent abstraction layer. Switching a
program's driver does not require recompilation or rewriting source
code.

%package dbd-pgsql
Summary:        PostgreSQL driver for libdbi
Group:          System/Libraries

%description dbd-pgsql
This driver provides connectivity to PostgreSQL database servers
through the libdbi database independent abstraction layer. Switching
a program's driver does not require recompilation or rewriting source
code.

%package dbd-sqlite
Summary:        SQLite (old) driver for libdbi
Group:          System/Libraries

%description dbd-sqlite
This driver provides connectivity to SQLite database servers through the
libdbi database independent abstraction layer. Switching a program's driver
does not require recompilation or rewriting source code.

%package dbd-sqlite3
Summary:        SQLite3 driver for libdbi
Group:          System/Libraries

%description dbd-sqlite3
This driver provides connectivity to SQLite 3.x database servers through the
libdbi database independent abstraction layer. Switching a program's driver
does not require recompilation or rewriting source code.

%_mingw64_debug_package

%prep
%setup -q -n libdbi-drivers

%build
# ensure license doesn't have a executable permission
chmod a-x COPYING
# Fake the __DATE__ so we do not needelessly rebuild
perl -i -pe 's{\b__DATE__\b}{""}' drivers/*/*.c
perl -i -pe 's{(SUBDIRS\s+=.*)(?:\btests\b)(.*)}{$1$2}' Makefile.am
autoreconf -fi
%_mingw64_configure \
	--with-mysql \
	--with-mysql-incdir="%_mingw64_includedir/mysql" \
	--with-mysql-libdir="%_mingw64_libdir" \
	--with-sqlite3 \
	--with-dbi-incdir="%_mingw64_includedir" \
	--with-dbi-libdir="%_mingw64_libdir" \
	--disable-static \
	--docdir="%_docdir/%name" --disable-docs
make %{?_smp_mflags}

%install
make DESTDIR=%buildroot install %{?_smp_mflags}
# these are plugins, and not linked to directly
find %buildroot -type f "(" -name "*.la" -o -name "*.dll.a" ")" -delete

%files dbd-sqlite3
%defattr(-,root,root)
%doc COPYING
%dir %_mingw64_libdir/dbd
%_mingw64_libdir/dbd/libdbdsqlite3.dll

%files dbd-mysql
%defattr(-,root,root)
%doc COPYING
%dir %_mingw64_libdir/dbd
%_mingw64_libdir/dbd/libdbdmysql.dll

%changelog
openSUSE Build Service is sponsored by