Skip to content
Permalink
Browse files

add postgis support, ensure gcc4 on darwin8, use startupitem-code to …

…gain more flexibility, fix contrib build/install, increment revision

git-svn-id: https://svn.macports.org/repository/macports/trunk/dports@14692 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
Markus W. Weißmann
Markus W. Weißmann committed Oct 18, 2005
1 parent 8dea5da commit a6b0e4c560e30661c7ff4dc0b71c2aa5ef4201b2
Showing with 50 additions and 120 deletions.
  1. +50 −25 databases/postgresql8/Portfile
  2. +0 −95 databases/postgresql8/files/patch-PostgreSQL.darwin
@@ -1,9 +1,10 @@
# $Id: Portfile,v 1.25 2005/10/05 13:33:11 mww Exp $
# $Id: Portfile,v 1.26 2005/10/18 19:09:51 mww Exp $

PortSystem 1.0

name postgresql8
version 8.0.4
revision 1
categories databases
platforms darwin
maintainers mww@opendarwin.org
@@ -12,21 +13,29 @@ 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.
integrity. Includes support for postgis.

homepage http://www.postgresql.org/
master_sites postgresql:source/v${version} \
ftp://ftp.postgresql.org/pub/source/v${version}/
ftp://ftp.postgresql.org/pub/source/v${version}/ \
http://postgis.refractions.net/download/:postgis
set dbase postgresql-base-${version}.tar.bz2
set dopt postgresql-opt-${version}.tar.bz2
set dtest postgresql-test-${version}.tar.bz2
distfiles ${dbase} ${dopt} ${dtest}
set postgis postgis-1.0.4.tar.gz
distfiles ${dbase} ${dopt} ${dtest} ${postgis}:postgis

checksums ${dbase} md5 ece2604b7bc6c4c460d34113b1542725 \
${dopt} md5 27b8817f6ad1b81b55cdc8da55ed8295 \
${dtest} md5 2db4d072a359b5f62de96c10022ab8b8
patchfiles patch-PostgreSQL.darwin
${dtest} md5 2db4d072a359b5f62de96c10022ab8b8 \
${postgis} md5 b5a260c9ffdc663665b991f8016b7b85
use_bzip2 yes
extract.only ${dbase} ${dopt} ${dtest}
post-extract {
set con ${worksrcpath}/contrib
system "cd ${con} && gunzip -dc ${distpath}/${postgis} | gnutar --no-same-owner -xf -"
file rename ${con}/postgis-1.0.4 ${con}/postgis
}

depends_lib port:readline \
port:openssl \
@@ -63,18 +72,22 @@ test.run yes
test.target check

set dbdir ${prefix}/var/db/pgsql8/defaultdb
set contribs "pg_autovacuum tsearch2"
set logdir ${prefix}/var/log/pgsql8
set dbuser postgres8
set dbgrp postgres
set contribs "pg_autovacuum postgis tsearch2"

post-build {
foreach contrib { ${contribs} } {
system "cd ${worksrcpath}/contrib/${contrib} && ${build.cmd}"
foreach contrib ${contribs} {
system "cd ${worksrcpath}/contrib/${contrib}/ && ${build.cmd}"
}
}

post-destroot {
foreach contrib { ${contribs} } {
system "cd ${worksrcpath}/contrib/${contrib} && \
${build.cmd} install ${destroot.destdir}"
foreach contrib ${contribs} {
system "echo contrib: \"${contrib}\""
system "cd ${worksrcpath}/contrib/${contrib}/ && \
${build.cmd} install ${destroot.destdir} && touch DONE"
}
system "cd ${destroot}${prefix}/bin && ln -sf ${libdir}/bin/psql psql8"
file delete -force ${destroot}${prefix}/share/doc/${name}
@@ -86,29 +99,41 @@ variant python {
configure.env-append PYTHON=${prefix}/bin/python2.4
}

platform darwin 8 {
configure.env-append CC=/usr/bin/gcc-4.0 CPP=/usr/bin/cpp-4.0 CXX=/usr/bin/g++-4.0
}

variant server {
startupitem.create yes
startupitem.init \
"PGCTL=${libdir}/bin/pg_ctl"
startupitem.start \
"su ${dbuser} -c \"\${PGCTL} -D \${POSTGRESQL8DATA:=${dbdir}} start -l ${logdir}/postgres.log\""
startupitem.stop \
"su ${dbuser} -c \"\${PGCTL} -D \${POSTGRESQL8DATA:=${dbdir}} stop -s -m fast\""

pre-destroot {
set startupdir ${destroot}/Library/StartupItems/PostgreSQL8
set contrib ${worksrcpath}/contrib/start-scripts
xinstall -m 755 -d ${startupdir}
xinstall -m 755 ${contrib}/PostgreSQL.darwin ${startupdir}/PostgreSQL8
xinstall -m 644 ${contrib}/StartupParameters.plist.darwin \
${startupdir}/StartupParameters.plist
reinplace "s|__PREFIX__|${prefix}|g" ${startupdir}/PostgreSQL8
addgroup postgres
set gid [existsgroup postgres]
adduser postgres8 shell=/bin/sh gid=${gid} \
addgroup ${dbgrp}
set gid [existsgroup ${dbgrp}]
adduser ${dbuser} shell=/bin/sh gid=${gid} \
home=${prefix}/var/db/pgsql8 \
realname=PostgreSQL-8\ Server
xinstall -m 755 -d ${destroot}${logdir}
system "touch ${destroot}${logdir}/postgres.log"
system "chown ${dbuser}:${dbgrp} ${destroot}${logdir}/postgres.log"
}

post-install {
ui_msg "\nTo create a database instance, after install do\n\
sudo mkdir -p ${dbdir}\n\
sudo chown postgres8:postgre ${dbdir}\n\
sudo su postgres8 -c \'${libdir}/bin/initdb -D ${dbdir}\'"
sudo chown ${dbuser}:postgre ${dbdir}\n\
sudo su ${dbuser} -c \'${libdir}/bin/initdb -D ${dbdir}\'"
ui_msg "\nTo activate the PostgreSQL8 server, add\n\
POSTGRESQL8=-YES-\n\
to your ${prefix}/etc/rc.local"
to your ${prefix}/etc/rc.conf"
ui_msg "\nTo change the location of your database, add\n\
POSTGRESQL8DATA=/location\n\
to your ${prefix}/etc/rc.conf"
}
}

This file was deleted.

0 comments on commit a6b0e4c

Please sign in to comment.
You can’t perform that action at this time.