# $Id: Portfile,v 1.37 2004/03/13 07:03:04 mww Exp $ PortSystem 1.0 name postgresql version 7.4.2 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 54a03da34c8520635957f833a4a077ee use_bzip2 yes 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 # Choose a reasonable default for most platforms set tclconfig ${prefix}/lib set tclsh ${prefix}/bin/tclsh8.4 platform darwin 7 { global tclconfig tclsh set tclconfig /System/Library/Frameworks/Tcl.framework set tclsh /usr/bin/tclsh8.4 } variant devel { destroot.target-append install-all-headers } variant ssl { depends_lib-append lib:libssl:openssl configure.args-append --with-openssl } variant rendezvous { configure.args-append --with-rendezvous } variant perl { configure.args-append --with-perl depends_lib-append lib:perl:perl5.8 } variant java { configure.args-append --with-java depends_build bin:ant:apache-ant depends_lib-append bin:java:kaffe configure.env-append ANT=${prefix}/java/apache-ant/bin/ant } variant tcltk { global tclconfig tclsh configure.args-append --with-tcl \ --with-tclconfig=${tclconfig} \ --with-tkconfig=$prefix/lib configure.env-append TCLSH=${tclsh} depends_lib-append lib:tcl8.4:tcl \ 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 #Breaks for binaries, need post-deploy addgroup postgres set gid [existsgroup postgres] adduser postgres home=${prefix} shell=/bin/sh gid=${gid} \ realname=Postgres\ Server file mkdir ${destroot}${prefix}/etc/rc.d \ ${destroot}${prefix}/var/log/pgsql \ ${destroot}${prefix}/var/db/pgsql file copy ${portpath}/files/pgsql.sh \ ${destroot}${prefix}/etc/rc.d system "touch ${destroot}${prefix}/var/log/pgsql/pgsql.log \ ${destroot}${prefix}/var/db/pgsql/.turd" #yikes, dirty .turd hack file attributes ${destroot}${prefix}/var/db/pgsql \ -group postgres -owner postgres file attributes ${destroot}${prefix}/var/log/pgsql \ -group postgres -owner postgres file attributes ${destroot}${prefix}/var/db/pgsql/.turd \ -group postgres -owner postgres file attributes ${destroot}${prefix}/var/log/pgsql/pgsql.log \ -group postgres -owner postgres 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}] { file mkdir ${destroot}${dbdir} } #Requires post-deploy. #system "su postgres -c \'${prefix}/bin/initdb -D ${dbdir}\'" ui_msg "\nTo create a database instance, after install do\n\ su postgres -c \'${prefix}/bin/initdb -D ${dbdir}\'" } }