SUMMARY="A powerful, open source object-relational database system" 
DESCRIPTION="PostgreSQL is a powerful, open source object-relational \
database system. It has more than 15 years of active development and a \
proven architecture that has earned it a strong reputation for reliability, \
data integrity, and correctness.

It runs on all major operating systems, including Linux, UNIX (AIX, BSD, \
HP-UX, SGI IRIX, Mac OS X, Solaris, Tru64), and Windows. It is fully ACID \
compliant, has full support for foreign keys, joins, views, triggers, and \
stored procedures (in multiple languages). It includes most SQL:2008 data \
types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, \
and TIMESTAMP. It also supports storage of binary large objects, including \
pictures, sounds, or video. It has native programming interfaces for C/C++, \
Java, .Net, Perl, Python, Ruby, Tcl, ODBC, among others, and exceptional \
documentation."
HOMEPAGE="http://www.postgresql.org/"
COPYRIGHT="1996-2014, PostgreSQL Global Development Group"
LICENSE="PostgreSQL"
REVISION="1"
SOURCE_URI="http://ftp.postgresql.org/pub/source/v9.3.4/postgresql-9.3.4.tar.bz2"
CHECKSUM_SHA256="9ee819574dfc8798a448dc23a99510d2d8924c2f8b49f8228cd77e4efc8a6621"
SOURCE_DIR="postgresql-$portVersion"
PATCHES="postgresql_server-9.3.4.patchset"

ARCHITECTURES="!x86_gcc2 !x86 !x86_64"

PROVIDES="
	postgresql_server = $portVersion compat >= 9
	cmd:clusterdb = $portVersion compat >= 9
	cmd:createdb = $portVersion compat >= 9
	cmd:createlang = $portVersion compat >= 9
	cmd:createuser = $portVersion compat >= 9
	cmd:dropdb = $portVersion compat >= 9
	cmd:droplang = $portVersion compat >= 9
	cmd:dropuser = $portVersion compat >= 9
	cmd:pg_config = $portVersion compat >= 9
	cmd:pg_dump = $portVersion compat >= 9
	cmd:pg_dumpall = $portVersion compat >= 9
	cmd:pg_isready = $portVersion compat >= 9
	cmd:pg_restore = $portVersion compat >= 9
	cmd:psql = $portVersion compat >= 9
	cmd:reindexdb = $portVersion compat >= 9
	cmd:vacuumdb = $portVersion compat >= 9
	cmd:pgsql = $portVersion compat >= 9
	"
REQUIRES="
	haiku
	lib:libreadline
	lib:libz
	"

BUILD_REQUIRES="
	haiku_devel
	devel:libreadline
	devel:libz
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:gcc
	cmd:ld
	cmd:libtoolize
	cmd:make
	"

BUILD()
{
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install

	fixPkgconfig
}
