# $Id: Portfile,v 1.13 2006/01/29 11:47:22 rhwood Exp $

PortSystem 1.0
name		libgda
version		1.2.3
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.2/
checksums	md5 eb9c31c3102d542de728f5f55674d511
use_bzip2	yes

depends_lib	port:libxslt lib:libglib-2:glib2 port:p5-xml-parser \
		lib:libdb-4:db4 lib:libmysqlclient:mysql

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 mysql4 {
	depends_lib-append	port:mysql4
	configure.args-append	--with-mysql=${prefix}
}

variant postgresql {
	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 sqlite {
	depends_lib-append	lib:libsqlite:sqlite
	configure.args-append	--with-sqlite=${prefix}
}
