# $Id: Portfile,v 1.29 2003/11/03 12:48:23 mww Exp $ PortSystem 1.0 name postgresql version 7.3.4 revision 1 categories databases maintainers mww@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://ftp3.us.postgresql.org/pub/postgresql/${subdir}/ \ ftp://ftp.postgresql.org/pub/${subdir}/ \ ftp://ftp.de.postgresql.org/mirror/postgresql/${subdir}/ \ ftp://ftp.fr.postgresql.org/${subdir}/ \ ftp://ftp.jp.postgresql.org/${subdir}/ \ ftp://ftp2.uk.postgresql.org/${subdir}/ checksums md5 82878d6d74c36384af3595d26ed38067 depends_lib lib:readline:readline configure.env CPPFLAGS="-I${prefix}/include" \ LDFLAGS="-L${prefix}/lib" configure.args --docdir=${prefix}/share/doc/${name}-${version} \ --datadir=${prefix}/share/${name}-${version} \ --sysconfdir=${prefix}/etc/pgsql \ --mandir=${prefix}/share/man build.type gnu test.run yes test.target check #this will propably be removed as soon as we get variant dependencies default_variants +devel variant darwin { patchfiles patch-src-Makefile.shlib \ patch-src-makefiles-Makefile.darwin \ patch-darwin.h-diff \ patch-darwin.diff } variant ssl { depends_lib-append lib:libssl:openssl configure.args-append --with-openssl } variant devel { destroot.target-append install-all-headers } variant perl { configure.args-append --with-perl depends_lib lib:perl:perl5.8 } variant java { configure.args-append --with-java depends_build bin:ant:apache-ant configure.env-append ANT=${prefix}/java/apache-ant/bin/ant } variant tcltk { configure.args-append --with-tcl \ --with-tclconfig=$prefix/lib \ --with-tkconfig=$prefix/lib configure.env-append TCLSH=${prefix}/bin/tclsh8.4 depends_lib lib:tcl8.4:tcl depends_lib lib:tk8.4:tk } variant server { depends_run path:/Library/StartupItems/DarwinPortsStartup:DarwinPortsStartup post-destroot { set dbdir ${prefix}/var/db/pgsql/defaultdb set restart_mode fast set stop_mode fast #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 -c ${portpath}/files/pgsql.sh \ ${destroot}${prefix}/etc/rc.d" 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|__RSMODE|${restart_mode}|g" \ ${destroot}${prefix}/etc/rc.d/pgsql.sh reinplace "s|__STMODE|${stop_mode}|g" \ ${destroot}${prefix}/etc/rc.d/pgsql.sh if [file exists ${dbdir}] { return } system "install -v -d ${destroot}${dbdir}" ## Requires post-deploy. # system "su postgres -c \'${prefix}/bin/initdb -D ${dbdir}\'" } }