# $Id: Portfile,v 1.24.2.1 2003/08/03 08:52:54 jkh Exp $ PortSystem 1.0 name postgresql version 7.3.2 categories databases maintainers eric@opendarwin.org description The most advanced open-source database available anywhere homepage http://www.postgresql.org/ platforms darwin freebsd set subdir source/v${portversion} master_sites ftp://ftp2.ch.postgresql.org/mirror/postgresql/${subdir}/ \ ftp://ftp.postgresql.org/pub/${subdir}/ \ ftp://ftp.de.postgresql.org/mirror/postgresql/${subdir}/ distname ${portname}-base-${portversion} checksums md5 2cd99c2d455c653fdfe74f5dd658d15c worksrcdir ${portname}-${portversion} depends_lib lib:readline:readline configure.env CPPFLAGS=-I/opt/local/include CFLAGS=-I/opt/local/include \ LDFLAGS=-L/opt/local/lib build.env CPPFLAGS=-I/opt/local/include CFLAGS=-I/opt/local/include \ LDFLAGS=-L/opt/local/lib configure.args --docdir=${prefix}/share/doc/${name}-${version} \ --datadir=${prefix}/share/${name}-${version} \ --sysconfdir=${prefix}/etc/pgsql build.type gnu variant darwin { patchfiles patch-Makefile patch-Makefile.darwin \ patch-Makefile.shlib patch-proc.mk \ patch-plpgsql-Makefile post-patch { reinplace "s|__PREFIX|${prefix}|g" \ "${workpath}/${worksrcdir}/src/Makefile.shlib" } } variant server { depends_run path:/Library/StartupItems/DarwinPortsStartup:DarwinPortsStartup post-destroot { set dbdir ${prefix}/var/db/pgsql/defaultdb #XXX Breaks for binaries, need post-deploy addgroup postgres set gid [existsgroup postgres] adduser postgres home=${prefix} shell=/bin/sh gid=${gid} \ realname=Postgres\ Server system "install -v -d ${destroot}${prefix}/etc/rc.d" system "install -v -d ${destroot}${prefix}/etc/pgsql" system "install -v -c ${portpath}/files/pgsql.sh \ ${destroot}${prefix}/etc/rc.d" system "install -v -c \ ${destroot}/${prefix}/share/${name}-${version}/postgresql.conf.sample \ ${destroot}${prefix}/etc/pgsql/postgresql.conf" system "install -v -d ${destroot}${prefix}/var/log/" system "install -v -d ${destroot}${prefix}/var/log/pgsql/" system "touch ${destroot}${prefix}/var/log/pgsql/pgsql.log" system "install -v -d ${destroot}${prefix}/var/db/pgsql/" #XXX yikes, dirty .turd hack system "touch ${destroot}${prefix}/var/db/pgsql/.turd" system "chown -R postgres ${destroot}${prefix}/var/db/pgsql" system "chgrp -R postgres ${destroot}${prefix}/var/db/pgsql" system "chown -R postgres ${destroot}${prefix}/var/log/pgsql" system "chgrp -R postgres ${destroot}${prefix}/var/log/pgsql" reinplace "s|__PREFIX|${prefix}|g" \ ${destroot}${prefix}/etc/rc.d/pgsql.sh reinplace "s|__LOGDIR|${prefix}/var/log/pgsql|g" \ ${destroot}${prefix}/etc/rc.d/pgsql.sh reinplace "s|__DBDIR|${dbdir}|g" ${destroot}${prefix}/etc/rc.d/pgsql.sh reinplace "s|#tcpip_socket = false|tcpip_socket = true|" \ ${destroot}${prefix}/etc/pgsql/postgresql.conf if [file exists ${dbdir}] { return } system "install -v -d ${destroot}${dbdir}" ## Requires post-deploy. # system "su postgres -c \'${prefix}/bin/initdb -D ${dbdir}\'" } } long_description \ PostgreSQL is Object-Relational Database Management System. It supports \ almost all SQL constructs, including transactions, subselects, \ and user-defined types and functions. Write-ahead logging means \ increased performance while retaining data integrity.