import libdbi-drivers

The libdbi-drivers project provides the database-specific drivers for
the libdbi framework. The current version of libdbi-drivers will work
with any 0.8.x release of the framework.

It supports MySQL, PostgreSQL, sqlite, sqlite3, and FreeTDS

ok wcmaier@
This commit is contained in:
merdely 2009-06-02 00:58:58 +00:00
parent db9a3d6e03
commit ea2e20c2ad
21 changed files with 344 additions and 0 deletions

View File

@ -0,0 +1,82 @@
# $OpenBSD: Makefile,v 1.1.1.1 2009/06/02 00:58:58 merdely Exp $
V = 0.8.3-1
COMMENT-main = mysql driver for libdbi
COMMENT-pgsql = pgsql driver for libdbi
COMMENT-sqlite = sqlite driver for libdbi
COMMENT-sqlite3 = sqlite3 driver for libdbi
COMMENT-freetds = freetds driver for libdbi
DISTNAME = libdbi-drivers-$V
PKGNAME-main = libdbi-drivers-mysql-$V
PKGNAME-pgsql = libdbi-drivers-pgsql-$V
PKGNAME-sqlite = libdbi-drivers-sqlite-$V
PKGNAME-sqlite3 = libdbi-drivers-sqlite3-$V
PKGNAME-freetds = libdbi-drivers-freetds-$V
CATEGORIES = databases
HOMEPAGE = http://libdbi-drivers.sourceforge.net/
MASTER_SITES = ${MASTER_SITE_SOURCEFORGE:=libdbi-drivers/}
MAINTAINER = Michael Erdely <merdely@openbsd.org>
MULTI_PACKAGES = -main -pgsql -sqlite -sqlite3 -freetds
# LGPLv2.1
PERMIT_PACKAGE_CDROM = Yes
PERMIT_PACKAGE_FTP = Yes
PERMIT_DISTFILES_CDROM =Yes
PERMIT_DISTFILES_FTP = Yes
USE_LIBTOOL = Yes
CONFIGURE_STYLE = gnu
CONFIGURE_ARGS = --disable-docs \
--with-dbi-libdir=${LOCALBASE}/lib \
--with-dbi-incdir=${LOCALBASE}/include/dbi \
--with-mysql \
--with-pgsql \
--with-pgsql-incdir="${LOCALBASE}/include -I${LOCALBASE}/include/postgresql" \
--with-pgsql-libdir=${LOCALBASE}/lib/postgresql \
--with-sqlite \
--with-sqlite3 \
--with-freetds \
--with-freetds-incdir=${LOCALBASE}/include \
--with-freetds-libdir=${LOCALBASE}/lib
WANTLIB-main = crypto m ssl z
LIB_DEPENDS-main = mysqlclient::databases/mysql \
dbi::databases/libdbi
WANTLIB-pgsql = m
LIB_DEPENDS-pgsql = pq::databases/postgresql \
dbi::databases/libdbi
WANTLIB-sqlite = m
LIB_DEPENDS-sqlite = sqlite::databases/sqlite \
dbi::databases/libdbi
WANTLIB-sqlite3 = m
LIB_DEPENDS-sqlite3 = sqlite3::databases/sqlite3 \
dbi::databases/libdbi
WANTLIB-freetds = iconv m
LIB_DEPENDS-freetds = ct::databases/freetds \
dbi::databases/libdbi
REGRESS_IS_INTERACTIVE =Yes
REGRESS_DEPENDS = ::databases/libdbi-drivers,-main \
::databases/libdbi-drivers,-pgsql \
::databases/libdbi-drivers,-sqlite \
::databases/libdbi-drivers,-sqlite3 \
::databases/libdbi-drivers,-freetds
post-install:
.for d in mysql pgsql sqlite sqlite3
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/libdbi-drivers/dbd_${d}
${INSTALL_DATA} ${WRKSRC}/drivers/${d}/dbd_${d}.pdf \
${PREFIX}/share/doc/libdbi-drivers
${INSTALL_DATA} ${WRKSRC}/drivers/${d}/dbd_${d}/*.html \
${PREFIX}/share/doc/libdbi-drivers/dbd_${d}
.endfor
.include <bsd.port.mk>

View File

@ -0,0 +1,5 @@
MD5 (libdbi-drivers-0.8.3-1.tar.gz) = TeebMjFipadlK2W2COymzQ==
RMD160 (libdbi-drivers-0.8.3-1.tar.gz) = 4KqeZ/ZWD7RAGLHTXZDUrCG0hZc=
SHA1 (libdbi-drivers-0.8.3-1.tar.gz) = WZ+6sRVBno/Iizsxo4AxWE7iE7U=
SHA256 (libdbi-drivers-0.8.3-1.tar.gz) = SrmUQ5jOdpwN7rZNL3NVXGe8JczSreHM9VIibHsqz3I=
SIZE (libdbi-drivers-0.8.3-1.tar.gz) = 1534420

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-Makefile_in,v 1.1.1.1 2009/06/02 00:58:58 merdely Exp $
--- Makefile.in.orig Sun May 31 16:45:24 2009
+++ Makefile.in Sun May 31 16:45:35 2009
@@ -234,7 +234,7 @@ sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
AUTOMAKE_OPTIONS = foreign dist-zip
-SUBDIRS = drivers tests @docs_subdirs@
+SUBDIRS = drivers tests
EXTRA_DIST = AUTHORS COPYING ChangeLog INSTALL README README.win32 README.osx README.encodings TODO libdbi.spec.in config.h.in Makefile.w32 autogen.sh fixlt.sh
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive

View File

@ -0,0 +1,25 @@
$OpenBSD: patch-configure,v 1.1.1.1 2009/06/02 00:58:58 merdely Exp $
--- configure.orig Mon Mar 3 12:41:58 2008
+++ configure Sun May 31 17:47:10 2009
@@ -11830,7 +11830,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
# The `*' in the case matches for architectures that use `case' in
# $output_verbose_cmd can trigger glob expansion during the loop
# eval without this substitution.
- output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
+ output_verbose_link_cmd="`$echo \"$output_verbose_link_cmd\" | $Xsed -e "$no_glob_subst"`"
for p in `eval $output_verbose_link_cmd`; do
case $p in
@@ -20209,9 +20209,9 @@ else
CFLAGS="-O20 -ffast-math -D__NO_MATH_INLINES -fsigned-char -mv8"
PROFILE="-pg -g -O20 -D__NO_MATH_INLINES -fsigned-char -mv8" ;;
*)
- DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char"
- CFLAGS="-O20 -D__NO_MATH_INLINES -fsigned-char"
- PROFILE="-O20 -g -pg -D__NO_MATH_INLINES -fsigned-char" ;;
+ DEBUG="${DEBUG} -Wall -D__NO_MATH_INLINES -fsigned-char"
+ CFLAGS="${CFLAGS} -D__NO_MATH_INLINES -fsigned-char"
+ PROFILE="${PROFILE} -pg -D__NO_MATH_INLINES -fsigned-char" ;;
esac
fi

View File

@ -0,0 +1,69 @@
$OpenBSD: patch-drivers_freetds_dbd_freetds.c,v 1.1.1.1 2009/06/02 00:58:58 merdely Exp $
From FreeBSD.
--- drivers/freetds/dbd_freetds.c.orig Mon Dec 31 17:10:44 2007
+++ drivers/freetds/dbd_freetds.c Sun May 31 16:36:09 2009
@@ -454,6 +454,7 @@ dbi_result_t *dbd_list_tables(dbi_conn_t * conn, const
{
dbi_result_t *res;
char *sql_cmd;
+ char *current_db = NULL;
if (db == NULL || db[0] == '\0') {
/* Use current database */
@@ -461,7 +462,6 @@ dbi_result_t *dbd_list_tables(dbi_conn_t * conn, const
return res;
}
- char *current_db = NULL;
if (conn->current_db)
/* Reserved current DB name */
current_db = strdup(conn->current_db);
@@ -509,9 +509,9 @@ size_t dbd_quote_string(dbi_driver_t * driver, const c
{
/* foo's -> 'foo''s' */
size_t len;
+ const char *escaped = "\'";
strcpy(dest, "\'");
- const char *escaped = "\'";
len = _dbd_freetds_escape_chars(dest + 1, orig, strlen(orig), escaped);
@@ -560,6 +560,8 @@ dbi_result_t *dbd_query(dbi_conn_t * conn, const char
* everything else will be filled in by DBI */
unsigned int idx = 0;
+ unsigned short type = 0;
+ unsigned int attribs = 0;
dbi_result_t *result = NULL;
dbi_row_t *row = NULL;
FREETDSCON *tdscon = (FREETDSCON *) conn->connection;
@@ -629,9 +631,6 @@ dbi_result_t *dbd_query(dbi_conn_t * conn, const char
return NULL;
}
- unsigned short type = 0;
- unsigned int attribs = 0;
-
_translate_freetds_type(datafmt[idx], &type, &attribs);
/* Fill fields value in result */
_dbd_result_add_field(result, idx, datafmt[idx]->name, type, attribs);
@@ -885,6 +884,7 @@ dbi_row_t *_dbd_freetds_buffers_binding(dbi_conn_t * c
dbi_row_t *row = NULL;
unsigned int idx = 0;
void *addr = NULL;
+ char **orig;
FREETDSCON *tdscon = (FREETDSCON *) conn->connection;
@@ -912,8 +912,7 @@ dbi_row_t *_dbd_freetds_buffers_binding(dbi_conn_t * c
dstfmt.format = CS_FMT_UNUSED;
addr = malloc(sizeof(CS_NUMERIC_TYPE));
- char **orig =
- &(result->rows[result->numrows_matched]->field_values[idx].d_string);
+ orig = &(result->rows[result->numrows_matched]->field_values[idx].d_string);
if (cs_convert(tdscon->ctx, datafmt[idx], *orig, &dstfmt, addr, NULL) !=
CS_SUCCEED) {

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-drivers_mysql_Makefile_in,v 1.1.1.1 2009/06/02 00:58:58 merdely Exp $
--- drivers/mysql/Makefile.in.orig Mon Jun 1 19:52:11 2009
+++ drivers/mysql/Makefile.in Mon Jun 1 19:53:08 2009
@@ -589,7 +589,7 @@ dbd_mysql.pdf: dbd_mysql.sgml
dbd_mysql/*: dbd_mysql.sgml
@echo "Converting dbd_mysql.sgml to HTML...";
- mkdir -p dbd_mysql && cd dbd_mysql && openjade -t sgml -d $(top_srcdir)/../doc/include/doc-html.dsl ../dbd_mysql.sgml
+ mkdir -p dbd_mysql && cd dbd_mysql && openjade -t sgml -d $(top_srcdir)/../doc/include/doc-html.dsl ${LOCALBASE}/share/sgml/docbook/4.1/docbook.dcl ${LOCALBASE}/share/sgml/docbook/dsssl/modular/dtds/decls/docbook.dcl ../dbd_mysql.sgml
maintainer-clean: clean
rm -f dbd_mysql.pdf dbd_mysql/*

View File

@ -0,0 +1,5 @@
The libdbi-drivers project provides the database-specific drivers for
the libdbi framework. The current version of libdbi-drivers will work
with any 0.8.x release of the framework.
This package has the FreeTDS driver.

View File

@ -0,0 +1,5 @@
The libdbi-drivers project provides the database-specific drivers for
the libdbi framework. The current version of libdbi-drivers will work
with any 0.8.x release of the framework.
This package has the MySQL driver.

View File

@ -0,0 +1,5 @@
The libdbi-drivers project provides the database-specific drivers for
the libdbi framework. The current version of libdbi-drivers will work
with any 0.8.x release of the framework.
This package has the PostgreSQL driver.

View File

@ -0,0 +1,5 @@
The libdbi-drivers project provides the database-specific drivers for
the libdbi framework. The current version of libdbi-drivers will work
with any 0.8.x release of the framework.
This package has the sqlite driver.

View File

@ -0,0 +1,5 @@
The libdbi-drivers project provides the database-specific drivers for
the libdbi framework. The current version of libdbi-drivers will work
with any 0.8.x release of the framework.
This package has the sqlite3 driver.

View File

@ -0,0 +1,2 @@
@comment $OpenBSD: PFRAG.shared-freetds,v 1.1.1.1 2009/06/02 00:58:58 merdely Exp $
lib/dbd/libdbdfreetds.so

View File

@ -0,0 +1,2 @@
@comment $OpenBSD: PFRAG.shared-main,v 1.1.1.1 2009/06/02 00:58:58 merdely Exp $
lib/dbd/libdbdmysql.so

View File

@ -0,0 +1,2 @@
@comment $OpenBSD: PFRAG.shared-pgsql,v 1.1.1.1 2009/06/02 00:58:58 merdely Exp $
lib/dbd/libdbdpgsql.so

View File

@ -0,0 +1,2 @@
@comment $OpenBSD: PFRAG.shared-sqlite,v 1.1.1.1 2009/06/02 00:58:58 merdely Exp $
lib/dbd/libdbdsqlite.so

View File

@ -0,0 +1,2 @@
@comment $OpenBSD: PFRAG.shared-sqlite3,v 1.1.1.1 2009/06/02 00:58:58 merdely Exp $
lib/dbd/libdbdsqlite3.so

View File

@ -0,0 +1,5 @@
@comment $OpenBSD: PLIST-freetds,v 1.1.1.1 2009/06/02 00:58:58 merdely Exp $
%%SHARED%%
lib/dbd/
lib/dbd/libdbdfreetds.a
lib/dbd/libdbdfreetds.la

View File

@ -0,0 +1,26 @@
@comment $OpenBSD: PLIST-main,v 1.1.1.1 2009/06/02 00:58:58 merdely Exp $
%%SHARED%%
lib/dbd/
lib/dbd/libdbdmysql.a
lib/dbd/libdbdmysql.la
share/doc/libdbi-drivers/
share/doc/libdbi-drivers/dbd_mysql/
share/doc/libdbi-drivers/dbd_mysql.pdf
share/doc/libdbi-drivers/dbd_mysql/c168.html
share/doc/libdbi-drivers/dbd_mysql/c173.html
share/doc/libdbi-drivers/dbd_mysql/c35.html
share/doc/libdbi-drivers/dbd_mysql/c39.html
share/doc/libdbi-drivers/dbd_mysql/c40.html
share/doc/libdbi-drivers/dbd_mysql/c44.html
share/doc/libdbi-drivers/dbd_mysql/c93.html
share/doc/libdbi-drivers/dbd_mysql/c98.html
share/doc/libdbi-drivers/dbd_mysql/copying-fdl.html
share/doc/libdbi-drivers/dbd_mysql/f24.html
share/doc/libdbi-drivers/dbd_mysql/f29.html
share/doc/libdbi-drivers/dbd_mysql/index.html
share/doc/libdbi-drivers/dbd_mysql/x171.html
share/doc/libdbi-drivers/dbd_mysql/x176.html
share/doc/libdbi-drivers/dbd_mysql/x42.html
share/doc/libdbi-drivers/dbd_mysql/x47.html
share/doc/libdbi-drivers/dbd_mysql/x56.html
share/doc/libdbi-drivers/dbd_mysql/x61.html

View File

@ -0,0 +1,17 @@
@comment $OpenBSD: PLIST-pgsql,v 1.1.1.1 2009/06/02 00:58:58 merdely Exp $
%%SHARED%%
lib/dbd/
lib/dbd/libdbdpgsql.a
lib/dbd/libdbdpgsql.la
share/doc/libdbi-drivers/
share/doc/libdbi-drivers/dbd_pgsql/
share/doc/libdbi-drivers/dbd_pgsql.pdf
share/doc/libdbi-drivers/dbd_pgsql/copying-fdl.html
share/doc/libdbi-drivers/dbd_pgsql/f30.html
share/doc/libdbi-drivers/dbd_pgsql/index.html
share/doc/libdbi-drivers/dbd_pgsql/install-build.html
share/doc/libdbi-drivers/dbd_pgsql/install-prereq.html
share/doc/libdbi-drivers/dbd_pgsql/install.html
share/doc/libdbi-drivers/dbd_pgsql/intro.html
share/doc/libdbi-drivers/dbd_pgsql/options.html
share/doc/libdbi-drivers/dbd_pgsql/specific.html

View File

@ -0,0 +1,28 @@
@comment $OpenBSD: PLIST-sqlite,v 1.1.1.1 2009/06/02 00:58:58 merdely Exp $
%%SHARED%%
lib/dbd/
lib/dbd/libdbdsqlite.a
lib/dbd/libdbdsqlite.la
share/doc/libdbi-drivers/
share/doc/libdbi-drivers/dbd_sqlite/
share/doc/libdbi-drivers/dbd_sqlite.pdf
share/doc/libdbi-drivers/dbd_sqlite/c100.html
share/doc/libdbi-drivers/dbd_sqlite/c118.html
share/doc/libdbi-drivers/dbd_sqlite/c126.html
share/doc/libdbi-drivers/dbd_sqlite/c26.html
share/doc/libdbi-drivers/dbd_sqlite/c34.html
share/doc/libdbi-drivers/dbd_sqlite/c37.html
share/doc/libdbi-drivers/dbd_sqlite/c45.html
share/doc/libdbi-drivers/dbd_sqlite/c92.html
share/doc/libdbi-drivers/dbd_sqlite/copying-fdl.html
share/doc/libdbi-drivers/dbd_sqlite/f15.html
share/doc/libdbi-drivers/dbd_sqlite/f23.html
share/doc/libdbi-drivers/dbd_sqlite/index.html
share/doc/libdbi-drivers/dbd_sqlite/x121.html
share/doc/libdbi-drivers/dbd_sqlite/x129.html
share/doc/libdbi-drivers/dbd_sqlite/x197.html
share/doc/libdbi-drivers/dbd_sqlite/x205.html
share/doc/libdbi-drivers/dbd_sqlite/x40.html
share/doc/libdbi-drivers/dbd_sqlite/x48.html
share/doc/libdbi-drivers/dbd_sqlite/x54.html
share/doc/libdbi-drivers/dbd_sqlite/x62.html

View File

@ -0,0 +1,28 @@
@comment $OpenBSD: PLIST-sqlite3,v 1.1.1.1 2009/06/02 00:58:58 merdely Exp $
%%SHARED%%
lib/dbd/
lib/dbd/libdbdsqlite3.a
lib/dbd/libdbdsqlite3.la
share/doc/libdbi-drivers/
share/doc/libdbi-drivers/dbd_sqlite3/
share/doc/libdbi-drivers/dbd_sqlite3.pdf
share/doc/libdbi-drivers/dbd_sqlite3/c102.html
share/doc/libdbi-drivers/dbd_sqlite3/c120.html
share/doc/libdbi-drivers/dbd_sqlite3/c128.html
share/doc/libdbi-drivers/dbd_sqlite3/c26.html
share/doc/libdbi-drivers/dbd_sqlite3/c34.html
share/doc/libdbi-drivers/dbd_sqlite3/c39.html
share/doc/libdbi-drivers/dbd_sqlite3/c47.html
share/doc/libdbi-drivers/dbd_sqlite3/c94.html
share/doc/libdbi-drivers/dbd_sqlite3/copying-fdl.html
share/doc/libdbi-drivers/dbd_sqlite3/f15.html
share/doc/libdbi-drivers/dbd_sqlite3/f23.html
share/doc/libdbi-drivers/dbd_sqlite3/index.html
share/doc/libdbi-drivers/dbd_sqlite3/x123.html
share/doc/libdbi-drivers/dbd_sqlite3/x131.html
share/doc/libdbi-drivers/dbd_sqlite3/x195.html
share/doc/libdbi-drivers/dbd_sqlite3/x203.html
share/doc/libdbi-drivers/dbd_sqlite3/x42.html
share/doc/libdbi-drivers/dbd_sqlite3/x50.html
share/doc/libdbi-drivers/dbd_sqlite3/x56.html
share/doc/libdbi-drivers/dbd_sqlite3/x64.html