# $Id: Portfile,v 1.14 2006/08/06 11:16:01 rhwood Exp $

PortSystem 1.0
name		libgda
version		1.3.91
description	GDA provides uniform access to diffent kinds of data sources.
long_description	GNU Data Access (GDA) is an attempt to provide \
			uniform access to different kinds of data sources \
			(databases, information servers, mail spools, etc).
maintainers	gnome-darwinports@opendarwin.org
categories	gnome 
platforms	darwin 
homepage	http://www.gnome-db.org/
master_sites    gnome:sources/libgda/1.3/
checksums	md5 6e397127c9a3d8f229fb0c1a0c0572f2
use_bzip2	yes

depends_lib	\
	port:libxslt \
	port:glib2

depends_build	port:gnome-doc-utils

configure.env   CPPFLAGS="-I${prefix}/include -I${prefix}/include/db4" \
                CFLAGS="-no-cpp-precomp -flat_namespace -undefined suppress"  \
                LDFLAGS="-L${prefix}/lib"
configure.args  --mandir=${prefix}/share/man

post-configure {
	cd ${worksrcpath}
	reinplace "s|-ldb|-ldb-4|g" \
		Makefile data/Makefile \
		doc/C/Makefile doc/Makefile \
		libgda/Makefile libsql/Makefile \
		providers/Makefile \
		providers/bdb/Makefile \
		providers/firebird/Makefile \
		providers/freetds/Makefile \
		providers/ibmdb2/Makefile \
		providers/ldap/Makefile \
		providers/mdb/Makefile \
		providers/mdb/Makefile \
		providers/msql/Makefile \
		providers/mysql/Makefile \
		providers/odbc/Makefile \
		providers/oracle/Makefile \
		providers/postgres/Makefile \
		providers/sqlite/Makefile \
		providers/xbase/Makefile \
		providers/sybase/Makefile \
		providers/xml/Makefile \
		report/Makefile \
		report/libgda-report/Makefile \
		report/testing/Makefile \
		testing/Makefile \
		tools/Makefile
}

variant with_mysql3 conflicts with_mysql4 with_mysql5 {
	depends_lib-append	port:mysql
	configure.args-append	--with-mysql=${prefix}
}

variant with_mysql4 conflicts with_mysql3 with_mysql5 {
	depends_lib-append	port:mysql4
	configure.args-append	--with-mysql=${prefix}
}

variant with_mysql5 conflicts with_mysql3 with_mysql4 {
	depends_lib-append	port:mysql5
	configure.args-append	--with-mysql=${prefix}
}

variant with_postgresql8 {
	configure.env	CPPFLAGS="-I${prefix}/include -I${prefix}/include/db4 -I${prefix}/include/pgsql8" \
		LDFLAGS="-L${prefix}/lib -L${prefix}/lib/pgsql8"
	depends_lib-append	port:postgresql8
	configure.args-append	--with-postgres=${prefix}
}

variant with_db4 {
	depends_lib-append	port:db4
	configure.args-append	--with-bdb=${prefix}
}

variant with_sqlite {
	depends_lib-append	port:sqlite
	configure.args-append	--with-sqlite=${prefix}
}
