# $Id: Portfile 58230 2009-09-24 16:45:22Z ryandesign@macports.org $

PortSystem 1.0

name		libgda3
version		3.0.4
revision	1
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	jwa openmaintainer
categories	databases gnome
platforms	darwin
homepage	http://www.gnome-db.org/
distname	libgda-${version}
master_sites    gnome:sources/libgda/3.0/
use_bzip2	yes
checksums       md5     1096d03d64ee50f98a59ef5e7f906c9c \
                sha1    50ba121e05ab1fbe95b66e8df4f54a0c6a30ef23 \
                rmd160  6efbf5a0f40277124dcc5464168677cc97be40e3


depends_lib	\
	port:gettext \
	port:libiconv \
	port:libxml2 \
	port:ncurses \
	port:p5-xml-parser \
	path:bin/perl:perl5 \
	port:readline \
	port:zlib \
	path:lib/pkgconfig/glib-2.0.pc:glib2

depends_build	\
	port:flex \
	port:m4 \
	port:pkgconfig \
	port:gnome-doc-utils

configure.perl  ${prefix}/bin/perl
configure.env-append  INTLTOOL_PERL=${configure.perl}

configure.args  --mandir=${prefix}/share/man

post-configure {
	fs-traverse file ${worksrcpath} {
		if [string match {/Makefile$} ${file}] {
			reinplace "s|-ldb|-lbd-4|g" ${file}
		}
	}
}

default_variants +with_bdb46

variant with_mysql4 conflicts with_mysql5 \
    description {support for MySQL 4.x} {
	depends_lib-append	port:mysql4
	configure.args-append	--with-mysql=${prefix}
}

variant with_mysql5 conflicts with_mysql4 \
    description {support for current MySQL 5.x} {
	depends_lib-append	path:bin/mysql_config5:mysql5
	configure.env-append	\
		MYSQL_CONFIG=${prefix}/lib/mysql5/bin/mysql_config
	configure.args-append	--with-mysql=${prefix}/lib/mysql5
	configure.cppflags-append	"-I${prefix}/include/mysql5/mysql"
}

variant with_postgresql82 conflicts with_postgresql83 \
    description {support for PostgreSQL 8.2.x} {
	configure.cppflags-append	"-I${prefix}/include/postgresql82"
	configure.ldflags-append	"-L${prefix}/lib/postgresql82"
	depends_lib-append	port:postgresql82
	configure.args-append	--with-postgres
#	configure.args-append	--with-postgres=${prefix}/lib/postgresql82
}

variant with_postgresql83 conflicts with_postgresql82 \
    description {support for PostgreSQL 8.3.x} {
	configure.cppflags-append	"-I${prefix}/include/postgresql83"
	configure.ldflags-append	"-L${prefix}/lib/postgresql83"
	depends_lib-append	port:postgresql83
	configure.args-append	--with-postgres
}

variant with_bdb46 conflicts without_bdb with_bdb \
    description {support for Berkeley DB 4.6} {
	depends_lib-append	port:db46
	configure.args-append	--with-bdb=${prefix}
	configure.cppflags-append	"-I${prefix}/include/db46"
	configure.ldflags-append	"-L${prefix}/lib/db46"
	
}

variant without_bdb conflicts with_bdb with_bdb46 \
    description {remove support for Berkeley DB} {
	configure.args-append	--without-bdb
}

livecheck.type		regex
livecheck.url		http://ftp.gnome.org/pub/GNOME/sources/libgda/3.0
livecheck.regex		LATEST-IS-(3\.0\.\[0-9\]+)
