# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 84550 2011-09-27 21:05:11Z snc@macports.org $

PortSystem		1.0
PortGroup		xcode 1.0

name			BiggerSQL
version			1.3.9
categories		aqua databases
maintainers		nomaintainer
description		SQL front-end to the postgresql DBMS

long_description	BiggerSQL is a tool that (like psql) allows you to \
				execute SQL on a PostgreSQL server. Type text into the \
				top pane,  see if it is successful in the middle pane, \
				and see the results of a query in the table at the \
				bottom.  Using tool tips, you can see the type of the \
				result -- just let your cursor linger over the column. \
				BiggerSQL builds on BigSQL.

homepage		http://homepage.mac.com/levanj/Cocoa/
master_sites	${homepage}programs/
use_dmg			yes

checksums		md5     9fcaec183ecf9f147c9b902ce65af793 \
				sha1    e0d4c44874b46ecea48cd2559e2fd19cfb36bf3e \
				rmd160  33d11bc835d2c74eddfc9fb4898c1bcb4b959d51

worksrcdir		${worksrcdir}/${name} Source

set pgglob [glob -directory ${prefix}/lib -nocomplain -tails postgresql*]
if {[llength ${pgglob}]} {
	set postgresql	[lindex ${pgglob} end]
} else {
	set postgresql	postgresql84
}

set pglibdir ${prefix}/lib/${postgresql}
depends_lib path:${pglibdir}:${postgresql}

patchfiles		patch-project.pbxproj.diff

post-patch {
	foreach {subdir} {include lib} {
		reinplace "s|/usr/local/pgsql/${subdir}|${prefix}/${subdir}/${postgresql}|" \
			${worksrcpath}/${name}.xcodeproj/project.pbxproj
	}
}

# Uses Carbon QuickTime functions?
universal_variant no
supported_archs	ppc i386

livecheck.type	regex
livecheck.url	${homepage}
livecheck.regex	"${name} v(\\d+(?:(\\.\\d+)*))"

