# $Id: Portfile,v 1.22 2003/03/03 06:13:25 mij Exp $ PortSystem 1.0 name postgresql version 7.2.1 categories databases maintainers eric@opendarwin.org description The most advanced open-source database available anywhere 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. 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 e294084800e9470d582b57e3d38ec247 worksrcdir ${portname}-${portversion} set origprefix ${prefix} set prefix ${prefix}/pgsql build.type gnu variant darwin { patchfiles patch-ipc.c patch-proc.c patch-spin.c patch-sem.h \ patch-Makefile patch-Makefile.darwin patch-Makefile.shlib \ 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-install { set dbdir ${prefix}/defaultdb if [file exists ${dbdir}] { return } addgroup postgres set gid [existsgroup postgres] adduser postgres home=${prefix} shell=/bin/sh gid=${gid} \ realname=Postgres\ Server system "install -o root -m 755 -d ${origprefix}/etc/rc.d" system "install -o root -m 755 -c ${portpath}/files/pgsql.sh \ ${origprefix}/etc/rc.d" reinplace "s|__PREFIX|${prefix}|g" \ ${origprefix}/etc/rc.d/pgsql.sh reinplace "s|__DBDIR|${dbdir}|g" ${origprefix}/etc/rc.d/pgsql.sh contents-append etc/rc.d/pgsql.sh system "install -o postgres -g postgres -m 700 -d ${prefix}/log" system "install -o postgres -g postgres -m 700 -d ${dbdir}" system "su postgres -c \'${prefix}/bin/initdb -D ${dbdir}\'" reinplace "s|#tcpip_socket = false|tcpip_socket = true|" \ ${dbdir}/postgresql.conf } }