# $Id: Portfile 53336 2009-07-03 19:24:24Z jwa@macports.org $

PortSystem 1.0

name		pgAdmin3
version		1.10.0

categories	aqua
maintainers	jwa

description	An administration program to PostgreSQL
long_description pgAdmin III is a powerful administration and development \
    platform for the PostgreSQL database, free for any use. The \
    application works on several platforms, e.g. GNU/Linux, FreeBSD, \
    OS X and Windows 2000/XP. This port is for OS X.

platforms	macosx
homepage	http://www.pgadmin.org/

master_sites	http://developer.pgadmin.org/ftp/release/v${version}/src/ \
    http://www.postgresql.org/ftp/pgadmin3/release/v${version}/src/

distname	pgadmin3-${version}

checksums           md5     3f2032c78657e3db4e0719613751060c \
                    sha1    1ad2b46d6859371eadd0f1b4bb200d042e8f39c2 \
                    rmd160  1530e0b614b37a5feac9bbe61c7c95657a3c8a5b

depends_lib	port:postgresql84 \
    port:wxWidgets \
    port:openssl \
    port:libxml2 \
    port:libxslt

configure.args	--with-pgsql=${prefix}/lib/postgresql84 \
    --with-wx=${prefix} \
    --with-wx-version=2.8 \
    --with-libxml2=${prefix} \
    --with-libxslt=${prefix} \
    --enable-appbundle

build.target	all install

#destroot.violate_mtree	yes
destroot {
    xinstall -d -m 0755 ${destroot}${applications_dir}
    file copy ${worksrcpath}/${name}.app ${destroot}${applications_dir}/${name}.app
}

variant with_postgresql82 conflicts with_postgresql83 \
    description {support for PostgreSQL 8.2.x} {
	depends_lib-delete	port:postgresql84
	depends_lib-delete	--with-pgsql=${prefix}/lib/postgresql84
	depends_lib-append	port:postgresql82
	configure.args-append	--with-pgsql=${prefix}/lib/postgresql82
}

variant with_postgresql83 conflicts with_postgresql82 \
    description {support for PostgreSQL 8.3.x} {
	depends_lib-delete	port:postgresql84
	depends_lib-delete	--with-pgsql=${prefix}/lib/postgresql84
	depends_lib-append	port:postgresql83
	configure.args-append	--with-pgsql=${prefix}/lib/postgresql83
}

variant debug description {provide a debug build in case of difficulties} {
    configure.args-append	--enable-debug
}

livecheck.check	regex
livecheck.url	${homepage}
livecheck.regex	pgAdmin v(1\\.\[0-9\]+\\.\[0-9\]+)
