postgresql80-unified stable port information

Package: postgresql80-unified
Version: 8.0.17
Revision: 1
Description: PostgreSQL open-source database
License: BSD
Maintainer: Benjamin Reed

Depends: <<
daemonic (>= 20010902-1),
libxml2-shlibs,
libxslt-shlibs,
passwd (>= 20030906-1),
readline5-shlibs,
%N-shlibs (= %v-%r)
<<
BuildDepends: <<
bison,
fink (>= 0.26.0-1),
libxml2,
libxslt,
passwd (>= 20030906-1),
readline5,
system-openssl-dev
<<
Provides: postgresql-server
Conflicts: <<
postgresql (<< %v-%r),
postgresql-ssl (<< %v-%r),
postgresql73 (<< 7.3.4-14),
postgresql73-ssl (<< 7.3.4-14),
postgresql80 (<< %v-%r),
postgresql80-ssl (<< %v-%r)
<<
Replaces: <<
postgresql,
postgresql-shlibs,
postgresql-ssl,
postgresql-ssl-shlibs,
postgresql-python,
postgresql-ssl-python,
postgresql-perl,
postgresql-ssl-perl,
postgresql73,
postgresql73-ssl,
postgresql73-unified,
postgresql74,
postgresql74-ssl,
postgresql74-unified,
postgresql80,
postgresql80-ssl
<<

CustomMirror: <<
afr-ZA: ftp://ftp.za.postgresql.org/mirror/ftp.postgresql.org
asi-CN: ftp://ftp.cn.postgresql.org/ftp.postgresql.org
asi-GE: ftp://ftp.ge.postgresql.org/pub/postgresql
asi-HK: ftp://ftp.hk.postgresql.org/postgresql
asi-ID: ftp://ftp8.id.postgresql.org/pub/PostgreSQL
asi-ID: ftp://ftp9.id.postgresql.org/postgresql
asi-JP: ftp://ftp.jp.postgresql.org
asi-KR: ftp://ftp.kr.postgresql.org/mirror/database/postgresql
asi-TW: ftp://ftp.tw.postgresql.org/pub/postgresql
asi-TW: ftp://ftp3.tw.postgresql.org/pub/postgresql
asi-TW: ftp://ftp5.tw.postgresql.org/pub/Unix/Database/PostgreSQL
aus-AU: ftp://ftp.au.postgresql.org/pub/postgresql
aus-AU: ftp://ftp2.au.postgresql.org/pub/postgresql
aus-AU: ftp://ftp3.au.postgresql.org/pub/postgresql
aus-NZ: ftp://ftp.nz.postgresql.org/postgresql
eur-AT: ftp://ftp.at.postgresql.org/db/www.postgresql.org/pub
eur-BE: ftp://ftp.be.postgresql.org/postgresql
eur-BA: ftp://ftp.ba.postgresql.org/pub/postgresql
eur-BG: ftp://ftp3.bg.postgresql.org/postgresql
eur-CH: ftp://ftp2.ch.postgresql.org/mirror/postgresql
eur-CZ: ftp://ftp.cz.postgresql.org/pub/ftp.postgresql.org
eur-CZ: ftp://ftp2.cz.postgresql.org/pub/postgresql
eur-DE: ftp://ftp.de.postgresql.org/mirror/postgresql
eur-DE: ftp://ftp3.de.postgresql.org/pub/Mirrors/ftp.postgresql.org
eur-DE: ftp://ftp7.de.postgresql.org/pub/ftp.postgresql.org
eur-DE: ftp://ftp8.de.postgresql.org/pub/misc/pgsql
eur-DE: ftp://ftp9.de.postgresql.org/unix/databases/postgresql
eur-DK: ftp://ftp.dk.postgresql.org/mirrors/postgresql
eur-EE: ftp://ftp.ee.postgresql.org/mirrors/postgresql
eur-ES: ftp://ftp5.es.postgresql.org/mirror/postgresql
eur-FR: ftp://ftp.fr.postgresql.org
eur-FR: ftp://ftp2.fr.postgresql.org/postgresql
eur-FR: ftp://ftp3.fr.postgresql.org/pub/postgresql
eur-GR: ftp://ftp.gr.postgresql.org/pub/databases/postgresql
eur-GR: ftp://ftp2.gr.postgresql.org/pub/databases/postgresql
eur-HR: ftp://ftp.hr.postgresql.org/postgresql
eur-HU: ftp://ftp3.hu.postgresql.org/pub/postgresql
eur-IE: ftp://ftp.ie.postgresql.org/mirrors/ftp.postgresql.org/pub
eur-IE: ftp://ftp2.ie.postgresql.org/mirrors/ftp.postgresql.org
eur-IL: ftp://ftp.il.postgresql.org/ftp.postgresql.org
eur-IS: ftp://ftp.is.postgresql.org/pub/postgresql
eur-IT: ftp://ftp2.it.postgresql.org/mirrors/postgres
eur-IT: ftp://ftp6.it.postgresql.org/pub/PostgreSQL
eur-IT: ftp://ftp7.it.postgresql.org/pub/unix/postgres
eur-LV: ftp://ftp.lv.postgresql.org/pub/software/postgresql
eur-NL: ftp://ftp.eu.postgresql.org/pub/unix/db/postgresql
eur-NL: ftp://ftp.nl.postgresql.org:21/pub/mirror/postgresql
eur-NL: ftp://ftp2.nl.postgresql.org/mirror/postgresql
eur-NL: ftp://ftp4.nl.postgresql.org/postgresql.zeelandnet.nl
eur-NO: ftp://ftp.no.postgresql.org/pub/databases/postgresql
eur-PL: ftp://ftp6.pl.postgresql.org/pub/postgresql
eur-PL: ftp://ftp7.pl.postgresql.org/pub/mirror/ftp.postgresql.org
eur-PL: ftp://ftp8.pl.postgresql.org/pub/postgresql
eur-PT: ftp://ftp.pt.postgresql.org/postgresql
eur-RO: ftp://ftp6.ro.postgresql.org/pub/mirrors/ftp.postgresql.org
eur-RU: ftp://ftp.ru.postgresql.org/pub/mirrors/pgsql
eur-RU: ftp://ftp2.ru.postgresql.org/pub/databases/postgresql
eur-RU: ftp://ftp3.ru.postgresql.org/pub/mirror/postgresql/pub
eur-RU: ftp://ftp6.ru.postgresql.org/pub/pgsql
eur-SE: ftp://ftp.se.postgresql.org/pub/database/relational/postgresql
eur-SK: ftp://ftp2.sk.postgresql.org/pub/postgresql
eur-UK: ftp://ftp2.uk.postgresql.org/sites/ftp.postgresql.org
eur-UK: ftp://ftp4.uk.postgresql.org/sites/ftp.postgresql.org
eur-UK: ftp://ftp8.uk.postgresql.org/sites/ftp.postgresql.org
nam-CA: ftp://ftp3.ca.postgresql.org/pub
nam-CA: ftp://ftp4.ca.postgresql.org/pub/postgresql
sam-BR: ftp://ftp.br.postgresql.org/pub/PostgreSQL
sam-CL: ftp://ftp.cl.postgresql.org/ftp/pub/postgresql
sam-CO: ftp://ftp.co.postgresql.org/pub/mirrors/postgresql
nam-US: ftp://ftp.us.postgresql.org/pub/mirrors/postgresql
nam-US: ftp://ftp3.us.postgresql.org/pub/postgresql
nam-US: ftp://ftp4.us.postgresql.org/pub/postgresql
nam-US: ftp://ftp5.us.postgresql.org/pub/PostgreSQL
nam-US: ftp://ftp8.us.postgresql.org/postgresql
nam-US: ftp://ftp9.us.postgresql.org/pub/mirrors/postgresql
nam-US: ftp://ftp10.us.postgresql.org/pub/postgresql
nam-US: ftp://ftp22.us.postgresql.org/mirrors/ftp.postgresql.org
<<
Source: mirror:custom:source/v%v/postgresql-%v.tar.bz2
Source-MD5: 0154b01820cb73aeca73b9d060cb3328
PatchScript: sed -e 's|@BUILDDIR@|%b|g' -e 's|@INSTPREFIX@|%p|g' < %a/%n.patch | patch -p1

SetMAKEFLAGS: -j1
NoSetMAKEFLAGS: true
ConfigureParams: --prefix=%p --with-docdir=%p/share/doc --mandir=%p/share/man --enable-multibyte --enable-recode --with-CXX --without-perl --without-python --with-openssl --with-libraries=%p/lib --with-includes=%p/include --without-tcl --without-tk --without-java --enable-odbc --with-pam --with-rendezvous --enable-syslog --with-krb5 --enable-thread-safety
CompileScript: <<
#!/bin/sh -xe

export lt_cv_sys_max_cmd_len=65536
export CPPFLAGS="-I%p/lib/system-openssl/include -I%p/include -DHAVE_OPTRESET -fno-common"
export LDFLAGS="-L%p/lib/system-openssl/lib -L%p/lib"
export SHELL="/bin/sh -xe"

PG_ID=`id -u postgres 2>/dev/null || true`
if [ -z "$PG_ID" ]; then
echo "Whoa there! You must have a postgres user to build this package."
echo "Please do a 'fink reinstall passwd' and make sure you hit 'y' when it"
echo "asks if you want to update your users."
exit 1
fi

# postgresql
perl -pi -e 's,hardcode_direct=yes,hardcode_direct=no,g' configure && \
./configure %c && \
make includedir=%p/include/postgresql includedir_internal=%p/include/postgresql/internal includedir_server=%p/include/postgresql && \
make -C contrib
<<

InstallScript: <<
#!/bin/sh -xe

export SHELL="/bin/sh -xe"

# postgresql
make install includedir=%p/include/postgresql includedir_internal=%p/include/postgresql/internal includedir_server=%p/include/postgresql DESTDIR=%d INSTALLSITEMAN3DIR=%i/share/man/man3 || exit 10

make -C contrib install includedir=%p/include/postgresql includedir_internal=%p/include/postgresql/internal includedir_server=%p/include/postgresql DESTDIR=%d INSTALLSITEMAN3DIR=%i/share/man/man3
install -m 755 contrib/adddepend/adddepend %i/bin/adddepend

find %i/share -ls > /tmp/sharefiles-postgresql.txt
mv %i/share/doc/postgresql-8.0 %i/share/doc/%N >/dev/null 2>&1

ranlib %i/lib/*.a

install -d -m 755 %i/share/doc/%N
find contrib -name README.\* -exec cp {} %i/share/doc/%N/ \;

install -d -m 755 %i/bin
install -c -m 755 pgsql.sh %i/bin/

install -d -m 755 %i/var/postgresql-8.0
echo "be sure to back up this database before any upgrades!" >> %i/var/postgresql-8.0/README

rm -rf %i/bin/postmaster
ln -sf postgres-8.0 %i/bin/postmaster

install -d -m 755 %i/var/log
ln -sf %p/var/postgresql-8.0/pgsql.log %i/var/log/pgsql-8.0.log

for libname in libecpg.5.0 libecpg_compat.2.0 libpgtypes.2.0 libpq.4.0; do
mv %i/lib/$libname.dylib %i/lib/$libname.dylib-8.0
done

rm -rf %i/lib/libecpg.*.dylib
rm -rf %i/lib/libecpg_compat.*.dylib
rm -rf %i/lib/libpgtypes.*.dylib
rm -rf %i/lib/libpq.*.dylib

for file in `ls -1 %i/bin/`; do
mv "%i/bin/${file}" "%i/bin/${file}-8.0"
echo "${file}" >> %i/var/postgresql-8.0/binary.list
install_name_tool -change %p/lib/libpq.4.dylib %p/lib/libpq.4.0.dylib "%i/bin/${file}-8.0" >/dev/null 2>&1 || :
install_name_tool -change %p/lib/libecpg.5.dylib %p/lib/libecpg.5.0.dylib "%i/bin/${file}-8.0" >/dev/null 2>&1 || :
install_name_tool -change %p/lib/libecpg_compat.2.dylib %p/lib/libecpg_compat.2.0.dylib "%i/bin/${file}-8.0" >/dev/null 2>&1 || :
install_name_tool -change %p/lib/libpgtypes.2.dylib %p/lib/libpgtypes.2.0.dylib "%i/bin/${file}-8.0" >/dev/null 2>&1 || :
done

for file in `find %i/lib -type f`; do
install_name_tool -change %p/lib/libpq.4.dylib %p/lib/libpq.4.0.dylib "$file" >/dev/null 2>&1 || :
install_name_tool -change %p/lib/libecpg.5.dylib %p/lib/libecpg.5.0.dylib "$file" >/dev/null 2>&1 || :
install_name_tool -change %p/lib/libecpg_compat.2.dylib %p/lib/libecpg_compat.2.0.dylib "$file" >/dev/null 2>&1 || :
install_name_tool -change %p/lib/libpgtypes.2.dylib %p/lib/libpgtypes.2.0.dylib "$file" >/dev/null 2>&1 || :
done

for file in `ls -1 %i/share/man/man1/`; do
mv "%i/share/man/man1/${file}" "%i/share/man/man1/${file}-8.0"
echo "${file}" >> %i/var/postgresql-8.0/man1.list
done

for file in `ls -1 %i/share/man/man7/`; do
mv "%i/share/man/man7/${file}" "%i/share/man/man7/${file}-8.0"
echo "${file}" >> %i/var/postgresql-8.0/man7.list
done

cat < %i/var/postgresql-8.0/remove-alternatives.sh
#!/bin/sh

for arg in "\$@"; do
case \$arg in
-h|--h|--he|--hel|--help)
echo "usage: \$0 [-h]"
echo ""
echo " -h, --help this help"
echo ""
exit 0;
;;
*)
echo "\$0: unknown argument '\$arg'"
exit 1;
;;
esac
done

update-alternatives --remove "libecpg.5.0.dylib" "%p/lib/libecpg.5.0.dylib-8.0"
update-alternatives --remove "libecpg.5.dylib" "%p/lib/libecpg.5.0.dylib-8.0"

update-alternatives --remove "libecpg_compat.2.0.dylib" "%p/lib/libecpg_compat.2.0.dylib-8.0"
update-alternatives --remove "libecpg_compat.2.dylib" "%p/lib/libecpg_compat.2.0.dylib-8.0"

update-alternatives --remove "libpgtypes.2.0.dylib" "%p/lib/libpgtypes.2.0.dylib-8.0"
update-alternatives --remove "libpgtypes.2.dylib" "%p/lib/libpgtypes.2.0.dylib-8.0"

update-alternatives --remove "libpq.4.0.dylib" "%p/lib/libpq.4.0.dylib-8.0"
update-alternatives --remove "libpq.4.dylib" "%p/lib/libpq.4.0.dylib-8.0"

for tuple in %p/bin:binary.list %p/share/man/man1:man1.list %p/share/man/man7:man7.list; do
TUPLE_PATH=\`echo \$tuple | cut -d: -f1\`
TUPLE_FILE=\`echo \$tuple | cut -d: -f2\`

for file in \`cat %p/var/postgresql-8.0/\${TUPLE_FILE}\`; do
# echo update-alternatives --remove "\${file}" "\${TUPLE_PATH}/\${file}-8.0"
update-alternatives --remove "\${file}" "\${TUPLE_PATH}/\${file}-8.0"
done
done

END

cat < %i/var/postgresql-8.0/update-alternatives.sh
#!/bin/sh

FORCE=0

for arg in "\$@"; do
case \$arg in
-h|--h|--he|--hel|--help)
echo "usage: \$0 [-h] [-f]"
echo ""
echo " -h, --help this help"
# echo " -f, --force force this version of PostgreSQL, even if there is a newer one"
echo ""
exit 0;
;;
# -f|--f|--fo|--for|--forc|--force)
# FORCE=1
# ;;
*)
echo "\$0: unknown argument '\$arg'"
exit 1;
;;
esac
done

if [ -e "%p/lib/libecpg.5.0.dylib-8.0" ]; then
update-alternatives --install "%p/lib/libecpg.5.0.dylib" "libecpg.5.0.dylib" "%p/lib/libecpg.5.0.dylib-8.0" 0500000800
update-alternatives --install "%p/lib/libecpg.5.dylib" "libecpg.5.dylib" "%p/lib/libecpg.5.0.dylib-8.0" 0500000800
else
echo "WARNING: %p/lib/libecpg.5.0.dylib-8.0 does not exist"
fi

if [ -e "%p/lib/libecpg_compat.2.0.dylib-8.0" ]; then
update-alternatives --install "%p/lib/libecpg_compat.2.0.dylib" "libecpg_compat.2.0.dylib" "%p/lib/libecpg_compat.2.0.dylib-8.0" 0200000800
update-alternatives --install "%p/lib/libecpg_compat.2.dylib" "libecpg_compat.2.dylib" "%p/lib/libecpg_compat.2.0.dylib-8.0" 0200000800
else
echo "WARNING: %p/lib/libecpg_compat.2.0.dylib-8.0 does not exist"
fi

if [ -e "%p/lib/libpgtypes.2.0.dylib-8.0" ]; then
update-alternatives --install "%p/lib/libpgtypes.2.0.dylib" "libpgtypes.2.0.dylib" "%p/lib/libpgtypes.2.0.dylib-8.0" 0200000800
update-alternatives --install "%p/lib/libpgtypes.2.dylib" "libpgtypes.2.dylib" "%p/lib/libpgtypes.2.0.dylib-8.0" 0200000800
else
echo "WARNING: %p/lib/libpgtypes.2.0.dylib-8.0 does not exist"
fi

if [ -e "%p/lib/libpq.4.0.dylib-8.0" ]; then
update-alternatives --install "%p/lib/libpq.4.0.dylib" "libpq.4.0.dylib" "%p/lib/libpq.4.0.dylib-8.0" 0400000800
update-alternatives --install "%p/lib/libpq.4.dylib" "libpq.4.dylib" "%p/lib/libpq.4.0.dylib-8.0" 0400000800
else
echo "WARNING: %p/lib/libpq.4.0.dylib-8.0 does not exist"
fi

for tuple in %p/bin:binary.list %p/share/man/man1:man1.list %p/share/man/man7:man7.list; do
TUPLE_PATH=\`echo \$tuple | cut -d: -f1\`
TUPLE_FILE=\`echo \$tuple | cut -d: -f2\`

for file in \`cat %p/var/postgresql-8.0/\${TUPLE_FILE}\`; do
if [ -e "\${TUPLE_PATH}/\${file}-8.0" ]; then
update-alternatives --install "\${TUPLE_PATH}/\${file}" "\${file}" "\${TUPLE_PATH}/\${file}-8.0" 80
fi
done
done

END

chmod 755 %i/var/postgresql-8.0/*.sh
perl -pi -e 's,^%d,,' %i/bin/pg_config*
<<
DocFiles: COPYRIGHT HISTORY INSTALL README
SplitOff: <<
Package: %N-dev
Description: PostgreSQL development headers and libraries
Depends: %N (= %v-%r)
Conflicts: <<
postgresql-dev,
postgresql-ssl-dev,
postgresql (<< %v-%r),
postgresql-ssl (<< %v-%r),
postgresql73-dev,
postgresql73-ssl-dev,
postgresql73-unified-dev,
postgresql74-dev,
postgresql74-ssl-dev,
postgresql74-unified-dev,
postgresql80-dev (<< %v-%r),
postgresql80-ssl-dev (<< %v-%r),
postgresql81-dev,
postgresql82-dev,
postgresql83-dev
<<
Replaces: <<
postgresql-dev,
postgresql-ssl-dev,
postgresql73-dev,
postgresql73-ssl-dev,
postgresql73-unified-dev,
postgresql74-dev,
postgresql74-ssl-dev,
postgresql74-unified-dev,
postgresql80-dev,
postgresql80-ssl-dev,
%N,
postgresql74-shlibs,
postgresql74-ssl-shlibs,
postgresql74-unified-shlibs,
postgresql81-dev,
postgresql82-dev,
postgresql83-dev
<<
BuildDependsOnly: true
Files: <<
bin/pg_config*
include
lib/*.a
lib/libecpg_compat.dylib
lib/libecpg.dylib
lib/libpgtypes.dylib
lib/libpq.dylib
share/man/man1/pg_config*
<<
PostInstScript: [ -x %p/var/postgresql-8.0/update-alternatives.sh ] && %p/var/postgresql-8.0/update-alternatives.sh
PreRmScript: [ -x %p/var/postgresql-8.0/remove-alternatives.sh ] && %p/var/postgresql-8.0/remove-alternatives.sh
PostRmScript: [ -x %p/var/postgresql-8.0/update-alternatives.sh ] && %p/var/postgresql-8.0/update-alternatives.sh
<<
SplitOff2: <<
Package: %N-shlibs
Description: PostgreSQL shared libraries
Conflicts: <<
postgresql-shlibs,
postgresql-ssl-shlibs,
postgresql80-shlibs (<< %v-%r),
postgresql80-ssl-shlibs (<< %v-%r)
<<
Replaces: <<
%N,
postgresql-shlibs,
postgresql-ssl-shlibs,
postgresql73-shlibs,
postgresql73-ssl-shlibs,
postgresql73-unified-shlibs,
postgresql74-shlibs,
postgresql74-ssl-shlibs,
postgresql74-unified-shlibs,
postgresql80-shlibs,
postgresql80-ssl-shlibs
<<
Files: lib/*.dylib* var/postgresql-8.0/*.sh var/postgresql-8.0/*.list
Shlibs: <<
%p/lib/libecpg.5.dylib 5.0.0 postgresql80-unified-shlibs (>= 8.0.1-1) | postgresql81-unified-shlibs (>= 8.1-1)
%p/lib/libecpg_compat.2.dylib 2.0.0 postgresql80-unified-shlibs (>= 8.0.1-1) | postgresql81-unified-shlibs (>= 8.1-1)
%p/lib/libpgtypes.2.dylib 2.0.0 postgresql80-unified-shlibs (>= 8.0.1-1) | postgresql81-unified-shlibs (>= 8.1-1)
%p/lib/libpq.4.dylib 4.0.0 postgresql80-unified-shlibs (>= 8.0.1-1) | postgresql81-unified-shlibs (>= 8.1-1)
<<
PostInstScript: [ -x %p/var/postgresql-8.0/update-alternatives.sh ] && %p/var/postgresql-8.0/update-alternatives.sh
PreRmScript: [ -x %p/var/postgresql-8.0/remove-alternatives.sh ] && %p/var/postgresql-8.0/remove-alternatives.sh
<<
SplitOff3: <<
Package: postgresql80
Description: Upgrade package for PostgreSQL 8.0
Depends: <<
%N (>= %v-%r),
fink (>= 0.26.0-1),
fink-obsolete-packages
<<
DocFiles: COPYRIGHT HISTORY INSTALL README
DescUsage: <<
The package runs initdb on installation as the user 'postgres'.

The best way to run it is using the supplied pgsql.sh script, i.e.
'sudo pgsql.sh start'. Or, you can run
'sudo daemonic enable %N' as root to create a
StartupItem for it.

Unless you set up admin users in the database, the easiest way to
run psql commands with administrator access is to prefix them with
the command "sudo -u postgres". This will ask you your administrator
password, and then run the command as the postgres user.

For example, to create a new database, you would run:

sudo -u postgres createdb mydb
<<
<<
SplitOff4: <<
Package: postgresql80-dev
Description: Upgrade package for PostgreSQL 8.0 development
Depends: <<
%N-dev (>= %v-%r),
fink (>= 0.26.0-1),
fink-obsolete-packages
<<
BuildDependsOnly: true
DocFiles: COPYRIGHT HISTORY INSTALL README
<<
SplitOff5: <<
Package: postgresql80-shlibs
Description: Upgrade package for PostgreSQL 8.0 libraries
Depends: <<
%N-shlibs (>= %v-%r),
fink (>= 0.26.0-1),
fink-obsolete-packages
<<
DocFiles: COPYRIGHT HISTORY INSTALL README
<<
SplitOff6: <<
Package: postgresql80-ssl
Description: Upgrade package for PostgreSQL 8.0 (SSL)
Depends: <<
%N (>= %v-%r),
fink (>= 0.26.0-1),
fink-obsolete-packages
<<
DocFiles: COPYRIGHT HISTORY INSTALL README
DescUsage: <<
The package runs initdb on installation as the user 'postgres'.

The best way to run it is using the supplied pgsql.sh script, i.e.
'sudo pgsql.sh start'. Or, you can run
'sudo daemonic enable %N' as root to create a
StartupItem for it.

Unless you set up admin users in the database, the easiest way to
run psql commands with administrator access is to prefix them with
the command "sudo -u postgres". This will ask you your administrator
password, and then run the command as the postgres user.

For example, to create a new database, you would run:

sudo -u postgres createdb mydb
<<
<<
SplitOff7: <<
Package: postgresql80-ssl-dev
Description: Upgrade package for PostgreSQL 8.0 development (SSL)
Depends: <<
%N-dev (>= %v-%r),
fink (>= 0.26.0-1),
fink-obsolete-packages
<<
BuildDependsOnly: true
DocFiles: COPYRIGHT HISTORY INSTALL README
<<
SplitOff8: <<
Package: postgresql80-ssl-shlibs
Description: Upgrade package for PostgreSQL 8.0 libraries (SSL)
Depends: <<
%N-shlibs (>= %v-%r),
fink (>= 0.26.0-1),
fink-obsolete-packages
<<
DocFiles: COPYRIGHT HISTORY INSTALL README
<<

PostInstScript: <<
INSTALL_PHASE="$1"

[ -x %p/var/postgresql-8.0/update-alternatives.sh ] && %p/var/postgresql-8.0/update-alternatives.sh

# remove the old "pgsql" entries from netinfo; the username was switched to
# "postgres" but the old ones hang around because of the way niload works
niutil -destroy . /users/pgsql >/dev/null 2>&1 || true
niutil -destroy . /groups/pgsql >/dev/null 2>&1 || true

die () {
echo "failed"
echo ""
echo "*** bailing because an error ocurred:"
echo ""
echo "$*"
exit 1
}

# update daemonic init script if necessary
daemonic install %N

# get a nice port to run on
while true; do
PGPORT=$RANDOM;
if [ "$PGPORT" -gt 10000 ] && [ "$PGPORT" -lt 20000 ]; then
break
fi
done
export PGPORT
echo "- starting PostgreSQL on port $PGPORT"
if %p/bin/pgsql.sh-8.0 start >/tmp/pgstart-8.0.log 2>&1; then

sleep 5

ERROR=0
# install the plpgsql language if possible
printf -- "- attempting to install the plpgsql language in the template1 database... "
%p/bin/createlang-8.0 -U postgres -p $PGPORT plpgsql template1 >/tmp/createlang-8.0.log 2>&1 || ERROR="$?"
if [ $ERROR -eq 0 ]; then
echo "done"
elif [ $ERROR -gt 0 ] && [ $ERROR -ne 2 ]; then
echo "WARNING: an unknown error occurred inserting the plpgsql language"
else
:
fi

sleep 5

%p/bin/pgsql.sh-8.0 stop >/dev/null 2>&1 || echo "WARNING: unable to stop postgresql: run 'PGPORT=$PGPORT sudo %p/bin/pgsql.sh-8.0 stop' to try again"

else

cat < WARNING: unable to start postgresql on an alternate port, not installing plpgsql!

If you wish to install it manually, run:

sudo %p/bin/pgsql.sh-8.0 start
sudo -u postgres %p/bin/createlang-8.0 plpgsql template1

END

fi
<<
PreRmScript: <<
[ -x %p/var/postgresql-8.0/remove-alternatives.sh ] && %p/var/postgresql-8.0/remove-alternatives.sh

# clean up
daemonic remove postgresql >/dev/null 2>&1 || true
daemonic remove postgresql80-ssl >/dev/null 2>&1 || true
daemonic remove postgresql80 >/dev/null 2>&1 || true
if [ $1 != "upgrade" ]; then
daemonic remove %N
fi
<<
PostRmScript: [ -x %p/var/postgresql-8.0/update-alternatives.sh ] && %p/var/postgresql-8.0/update-alternatives.sh
DaemonicFile: <<

PostgreSQL database server
PostgreSQL database server


%p/bin/pgsql.sh-8.0
start



<<

Homepage: http://www.postgresql.org/
DescUsage: <<
The package runs initdb on installation as the user 'postgres'.

The best way to run it is using the supplied pgsql.sh script, i.e.
'sudo pgsql.sh start'. Or, you can run
'sudo daemonic enable %N' as root to create a
StartupItem for it.

Unless you set up admin users in the database, the easiest way to
run psql commands with administrator access is to prefix them with
the command "sudo -u postgres". This will ask you your administrator
password, and then run the command as the postgres user.

For example, to create a new database, you would run:

sudo -u postgres createdb mydb
<<
DescPackaging: <<
IMPORTANT: The location of the data files has changed from early
revisions of this package. If you're upgrading from an earlier
revision, note that this one expects the data files to be installed
at /var/postgresql-8.0/data.

When run from the startup script, logs output to
/var/postgresql-8.0/pgsql.log
<<
DescPort: <<
Rearranged a lot of the PostgreSQL build to be more "correct" on
Darwin, including making proper dylibs (instead of bundles, which
ended up creating static binaries).
<<

postgresql80-unified stable port .patch


--- postgresql-8.0.15/contrib/Makefile 2004-12-14 17:50:23.000000000 -0500
+++ postgresql-8.0.15-new/contrib/Makefile 2008-01-15 11:05:45.000000000 -0500
@@ -37,7 +37,6 @@
string \
tablefunc \
tips \
- tsearch \
tsearch2 \
userlock \
vacuumlo
--- postgresql-8.0.15/pgsql.sh 1969-12-31 19:00:00.000000000 -0500
+++ postgresql-8.0.15-new/pgsql.sh 2008-01-15 11:06:02.000000000 -0500
@@ -0,0 +1,73 @@
+#!/bin/sh
+
+die () {
+ echo "failed"
+ echo ""
+ echo "*** bailing because an error ocurred:"
+ echo ""
+ echo "$*"
+ exit 1
+}
+
+PREFIX="@INSTPREFIX@"
+DATADIR="${PREFIX}/var/postgresql-8.0/data"
+LOGFILE="${PREFIX}/var/postgresql-8.0/pgsql.log"
+
+export LANG=C
+unset LC_ALL
+
+SHMMAX=`sysctl kern.sysv.shmmax | cut -d' ' -f2-`
+SHMMNI=`sysctl kern.sysv.shmmni | cut -d' ' -f2-`
+SHMALL=`sysctl kern.sysv.shmall | cut -d' ' -f2-`
+
+if [ "$SHMMAX" -lt "8388608" ] || [ "$SHMMNI" -lt "64" ] || [ "$SHMALL" -lt "32768" ]; then
+ echo "WARNING: You probably need to set your shared memory resources higher for"
+ echo " PostgreSQL to function. For more information on raising your shared"
+ echo " memory settings, see:"
+ echo " http://wiki.finkproject.org/index.php/Shared_Memory_Regions_on_Darwin"
+ echo ""
+ echo " I am also creating a default configuration in /etc/sysctl.conf.pg"
+ echo " that contains values that will work with the default PostgreSQL "
+ echo " memory settings. To use it, rename it to /etc/sysctl.conf (if you"
+ echo " don't have one already) and reboot."
+ echo ""
+ echo " For now, I'll try setting your sysctl to something higher and then"
+ echo " running things anyways. Good luck! =)"
+ echo ""
+ sysctl -w kern.sysv.shmmax=8388608
+ sysctl -w kern.sysv.shmmin=1
+ sysctl -w kern.sysv.shmmni=64
+ sysctl -w kern.sysv.shmseg=8
+ sysctl -w kern.sysv.shmall=32768
+ echo ""
+ cat </etc/sysctl.conf.pg
+kern.sysv.shmmax=8388608
+kern.sysv.shmmin=1
+kern.sysv.shmmni=64
+kern.sysv.shmseg=8
+kern.sysv.shmall=32768
+END
+fi
+
+if [ ! -d "$DATADIR" ]; then
+ printf -- "- making postgresql directories: "
+ sudo mkdir -p "$DATADIR"
+ sudo chown -R postgres "$DATADIR/.."
+ echo "ok"
+
+ printf -- "- initializing database in $DATADIR: "
+ sudo -u postgres ${PREFIX}/bin/initdb-8.0 -D "$DATADIR" >/tmp/pgsql-init-8.0.log 2>&1 || die "couldn't initialize database"
+ echo "ok"
+fi
+
+case "$1" in
+ start)
+ unset LC_ALL; LANG=C sudo -u postgres "${PREFIX}/bin/pg_ctl-8.0" start -D "$DATADIR" -l "$LOGFILE"
+ ;;
+ restart)
+ unset LC_ALL; LANG=C sudo -u postgres "${PREFIX}/bin/pg_ctl-8.0" restart -D "$DATADIR" -m fast
+ ;;
+ stop)
+ unset LC_ALL; LANG=C sudo -u postgres "${PREFIX}/bin/pg_ctl-8.0" stop -D "$DATADIR" -m fast
+ ;;
+esac
--- postgresql-8.0.15/src/Makefile.global.in 2005-03-25 13:18:39.000000000 -0500
+++ postgresql-8.0.15-new/src/Makefile.global.in 2008-01-15 11:05:46.000000000 -0500
@@ -65,21 +65,21 @@
libexecdir := @libexecdir@
ifeq "$(findstring pgsql, $(libexecdir))" ""
ifeq "$(findstring postgres, $(libexecdir))" ""
-override libexecdir := $(libexecdir)/postgresql
+override libexecdir := $(libexecdir)/postgresql-8.0
endif
endif

datadir := @datadir@
ifeq "$(findstring pgsql, $(datadir))" ""
ifeq "$(findstring postgres, $(datadir))" ""
-override datadir := $(datadir)/postgresql
+override datadir := $(datadir)/postgresql-8.0
endif
endif

sysconfdir := @sysconfdir@
ifeq "$(findstring pgsql, $(sysconfdir))" ""
ifeq "$(findstring postgres, $(sysconfdir))" ""
-override sysconfdir := $(sysconfdir)/postgresql
+override sysconfdir := $(sysconfdir)/postgresql-8.0
endif
endif

@@ -87,7 +87,7 @@
pkglibdir = $(libdir)
ifeq "$(findstring pgsql, $(pkglibdir))" ""
ifeq "$(findstring postgres, $(pkglibdir))" ""
-override pkglibdir := $(pkglibdir)/postgresql
+override pkglibdir := $(pkglibdir)/postgresql-8.0
endif
endif

@@ -95,7 +95,7 @@
pkgincludedir = $(includedir)
ifeq "$(findstring pgsql, $(pkgincludedir))" ""
ifeq "$(findstring postgres, $(pkgincludedir))" ""
-override pkgincludedir := $(pkgincludedir)/postgresql
+override pkgincludedir := $(pkgincludedir)/postgresql-8.0
endif
endif
includedir_server = $(pkgincludedir)/server
@@ -109,7 +109,7 @@
ifneq (,$(docdir))
ifeq "$(findstring pgsql, $(docdir))" ""
ifeq "$(findstring postgres, $(docdir))" ""
-override docdir := $(docdir)/postgresql
+override docdir := $(docdir)/postgresql-8.0
endif
endif
endif
--- postgresql-8.0.15/src/Makefile.shlib 2005-12-03 15:16:50.000000000 -0500
+++ postgresql-8.0.15-new/src/Makefile.shlib 2008-01-15 11:05:46.000000000 -0500
@@ -107,11 +107,11 @@
ifeq ($(DLTYPE), library)
# linkable library
DLSUFFIX := .dylib
- LINK.shared = $(COMPILER) -dynamiclib -install_name $(libdir)/lib$(NAME).$(SO_MAJOR_VERSION)$(DLSUFFIX) $(version_link) -multiply_defined suppress
+ LINK.shared = $(CXX) $(CFLAGS) -dynamiclib -install_name $(libdir)/lib$(NAME).$(SO_MAJOR_VERSION)$(DLSUFFIX) $(version_link) -multiply_defined suppress
else
# loadable module (default case)
DLSUFFIX := .so
- LINK.shared = $(COMPILER) -bundle
+ LINK.shared = $(CXX) $(CFLAGS) -bundle
endif
shlib = lib$(NAME).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)$(DLSUFFIX)
shlib_major = lib$(NAME).$(SO_MAJOR_VERSION)$(DLSUFFIX)
--- postgresql-8.0.15/src/backend/main/main.c 2006-01-31 19:47:02.000000000 -0500
+++ postgresql-8.0.15-new/src/backend/main/main.c 2008-01-15 11:05:46.000000000 -0500
@@ -56,6 +56,7 @@
struct passwd *pw;
#endif
char *pw_name_persist;
+ char *progname;

/*
* Place platform-specific startup hacks here. This is the right
@@ -267,7 +268,26 @@
*/
len = strlen(argv[0]);

- if ((len >= 10 && strcmp(argv[0] + len - 10, "postmaster") == 0)
+ /*
+ * Find the program name, which is after the final slash in the
+ * program argument.
+ */
+ progname = strrchr(argv[0], '/');
+ if (progname != NULL)
+ {
+ progname = progname + 1;
+ }
+ else
+ {
+ progname = argv[0];
+ }
+
+ /*
+ * Now check if the program name starts with the
+ * word "postmaster", in which case PostmasterMain is called.
+ */
+ len = strlen(progname);
+ if ((len >= 10 && strncmp(progname, "postmaster", 10) == 0)
#ifdef WIN32
|| (len >= 14 && strcmp(argv[0] + len - 14, "postmaster.exe") == 0)
#endif
--- postgresql-8.0.15/src/backend/utils/fmgr/dfmgr.c 2004-12-31 17:01:31.000000000 -0500
+++ postgresql-8.0.15-new/src/backend/utils/fmgr/dfmgr.c 2008-01-15 11:05:46.000000000 -0500
@@ -305,6 +305,26 @@
pfree(full);
}

+ new = palloc(strlen(name) + strlen(".so") + 1);
+ strcpy(new, name);
+ strcat(new, ".so");
+
+ if (!have_slash)
+ {
+ full = find_in_dynamic_libpath(new);
+ pfree(new);
+ if (full)
+ return full;
+ }
+ else
+ {
+ full = substitute_libpath_macro(new);
+ pfree(new);
+ if (file_exists(full))
+ return full;
+ pfree(full);
+ }
+
new = palloc(strlen(name) + strlen(DLSUFFIX) + 1);
strcpy(new, name);
strcat(new, DLSUFFIX);
--- postgresql-8.0.15/src/backend/utils/misc/postgresql.conf.sample 2006-05-21 16:11:25.000000000 -0400
+++ postgresql-8.0.15-new/src/backend/utils/misc/postgresql.conf.sample 2008-01-15 11:05:46.000000000 -0500
@@ -61,7 +61,7 @@
# - Security & Authentication -

#authentication_timeout = 60 # 1-600, in seconds
-#ssl = false
+ssl = false
#password_encryption = true
#krb_server_keyfile = ''
#db_user_namespace = false
--- postgresql-8.0.15/src/bin/initdb/initdb.c 2006-05-21 15:57:39.000000000 -0400
+++ postgresql-8.0.15-new/src/bin/initdb/initdb.c 2008-01-15 11:05:46.000000000 -0500
@@ -117,7 +117,7 @@

/* defaults */
int n_connections = 10;
-int n_buffers = 50;
+int n_buffers = 20;

/*
* Warning messages for authentication methods
@@ -2313,7 +2313,7 @@
sprintf(pgdenv, "PGDATA=%s", pg_data);
putenv(pgdenv);

- if ((ret = find_other_exec(argv[0], "postgres", PG_VERSIONSTR,
+ if ((ret = find_other_exec(argv[0], "postgres-8.0", PG_VERSIONSTR,
backend_exec)) < 0)
{
char full_path[MAXPGPATH];
@@ -2323,14 +2323,14 @@

if (ret == -1)
fprintf(stderr,
- _("The program \"postgres\" is needed by %s "
+ _("The program \"postgres-8.0\" is needed by %s "
"but was not found in the\n"
"same directory as \"%s\".\n"
"Check your installation.\n"),
progname, full_path);
else
fprintf(stderr,
- _("The program \"postgres\" was found by \"%s\"\n"
+ _("The program \"postgres-8.0\" was found by \"%s\"\n"
"but was not the same version as %s.\n"
"Check your installation.\n"),
full_path, progname);
@@ -2617,7 +2617,7 @@
get_parent_directory(bin_dir);

printf(_("\nSuccess. You can now start the database server using:\n\n"
- " %s%s%s%spostmaster -D %s%s%s\n"
+ " %s%s%s%spostmaster-8.0 -D %s%s%s\n"
"or\n"
" %s%s%s%spg_ctl -D %s%s%s -l logfile start\n\n"),
QUOTE_PATH, bin_dir, QUOTE_PATH, (strlen(bin_dir) > 0) ? DIR_SEP : "",
--- postgresql-8.0.15/src/bin/pg_ctl/pg_ctl.c 2006-06-25 00:38:08.000000000 -0400
+++ postgresql-8.0.15-new/src/bin/pg_ctl/pg_ctl.c 2008-01-15 11:05:46.000000000 -0500
@@ -538,7 +538,7 @@

postmaster_path = xmalloc(MAXPGPATH);

- if ((ret = find_other_exec(argv0, "postmaster", PM_VERSIONSTR,
+ if ((ret = find_other_exec(argv0, "postmaster-8.0", PM_VERSIONSTR,
postmaster_path)) < 0)
{
char full_path[MAXPGPATH];
@@ -547,13 +547,13 @@
StrNCpy(full_path, progname, MAXPGPATH);

if (ret == -1)
- write_stderr(_("The program \"postmaster\" is needed by %s "
+ write_stderr(_("The program \"postmaster-8.0\" is needed by %s "
"but was not found in the\n"
"same directory as \"%s\".\n"
"Check your installation.\n"),
progname, full_path);
else
- write_stderr(_("The program \"postmaster\" was found by \"%s\"\n"
+ write_stderr(_("The program \"postmaster-8.0\" was found by \"%s\"\n"
"but was not the same version as %s.\n"
"Check your installation.\n"),
full_path, progname);
@@ -892,7 +892,7 @@
}
else
{
- ret = find_other_exec(argv0, "postmaster", PM_VERSIONSTR, cmdLine);
+ ret = find_other_exec(argv0, "postmaster-8.0", PM_VERSIONSTR, cmdLine);
if (ret != 0)
{
write_stderr(_("%s: could not find postmaster program executable\n"), progname);
--- postgresql-8.0.15/src/interfaces/ecpg/compatlib/Makefile 2005-03-13 17:04:45.000000000 -0500
+++ postgresql-8.0.15-new/src/interfaces/ecpg/compatlib/Makefile 2008-01-15 11:05:46.000000000 -0500
@@ -20,6 +20,7 @@
override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir) \
-I$(top_srcdir)/src/include/utils $(CPPFLAGS)
override CFLAGS += $(PTHREAD_CFLAGS)
+override LDFLAGS := -L../ecpglib -L../pgtypeslib -L../../libpq $(LDFLAGS)
SHLIB_LINK = -L../ecpglib -lecpg -L../pgtypeslib -lpgtypes $(libpq) \
$(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -lm, $(LIBS)) $(PTHREAD_LIBS)

--- postgresql-8.0.15/src/interfaces/ecpg/ecpglib/Makefile 2005-03-13 17:04:45.000000000 -0500
+++ postgresql-8.0.15-new/src/interfaces/ecpg/ecpglib/Makefile 2008-01-15 11:05:46.000000000 -0500
@@ -19,6 +19,7 @@

override CPPFLAGS := -DFRONTEND -I$(top_srcdir)/src/interfaces/ecpg/include \
-I$(libpq_srcdir) -I$(top_builddir)/src/port $(CPPFLAGS)
+override LDFLAGS := -L../ecpglib -L../pgtypeslib -L../../libpq $(LDFLAGS)
override CFLAGS += $(PTHREAD_CFLAGS)

# Need to recomple any libpgport object files
--- postgresql-8.0.15/src/makefiles/Makefile.darwin 2006-01-19 16:20:32.000000000 -0500
+++ postgresql-8.0.15-new/src/makefiles/Makefile.darwin 2008-01-15 11:05:46.000000000 -0500
@@ -13,6 +13,6 @@
# Rule for building shared libs (currently used only for regression test
# shlib ... should go away, since this is not really enough knowledge)
%.so: %.o
- $(CC) -bundle -o $@ $< $(BE_DLLLIBS)
+ $(CXX) -bundle -undefined dynamic_lookup -o $@ $< $(BE_DLLLIBS)

sqlmansect = 7
--- postgresql-8.0.15/src/template/darwin 2004-04-26 00:04:42.000000000 -0400
+++ postgresql-8.0.15-new/src/template/darwin 2008-01-15 11:05:46.000000000 -0500
@@ -1,6 +1,2 @@
-# Apple's cpp-precomp seems a tad broken, so don't use it
-# (Note: on OS X before 10.2, you might need -traditional-cpp instead)
-CC="$CC -no-cpp-precomp"
-
# Select appropriate semaphore support
USE_NAMED_POSIX_SEMAPHORES=1

postgresql80-unified _unstable_ port information

Package: postgresql80-unified
Version: 8.0.17
Revision: 1
Description: PostgreSQL open-source database
License: BSD
Maintainer: Benjamin Reed

Depends: <<
daemonic (>= 20010902-1),
libxml2-shlibs,
libxslt-shlibs,
passwd (>= 20030906-1),
readline5-shlibs,
%N-shlibs (= %v-%r)
<<
BuildDepends: <<
bison,
fink (>= 0.26.0-1),
libxml2,
libxslt,
passwd (>= 20030906-1),
readline5,
system-openssl-dev
<<
Provides: postgresql-server
Conflicts: <<
postgresql (<< %v-%r),
postgresql-ssl (<< %v-%r),
postgresql73 (<< 7.3.4-14),
postgresql73-ssl (<< 7.3.4-14),
postgresql80 (<< %v-%r),
postgresql80-ssl (<< %v-%r)
<<
Replaces: <<
postgresql,
postgresql-shlibs,
postgresql-ssl,
postgresql-ssl-shlibs,
postgresql-python,
postgresql-ssl-python,
postgresql-perl,
postgresql-ssl-perl,
postgresql73,
postgresql73-ssl,
postgresql73-unified,
postgresql74,
postgresql74-ssl,
postgresql74-unified,
postgresql80,
postgresql80-ssl
<<

CustomMirror: <<
afr-ZA: ftp://ftp.za.postgresql.org/mirror/ftp.postgresql.org
asi-CN: ftp://ftp.cn.postgresql.org/ftp.postgresql.org
asi-GE: ftp://ftp.ge.postgresql.org/pub/postgresql
asi-HK: ftp://ftp.hk.postgresql.org/postgresql
asi-ID: ftp://ftp8.id.postgresql.org/pub/PostgreSQL
asi-ID: ftp://ftp9.id.postgresql.org/postgresql
asi-JP: ftp://ftp.jp.postgresql.org
asi-KR: ftp://ftp.kr.postgresql.org/mirror/database/postgresql
asi-TW: ftp://ftp.tw.postgresql.org/pub/postgresql
asi-TW: ftp://ftp3.tw.postgresql.org/pub/postgresql
asi-TW: ftp://ftp5.tw.postgresql.org/pub/Unix/Database/PostgreSQL
aus-AU: ftp://ftp.au.postgresql.org/pub/postgresql
aus-AU: ftp://ftp2.au.postgresql.org/pub/postgresql
aus-AU: ftp://ftp3.au.postgresql.org/pub/postgresql
aus-NZ: ftp://ftp.nz.postgresql.org/postgresql
eur-AT: ftp://ftp.at.postgresql.org/db/www.postgresql.org/pub
eur-BE: ftp://ftp.be.postgresql.org/postgresql
eur-BA: ftp://ftp.ba.postgresql.org/pub/postgresql
eur-BG: ftp://ftp3.bg.postgresql.org/postgresql
eur-CH: ftp://ftp2.ch.postgresql.org/mirror/postgresql
eur-CZ: ftp://ftp.cz.postgresql.org/pub/ftp.postgresql.org
eur-CZ: ftp://ftp2.cz.postgresql.org/pub/postgresql
eur-DE: ftp://ftp.de.postgresql.org/mirror/postgresql
eur-DE: ftp://ftp3.de.postgresql.org/pub/Mirrors/ftp.postgresql.org
eur-DE: ftp://ftp7.de.postgresql.org/pub/ftp.postgresql.org
eur-DE: ftp://ftp8.de.postgresql.org/pub/misc/pgsql
eur-DE: ftp://ftp9.de.postgresql.org/unix/databases/postgresql
eur-DK: ftp://ftp.dk.postgresql.org/mirrors/postgresql
eur-EE: ftp://ftp.ee.postgresql.org/mirrors/postgresql
eur-ES: ftp://ftp5.es.postgresql.org/mirror/postgresql
eur-FR: ftp://ftp.fr.postgresql.org
eur-FR: ftp://ftp2.fr.postgresql.org/postgresql
eur-FR: ftp://ftp3.fr.postgresql.org/pub/postgresql
eur-GR: ftp://ftp.gr.postgresql.org/pub/databases/postgresql
eur-GR: ftp://ftp2.gr.postgresql.org/pub/databases/postgresql
eur-HR: ftp://ftp.hr.postgresql.org/postgresql
eur-HU: ftp://ftp3.hu.postgresql.org/pub/postgresql
eur-IE: ftp://ftp.ie.postgresql.org/mirrors/ftp.postgresql.org/pub
eur-IE: ftp://ftp2.ie.postgresql.org/mirrors/ftp.postgresql.org
eur-IL: ftp://ftp.il.postgresql.org/ftp.postgresql.org
eur-IS: ftp://ftp.is.postgresql.org/pub/postgresql
eur-IT: ftp://ftp2.it.postgresql.org/mirrors/postgres
eur-IT: ftp://ftp6.it.postgresql.org/pub/PostgreSQL
eur-IT: ftp://ftp7.it.postgresql.org/pub/unix/postgres
eur-LV: ftp://ftp.lv.postgresql.org/pub/software/postgresql
eur-NL: ftp://ftp.eu.postgresql.org/pub/unix/db/postgresql
eur-NL: ftp://ftp.nl.postgresql.org:21/pub/mirror/postgresql
eur-NL: ftp://ftp2.nl.postgresql.org/mirror/postgresql
eur-NL: ftp://ftp4.nl.postgresql.org/postgresql.zeelandnet.nl
eur-NO: ftp://ftp.no.postgresql.org/pub/databases/postgresql
eur-PL: ftp://ftp6.pl.postgresql.org/pub/postgresql
eur-PL: ftp://ftp7.pl.postgresql.org/pub/mirror/ftp.postgresql.org
eur-PL: ftp://ftp8.pl.postgresql.org/pub/postgresql
eur-PT: ftp://ftp.pt.postgresql.org/postgresql
eur-RO: ftp://ftp6.ro.postgresql.org/pub/mirrors/ftp.postgresql.org
eur-RU: ftp://ftp.ru.postgresql.org/pub/mirrors/pgsql
eur-RU: ftp://ftp2.ru.postgresql.org/pub/databases/postgresql
eur-RU: ftp://ftp3.ru.postgresql.org/pub/mirror/postgresql/pub
eur-RU: ftp://ftp6.ru.postgresql.org/pub/pgsql
eur-SE: ftp://ftp.se.postgresql.org/pub/database/relational/postgresql
eur-SK: ftp://ftp2.sk.postgresql.org/pub/postgresql
eur-UK: ftp://ftp2.uk.postgresql.org/sites/ftp.postgresql.org
eur-UK: ftp://ftp4.uk.postgresql.org/sites/ftp.postgresql.org
eur-UK: ftp://ftp8.uk.postgresql.org/sites/ftp.postgresql.org
nam-CA: ftp://ftp3.ca.postgresql.org/pub
nam-CA: ftp://ftp4.ca.postgresql.org/pub/postgresql
sam-BR: ftp://ftp.br.postgresql.org/pub/PostgreSQL
sam-CL: ftp://ftp.cl.postgresql.org/ftp/pub/postgresql
sam-CO: ftp://ftp.co.postgresql.org/pub/mirrors/postgresql
nam-US: ftp://ftp.us.postgresql.org/pub/mirrors/postgresql
nam-US: ftp://ftp3.us.postgresql.org/pub/postgresql
nam-US: ftp://ftp4.us.postgresql.org/pub/postgresql
nam-US: ftp://ftp5.us.postgresql.org/pub/PostgreSQL
nam-US: ftp://ftp8.us.postgresql.org/postgresql
nam-US: ftp://ftp9.us.postgresql.org/pub/mirrors/postgresql
nam-US: ftp://ftp10.us.postgresql.org/pub/postgresql
nam-US: ftp://ftp22.us.postgresql.org/mirrors/ftp.postgresql.org
<<
Source: mirror:custom:source/v%v/postgresql-%v.tar.bz2
Source-MD5: 0154b01820cb73aeca73b9d060cb3328
PatchScript: sed -e 's|@BUILDDIR@|%b|g' -e 's|@INSTPREFIX@|%p|g' < %a/%n.patch | patch -p1

SetMAKEFLAGS: -j1
NoSetMAKEFLAGS: true
ConfigureParams: --prefix=%p --with-docdir=%p/share/doc --mandir=%p/share/man --enable-multibyte --enable-recode --with-CXX --without-perl --without-python --with-openssl --with-libraries=%p/lib --with-includes=%p/include --without-tcl --without-tk --without-java --enable-odbc --with-pam --with-rendezvous --enable-syslog --with-krb5 --enable-thread-safety
CompileScript: <<
#!/bin/sh -xe

export lt_cv_sys_max_cmd_len=65536
export CPPFLAGS="-I%p/lib/system-openssl/include -I%p/include -DHAVE_OPTRESET -fno-common"
export LDFLAGS="-L%p/lib/system-openssl/lib -L%p/lib"
export SHELL="/bin/sh -xe"

PG_ID=`id -u postgres 2>/dev/null || true`
if [ -z "$PG_ID" ]; then
echo "Whoa there! You must have a postgres user to build this package."
echo "Please do a 'fink reinstall passwd' and make sure you hit 'y' when it"
echo "asks if you want to update your users."
exit 1
fi

# postgresql
perl -pi -e 's,hardcode_direct=yes,hardcode_direct=no,g' configure && \
./configure %c && \
make includedir=%p/include/postgresql includedir_internal=%p/include/postgresql/internal includedir_server=%p/include/postgresql && \
make -C contrib
<<

InstallScript: <<
#!/bin/sh -xe

export SHELL="/bin/sh -xe"

# postgresql
make install includedir=%p/include/postgresql includedir_internal=%p/include/postgresql/internal includedir_server=%p/include/postgresql DESTDIR=%d INSTALLSITEMAN3DIR=%i/share/man/man3 || exit 10

make -C contrib install includedir=%p/include/postgresql includedir_internal=%p/include/postgresql/internal includedir_server=%p/include/postgresql DESTDIR=%d INSTALLSITEMAN3DIR=%i/share/man/man3
install -m 755 contrib/adddepend/adddepend %i/bin/adddepend

find %i/share -ls > /tmp/sharefiles-postgresql.txt
mv %i/share/doc/postgresql-8.0 %i/share/doc/%N >/dev/null 2>&1

ranlib %i/lib/*.a

install -d -m 755 %i/share/doc/%N
find contrib -name README.\* -exec cp {} %i/share/doc/%N/ \;

install -d -m 755 %i/bin
install -c -m 755 pgsql.sh %i/bin/

install -d -m 755 %i/var/postgresql-8.0
echo "be sure to back up this database before any upgrades!" >> %i/var/postgresql-8.0/README

rm -rf %i/bin/postmaster
ln -sf postgres-8.0 %i/bin/postmaster

install -d -m 755 %i/var/log
ln -sf %p/var/postgresql-8.0/pgsql.log %i/var/log/pgsql-8.0.log

for libname in libecpg.5.0 libecpg_compat.2.0 libpgtypes.2.0 libpq.4.0; do
mv %i/lib/$libname.dylib %i/lib/$libname.dylib-8.0
done

rm -rf %i/lib/libecpg.*.dylib
rm -rf %i/lib/libecpg_compat.*.dylib
rm -rf %i/lib/libpgtypes.*.dylib
rm -rf %i/lib/libpq.*.dylib

for file in `ls -1 %i/bin/`; do
mv "%i/bin/${file}" "%i/bin/${file}-8.0"
echo "${file}" >> %i/var/postgresql-8.0/binary.list
install_name_tool -change %p/lib/libpq.4.dylib %p/lib/libpq.4.0.dylib "%i/bin/${file}-8.0" >/dev/null 2>&1 || :
install_name_tool -change %p/lib/libecpg.5.dylib %p/lib/libecpg.5.0.dylib "%i/bin/${file}-8.0" >/dev/null 2>&1 || :
install_name_tool -change %p/lib/libecpg_compat.2.dylib %p/lib/libecpg_compat.2.0.dylib "%i/bin/${file}-8.0" >/dev/null 2>&1 || :
install_name_tool -change %p/lib/libpgtypes.2.dylib %p/lib/libpgtypes.2.0.dylib "%i/bin/${file}-8.0" >/dev/null 2>&1 || :
done

for file in `find %i/lib -type f`; do
install_name_tool -change %p/lib/libpq.4.dylib %p/lib/libpq.4.0.dylib "$file" >/dev/null 2>&1 || :
install_name_tool -change %p/lib/libecpg.5.dylib %p/lib/libecpg.5.0.dylib "$file" >/dev/null 2>&1 || :
install_name_tool -change %p/lib/libecpg_compat.2.dylib %p/lib/libecpg_compat.2.0.dylib "$file" >/dev/null 2>&1 || :
install_name_tool -change %p/lib/libpgtypes.2.dylib %p/lib/libpgtypes.2.0.dylib "$file" >/dev/null 2>&1 || :
done

for file in `ls -1 %i/share/man/man1/`; do
mv "%i/share/man/man1/${file}" "%i/share/man/man1/${file}-8.0"
echo "${file}" >> %i/var/postgresql-8.0/man1.list
done

for file in `ls -1 %i/share/man/man7/`; do
mv "%i/share/man/man7/${file}" "%i/share/man/man7/${file}-8.0"
echo "${file}" >> %i/var/postgresql-8.0/man7.list
done

cat < %i/var/postgresql-8.0/remove-alternatives.sh
#!/bin/sh

for arg in "\$@"; do
case \$arg in
-h|--h|--he|--hel|--help)
echo "usage: \$0 [-h]"
echo ""
echo " -h, --help this help"
echo ""
exit 0;
;;
*)
echo "\$0: unknown argument '\$arg'"
exit 1;
;;
esac
done

update-alternatives --remove "libecpg.5.0.dylib" "%p/lib/libecpg.5.0.dylib-8.0"
update-alternatives --remove "libecpg.5.dylib" "%p/lib/libecpg.5.0.dylib-8.0"

update-alternatives --remove "libecpg_compat.2.0.dylib" "%p/lib/libecpg_compat.2.0.dylib-8.0"
update-alternatives --remove "libecpg_compat.2.dylib" "%p/lib/libecpg_compat.2.0.dylib-8.0"

update-alternatives --remove "libpgtypes.2.0.dylib" "%p/lib/libpgtypes.2.0.dylib-8.0"
update-alternatives --remove "libpgtypes.2.dylib" "%p/lib/libpgtypes.2.0.dylib-8.0"

update-alternatives --remove "libpq.4.0.dylib" "%p/lib/libpq.4.0.dylib-8.0"
update-alternatives --remove "libpq.4.dylib" "%p/lib/libpq.4.0.dylib-8.0"

for tuple in %p/bin:binary.list %p/share/man/man1:man1.list %p/share/man/man7:man7.list; do
TUPLE_PATH=\`echo \$tuple | cut -d: -f1\`
TUPLE_FILE=\`echo \$tuple | cut -d: -f2\`

for file in \`cat %p/var/postgresql-8.0/\${TUPLE_FILE}\`; do
# echo update-alternatives --remove "\${file}" "\${TUPLE_PATH}/\${file}-8.0"
update-alternatives --remove "\${file}" "\${TUPLE_PATH}/\${file}-8.0"
done
done

END

cat < %i/var/postgresql-8.0/update-alternatives.sh
#!/bin/sh

FORCE=0

for arg in "\$@"; do
case \$arg in
-h|--h|--he|--hel|--help)
echo "usage: \$0 [-h] [-f]"
echo ""
echo " -h, --help this help"
# echo " -f, --force force this version of PostgreSQL, even if there is a newer one"
echo ""
exit 0;
;;
# -f|--f|--fo|--for|--forc|--force)
# FORCE=1
# ;;
*)
echo "\$0: unknown argument '\$arg'"
exit 1;
;;
esac
done

if [ -e "%p/lib/libecpg.5.0.dylib-8.0" ]; then
update-alternatives --install "%p/lib/libecpg.5.0.dylib" "libecpg.5.0.dylib" "%p/lib/libecpg.5.0.dylib-8.0" 0500000800
update-alternatives --install "%p/lib/libecpg.5.dylib" "libecpg.5.dylib" "%p/lib/libecpg.5.0.dylib-8.0" 0500000800
else
echo "WARNING: %p/lib/libecpg.5.0.dylib-8.0 does not exist"
fi

if [ -e "%p/lib/libecpg_compat.2.0.dylib-8.0" ]; then
update-alternatives --install "%p/lib/libecpg_compat.2.0.dylib" "libecpg_compat.2.0.dylib" "%p/lib/libecpg_compat.2.0.dylib-8.0" 0200000800
update-alternatives --install "%p/lib/libecpg_compat.2.dylib" "libecpg_compat.2.dylib" "%p/lib/libecpg_compat.2.0.dylib-8.0" 0200000800
else
echo "WARNING: %p/lib/libecpg_compat.2.0.dylib-8.0 does not exist"
fi

if [ -e "%p/lib/libpgtypes.2.0.dylib-8.0" ]; then
update-alternatives --install "%p/lib/libpgtypes.2.0.dylib" "libpgtypes.2.0.dylib" "%p/lib/libpgtypes.2.0.dylib-8.0" 0200000800
update-alternatives --install "%p/lib/libpgtypes.2.dylib" "libpgtypes.2.dylib" "%p/lib/libpgtypes.2.0.dylib-8.0" 0200000800
else
echo "WARNING: %p/lib/libpgtypes.2.0.dylib-8.0 does not exist"
fi

if [ -e "%p/lib/libpq.4.0.dylib-8.0" ]; then
update-alternatives --install "%p/lib/libpq.4.0.dylib" "libpq.4.0.dylib" "%p/lib/libpq.4.0.dylib-8.0" 0400000800
update-alternatives --install "%p/lib/libpq.4.dylib" "libpq.4.dylib" "%p/lib/libpq.4.0.dylib-8.0" 0400000800
else
echo "WARNING: %p/lib/libpq.4.0.dylib-8.0 does not exist"
fi

for tuple in %p/bin:binary.list %p/share/man/man1:man1.list %p/share/man/man7:man7.list; do
TUPLE_PATH=\`echo \$tuple | cut -d: -f1\`
TUPLE_FILE=\`echo \$tuple | cut -d: -f2\`

for file in \`cat %p/var/postgresql-8.0/\${TUPLE_FILE}\`; do
if [ -e "\${TUPLE_PATH}/\${file}-8.0" ]; then
update-alternatives --install "\${TUPLE_PATH}/\${file}" "\${file}" "\${TUPLE_PATH}/\${file}-8.0" 80
fi
done
done

END

chmod 755 %i/var/postgresql-8.0/*.sh
perl -pi -e 's,^%d,,' %i/bin/pg_config*
<<
DocFiles: COPYRIGHT HISTORY INSTALL README
SplitOff: <<
Package: %N-dev
Description: PostgreSQL development headers and libraries
Depends: %N (= %v-%r)
Conflicts: <<
postgresql-dev,
postgresql-ssl-dev,
postgresql (<< %v-%r),
postgresql-ssl (<< %v-%r),
postgresql73-dev,
postgresql73-ssl-dev,
postgresql73-unified-dev,
postgresql74-dev,
postgresql74-ssl-dev,
postgresql74-unified-dev,
postgresql80-dev (<< %v-%r),
postgresql80-ssl-dev (<< %v-%r),
postgresql81-dev,
postgresql82-dev,
postgresql83-dev
<<
Replaces: <<
postgresql-dev,
postgresql-ssl-dev,
postgresql73-dev,
postgresql73-ssl-dev,
postgresql73-unified-dev,
postgresql74-dev,
postgresql74-ssl-dev,
postgresql74-unified-dev,
postgresql80-dev,
postgresql80-ssl-dev,
%N,
postgresql74-shlibs,
postgresql74-ssl-shlibs,
postgresql74-unified-shlibs,
postgresql81-dev,
postgresql82-dev,
postgresql83-dev
<<
BuildDependsOnly: true
Files: <<
bin/pg_config*
include
lib/*.a
lib/libecpg_compat.dylib
lib/libecpg.dylib
lib/libpgtypes.dylib
lib/libpq.dylib
share/man/man1/pg_config*
<<
PostInstScript: [ -x %p/var/postgresql-8.0/update-alternatives.sh ] && %p/var/postgresql-8.0/update-alternatives.sh
PreRmScript: [ -x %p/var/postgresql-8.0/remove-alternatives.sh ] && %p/var/postgresql-8.0/remove-alternatives.sh
PostRmScript: [ -x %p/var/postgresql-8.0/update-alternatives.sh ] && %p/var/postgresql-8.0/update-alternatives.sh
<<
SplitOff2: <<
Package: %N-shlibs
Description: PostgreSQL shared libraries
Conflicts: <<
postgresql-shlibs,
postgresql-ssl-shlibs,
postgresql80-shlibs (<< %v-%r),
postgresql80-ssl-shlibs (<< %v-%r)
<<
Replaces: <<
%N,
postgresql-shlibs,
postgresql-ssl-shlibs,
postgresql73-shlibs,
postgresql73-ssl-shlibs,
postgresql73-unified-shlibs,
postgresql74-shlibs,
postgresql74-ssl-shlibs,
postgresql74-unified-shlibs,
postgresql80-shlibs,
postgresql80-ssl-shlibs
<<
Files: lib/*.dylib* var/postgresql-8.0/*.sh var/postgresql-8.0/*.list
Shlibs: <<
%p/lib/libecpg.5.dylib 5.0.0 postgresql80-unified-shlibs (>= 8.0.1-1) | postgresql81-unified-shlibs (>= 8.1-1)
%p/lib/libecpg_compat.2.dylib 2.0.0 postgresql80-unified-shlibs (>= 8.0.1-1) | postgresql81-unified-shlibs (>= 8.1-1)
%p/lib/libpgtypes.2.dylib 2.0.0 postgresql80-unified-shlibs (>= 8.0.1-1) | postgresql81-unified-shlibs (>= 8.1-1)
%p/lib/libpq.4.dylib 4.0.0 postgresql80-unified-shlibs (>= 8.0.1-1) | postgresql81-unified-shlibs (>= 8.1-1)
<<
PostInstScript: [ -x %p/var/postgresql-8.0/update-alternatives.sh ] && %p/var/postgresql-8.0/update-alternatives.sh
PreRmScript: [ -x %p/var/postgresql-8.0/remove-alternatives.sh ] && %p/var/postgresql-8.0/remove-alternatives.sh
<<
SplitOff3: <<
Package: postgresql80
Description: Upgrade package for PostgreSQL 8.0
Depends: <<
%N (>= %v-%r),
fink (>= 0.26.0-1),
fink-obsolete-packages
<<
DocFiles: COPYRIGHT HISTORY INSTALL README
DescUsage: <<
The package runs initdb on installation as the user 'postgres'.

The best way to run it is using the supplied pgsql.sh script, i.e.
'sudo pgsql.sh start'. Or, you can run
'sudo daemonic enable %N' as root to create a
StartupItem for it.

Unless you set up admin users in the database, the easiest way to
run psql commands with administrator access is to prefix them with
the command "sudo -u postgres". This will ask you your administrator
password, and then run the command as the postgres user.

For example, to create a new database, you would run:

sudo -u postgres createdb mydb
<<
<<
SplitOff4: <<
Package: postgresql80-dev
Description: Upgrade package for PostgreSQL 8.0 development
Depends: <<
%N-dev (>= %v-%r),
fink (>= 0.26.0-1),
fink-obsolete-packages
<<
BuildDependsOnly: true
DocFiles: COPYRIGHT HISTORY INSTALL README
<<
SplitOff5: <<
Package: postgresql80-shlibs
Description: Upgrade package for PostgreSQL 8.0 libraries
Depends: <<
%N-shlibs (>= %v-%r),
fink (>= 0.26.0-1),
fink-obsolete-packages
<<
DocFiles: COPYRIGHT HISTORY INSTALL README
<<
SplitOff6: <<
Package: postgresql80-ssl
Description: Upgrade package for PostgreSQL 8.0 (SSL)
Depends: <<
%N (>= %v-%r),
fink (>= 0.26.0-1),
fink-obsolete-packages
<<
DocFiles: COPYRIGHT HISTORY INSTALL README
DescUsage: <<
The package runs initdb on installation as the user 'postgres'.

The best way to run it is using the supplied pgsql.sh script, i.e.
'sudo pgsql.sh start'. Or, you can run
'sudo daemonic enable %N' as root to create a
StartupItem for it.

Unless you set up admin users in the database, the easiest way to
run psql commands with administrator access is to prefix them with
the command "sudo -u postgres". This will ask you your administrator
password, and then run the command as the postgres user.

For example, to create a new database, you would run:

sudo -u postgres createdb mydb
<<
<<
SplitOff7: <<
Package: postgresql80-ssl-dev
Description: Upgrade package for PostgreSQL 8.0 development (SSL)
Depends: <<
%N-dev (>= %v-%r),
fink (>= 0.26.0-1),
fink-obsolete-packages
<<
BuildDependsOnly: true
DocFiles: COPYRIGHT HISTORY INSTALL README
<<
SplitOff8: <<
Package: postgresql80-ssl-shlibs
Description: Upgrade package for PostgreSQL 8.0 libraries (SSL)
Depends: <<
%N-shlibs (>= %v-%r),
fink (>= 0.26.0-1),
fink-obsolete-packages
<<
DocFiles: COPYRIGHT HISTORY INSTALL README
<<

PostInstScript: <<
INSTALL_PHASE="$1"

[ -x %p/var/postgresql-8.0/update-alternatives.sh ] && %p/var/postgresql-8.0/update-alternatives.sh

# remove the old "pgsql" entries from netinfo; the username was switched to
# "postgres" but the old ones hang around because of the way niload works
niutil -destroy . /users/pgsql >/dev/null 2>&1 || true
niutil -destroy . /groups/pgsql >/dev/null 2>&1 || true

die () {
echo "failed"
echo ""
echo "*** bailing because an error ocurred:"
echo ""
echo "$*"
exit 1
}

# update daemonic init script if necessary
daemonic install %N

# get a nice port to run on
while true; do
PGPORT=$RANDOM;
if [ "$PGPORT" -gt 10000 ] && [ "$PGPORT" -lt 20000 ]; then
break
fi
done
export PGPORT
echo "- starting PostgreSQL on port $PGPORT"
if %p/bin/pgsql.sh-8.0 start >/tmp/pgstart-8.0.log 2>&1; then

sleep 5

ERROR=0
# install the plpgsql language if possible
printf -- "- attempting to install the plpgsql language in the template1 database... "
%p/bin/createlang-8.0 -U postgres -p $PGPORT plpgsql template1 >/tmp/createlang-8.0.log 2>&1 || ERROR="$?"
if [ $ERROR -eq 0 ]; then
echo "done"
elif [ $ERROR -gt 0 ] && [ $ERROR -ne 2 ]; then
echo "WARNING: an unknown error occurred inserting the plpgsql language"
else
:
fi

sleep 5

%p/bin/pgsql.sh-8.0 stop >/dev/null 2>&1 || echo "WARNING: unable to stop postgresql: run 'PGPORT=$PGPORT sudo %p/bin/pgsql.sh-8.0 stop' to try again"

else

cat < WARNING: unable to start postgresql on an alternate port, not installing plpgsql!

If you wish to install it manually, run:

sudo %p/bin/pgsql.sh-8.0 start
sudo -u postgres %p/bin/createlang-8.0 plpgsql template1

END

fi
<<
PreRmScript: <<
[ -x %p/var/postgresql-8.0/remove-alternatives.sh ] && %p/var/postgresql-8.0/remove-alternatives.sh

# clean up
daemonic remove postgresql >/dev/null 2>&1 || true
daemonic remove postgresql80-ssl >/dev/null 2>&1 || true
daemonic remove postgresql80 >/dev/null 2>&1 || true
if [ $1 != "upgrade" ]; then
daemonic remove %N
fi
<<
PostRmScript: [ -x %p/var/postgresql-8.0/update-alternatives.sh ] && %p/var/postgresql-8.0/update-alternatives.sh
DaemonicFile: <<

PostgreSQL database server
PostgreSQL database server


%p/bin/pgsql.sh-8.0
start



<<

Homepage: http://www.postgresql.org/
DescUsage: <<
The package runs initdb on installation as the user 'postgres'.

The best way to run it is using the supplied pgsql.sh script, i.e.
'sudo pgsql.sh start'. Or, you can run
'sudo daemonic enable %N' as root to create a
StartupItem for it.

Unless you set up admin users in the database, the easiest way to
run psql commands with administrator access is to prefix them with
the command "sudo -u postgres". This will ask you your administrator
password, and then run the command as the postgres user.

For example, to create a new database, you would run:

sudo -u postgres createdb mydb
<<
DescPackaging: <<
IMPORTANT: The location of the data files has changed from early
revisions of this package. If you're upgrading from an earlier
revision, note that this one expects the data files to be installed
at /var/postgresql-8.0/data.

When run from the startup script, logs output to
/var/postgresql-8.0/pgsql.log
<<
DescPort: <<
Rearranged a lot of the PostgreSQL build to be more "correct" on
Darwin, including making proper dylibs (instead of bundles, which
ended up creating static binaries).
<<

postgresql80-unified _unstable_ port .patch


--- postgresql-8.0.15/contrib/Makefile 2004-12-14 17:50:23.000000000 -0500
+++ postgresql-8.0.15-new/contrib/Makefile 2008-01-15 11:05:45.000000000 -0500
@@ -37,7 +37,6 @@
string \
tablefunc \
tips \
- tsearch \
tsearch2 \
userlock \
vacuumlo
--- postgresql-8.0.15/pgsql.sh 1969-12-31 19:00:00.000000000 -0500
+++ postgresql-8.0.15-new/pgsql.sh 2008-01-15 11:06:02.000000000 -0500
@@ -0,0 +1,73 @@
+#!/bin/sh
+
+die () {
+ echo "failed"
+ echo ""
+ echo "*** bailing because an error ocurred:"
+ echo ""
+ echo "$*"
+ exit 1
+}
+
+PREFIX="@INSTPREFIX@"
+DATADIR="${PREFIX}/var/postgresql-8.0/data"
+LOGFILE="${PREFIX}/var/postgresql-8.0/pgsql.log"
+
+export LANG=C
+unset LC_ALL
+
+SHMMAX=`sysctl kern.sysv.shmmax | cut -d' ' -f2-`
+SHMMNI=`sysctl kern.sysv.shmmni | cut -d' ' -f2-`
+SHMALL=`sysctl kern.sysv.shmall | cut -d' ' -f2-`
+
+if [ "$SHMMAX" -lt "8388608" ] || [ "$SHMMNI" -lt "64" ] || [ "$SHMALL" -lt "32768" ]; then
+ echo "WARNING: You probably need to set your shared memory resources higher for"
+ echo " PostgreSQL to function. For more information on raising your shared"
+ echo " memory settings, see:"
+ echo " http://wiki.finkproject.org/index.php/Shared_Memory_Regions_on_Darwin"
+ echo ""
+ echo " I am also creating a default configuration in /etc/sysctl.conf.pg"
+ echo " that contains values that will work with the default PostgreSQL "
+ echo " memory settings. To use it, rename it to /etc/sysctl.conf (if you"
+ echo " don't have one already) and reboot."
+ echo ""
+ echo " For now, I'll try setting your sysctl to something higher and then"
+ echo " running things anyways. Good luck! =)"
+ echo ""
+ sysctl -w kern.sysv.shmmax=8388608
+ sysctl -w kern.sysv.shmmin=1
+ sysctl -w kern.sysv.shmmni=64
+ sysctl -w kern.sysv.shmseg=8
+ sysctl -w kern.sysv.shmall=32768
+ echo ""
+ cat </etc/sysctl.conf.pg
+kern.sysv.shmmax=8388608
+kern.sysv.shmmin=1
+kern.sysv.shmmni=64
+kern.sysv.shmseg=8
+kern.sysv.shmall=32768
+END
+fi
+
+if [ ! -d "$DATADIR" ]; then
+ printf -- "- making postgresql directories: "
+ sudo mkdir -p "$DATADIR"
+ sudo chown -R postgres "$DATADIR/.."
+ echo "ok"
+
+ printf -- "- initializing database in $DATADIR: "
+ sudo -u postgres ${PREFIX}/bin/initdb-8.0 -D "$DATADIR" >/tmp/pgsql-init-8.0.log 2>&1 || die "couldn't initialize database"
+ echo "ok"
+fi
+
+case "$1" in
+ start)
+ unset LC_ALL; LANG=C sudo -u postgres "${PREFIX}/bin/pg_ctl-8.0" start -D "$DATADIR" -l "$LOGFILE"
+ ;;
+ restart)
+ unset LC_ALL; LANG=C sudo -u postgres "${PREFIX}/bin/pg_ctl-8.0" restart -D "$DATADIR" -m fast
+ ;;
+ stop)
+ unset LC_ALL; LANG=C sudo -u postgres "${PREFIX}/bin/pg_ctl-8.0" stop -D "$DATADIR" -m fast
+ ;;
+esac
--- postgresql-8.0.15/src/Makefile.global.in 2005-03-25 13:18:39.000000000 -0500
+++ postgresql-8.0.15-new/src/Makefile.global.in 2008-01-15 11:05:46.000000000 -0500
@@ -65,21 +65,21 @@
libexecdir := @libexecdir@
ifeq "$(findstring pgsql, $(libexecdir))" ""
ifeq "$(findstring postgres, $(libexecdir))" ""
-override libexecdir := $(libexecdir)/postgresql
+override libexecdir := $(libexecdir)/postgresql-8.0
endif
endif

datadir := @datadir@
ifeq "$(findstring pgsql, $(datadir))" ""
ifeq "$(findstring postgres, $(datadir))" ""
-override datadir := $(datadir)/postgresql
+override datadir := $(datadir)/postgresql-8.0
endif
endif

sysconfdir := @sysconfdir@
ifeq "$(findstring pgsql, $(sysconfdir))" ""
ifeq "$(findstring postgres, $(sysconfdir))" ""
-override sysconfdir := $(sysconfdir)/postgresql
+override sysconfdir := $(sysconfdir)/postgresql-8.0
endif
endif

@@ -87,7 +87,7 @@
pkglibdir = $(libdir)
ifeq "$(findstring pgsql, $(pkglibdir))" ""
ifeq "$(findstring postgres, $(pkglibdir))" ""
-override pkglibdir := $(pkglibdir)/postgresql
+override pkglibdir := $(pkglibdir)/postgresql-8.0
endif
endif

@@ -95,7 +95,7 @@
pkgincludedir = $(includedir)
ifeq "$(findstring pgsql, $(pkgincludedir))" ""
ifeq "$(findstring postgres, $(pkgincludedir))" ""
-override pkgincludedir := $(pkgincludedir)/postgresql
+override pkgincludedir := $(pkgincludedir)/postgresql-8.0
endif
endif
includedir_server = $(pkgincludedir)/server
@@ -109,7 +109,7 @@
ifneq (,$(docdir))
ifeq "$(findstring pgsql, $(docdir))" ""
ifeq "$(findstring postgres, $(docdir))" ""
-override docdir := $(docdir)/postgresql
+override docdir := $(docdir)/postgresql-8.0
endif
endif
endif
--- postgresql-8.0.15/src/Makefile.shlib 2005-12-03 15:16:50.000000000 -0500
+++ postgresql-8.0.15-new/src/Makefile.shlib 2008-01-15 11:05:46.000000000 -0500
@@ -107,11 +107,11 @@
ifeq ($(DLTYPE), library)
# linkable library
DLSUFFIX := .dylib
- LINK.shared = $(COMPILER) -dynamiclib -install_name $(libdir)/lib$(NAME).$(SO_MAJOR_VERSION)$(DLSUFFIX) $(version_link) -multiply_defined suppress
+ LINK.shared = $(CXX) $(CFLAGS) -dynamiclib -install_name $(libdir)/lib$(NAME).$(SO_MAJOR_VERSION)$(DLSUFFIX) $(version_link) -multiply_defined suppress
else
# loadable module (default case)
DLSUFFIX := .so
- LINK.shared = $(COMPILER) -bundle
+ LINK.shared = $(CXX) $(CFLAGS) -bundle
endif
shlib = lib$(NAME).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)$(DLSUFFIX)
shlib_major = lib$(NAME).$(SO_MAJOR_VERSION)$(DLSUFFIX)
--- postgresql-8.0.15/src/backend/main/main.c 2006-01-31 19:47:02.000000000 -0500
+++ postgresql-8.0.15-new/src/backend/main/main.c 2008-01-15 11:05:46.000000000 -0500
@@ -56,6 +56,7 @@
struct passwd *pw;
#endif
char *pw_name_persist;
+ char *progname;

/*
* Place platform-specific startup hacks here. This is the right
@@ -267,7 +268,26 @@
*/
len = strlen(argv[0]);

- if ((len >= 10 && strcmp(argv[0] + len - 10, "postmaster") == 0)
+ /*
+ * Find the program name, which is after the final slash in the
+ * program argument.
+ */
+ progname = strrchr(argv[0], '/');
+ if (progname != NULL)
+ {
+ progname = progname + 1;
+ }
+ else
+ {
+ progname = argv[0];
+ }
+
+ /*
+ * Now check if the program name starts with the
+ * word "postmaster", in which case PostmasterMain is called.
+ */
+ len = strlen(progname);
+ if ((len >= 10 && strncmp(progname, "postmaster", 10) == 0)
#ifdef WIN32
|| (len >= 14 && strcmp(argv[0] + len - 14, "postmaster.exe") == 0)
#endif
--- postgresql-8.0.15/src/backend/utils/fmgr/dfmgr.c 2004-12-31 17:01:31.000000000 -0500
+++ postgresql-8.0.15-new/src/backend/utils/fmgr/dfmgr.c 2008-01-15 11:05:46.000000000 -0500
@@ -305,6 +305,26 @@
pfree(full);
}

+ new = palloc(strlen(name) + strlen(".so") + 1);
+ strcpy(new, name);
+ strcat(new, ".so");
+
+ if (!have_slash)
+ {
+ full = find_in_dynamic_libpath(new);
+ pfree(new);
+ if (full)
+ return full;
+ }
+ else
+ {
+ full = substitute_libpath_macro(new);
+ pfree(new);
+ if (file_exists(full))
+ return full;
+ pfree(full);
+ }
+
new = palloc(strlen(name) + strlen(DLSUFFIX) + 1);
strcpy(new, name);
strcat(new, DLSUFFIX);
--- postgresql-8.0.15/src/backend/utils/misc/postgresql.conf.sample 2006-05-21 16:11:25.000000000 -0400
+++ postgresql-8.0.15-new/src/backend/utils/misc/postgresql.conf.sample 2008-01-15 11:05:46.000000000 -0500
@@ -61,7 +61,7 @@
# - Security & Authentication -

#authentication_timeout = 60 # 1-600, in seconds
-#ssl = false
+ssl = false
#password_encryption = true
#krb_server_keyfile = ''
#db_user_namespace = false
--- postgresql-8.0.15/src/bin/initdb/initdb.c 2006-05-21 15:57:39.000000000 -0400
+++ postgresql-8.0.15-new/src/bin/initdb/initdb.c 2008-01-15 11:05:46.000000000 -0500
@@ -117,7 +117,7 @@

/* defaults */
int n_connections = 10;
-int n_buffers = 50;
+int n_buffers = 20;

/*
* Warning messages for authentication methods
@@ -2313,7 +2313,7 @@
sprintf(pgdenv, "PGDATA=%s", pg_data);
putenv(pgdenv);

- if ((ret = find_other_exec(argv[0], "postgres", PG_VERSIONSTR,
+ if ((ret = find_other_exec(argv[0], "postgres-8.0", PG_VERSIONSTR,
backend_exec)) < 0)
{
char full_path[MAXPGPATH];
@@ -2323,14 +2323,14 @@

if (ret == -1)
fprintf(stderr,
- _("The program \"postgres\" is needed by %s "
+ _("The program \"postgres-8.0\" is needed by %s "
"but was not found in the\n"
"same directory as \"%s\".\n"
"Check your installation.\n"),
progname, full_path);
else
fprintf(stderr,
- _("The program \"postgres\" was found by \"%s\"\n"
+ _("The program \"postgres-8.0\" was found by \"%s\"\n"
"but was not the same version as %s.\n"
"Check your installation.\n"),
full_path, progname);
@@ -2617,7 +2617,7 @@
get_parent_directory(bin_dir);

printf(_("\nSuccess. You can now start the database server using:\n\n"
- " %s%s%s%spostmaster -D %s%s%s\n"
+ " %s%s%s%spostmaster-8.0 -D %s%s%s\n"
"or\n"
" %s%s%s%spg_ctl -D %s%s%s -l logfile start\n\n"),
QUOTE_PATH, bin_dir, QUOTE_PATH, (strlen(bin_dir) > 0) ? DIR_SEP : "",
--- postgresql-8.0.15/src/bin/pg_ctl/pg_ctl.c 2006-06-25 00:38:08.000000000 -0400
+++ postgresql-8.0.15-new/src/bin/pg_ctl/pg_ctl.c 2008-01-15 11:05:46.000000000 -0500
@@ -538,7 +538,7 @@

postmaster_path = xmalloc(MAXPGPATH);

- if ((ret = find_other_exec(argv0, "postmaster", PM_VERSIONSTR,
+ if ((ret = find_other_exec(argv0, "postmaster-8.0", PM_VERSIONSTR,
postmaster_path)) < 0)
{
char full_path[MAXPGPATH];
@@ -547,13 +547,13 @@
StrNCpy(full_path, progname, MAXPGPATH);

if (ret == -1)
- write_stderr(_("The program \"postmaster\" is needed by %s "
+ write_stderr(_("The program \"postmaster-8.0\" is needed by %s "
"but was not found in the\n"
"same directory as \"%s\".\n"
"Check your installation.\n"),
progname, full_path);
else
- write_stderr(_("The program \"postmaster\" was found by \"%s\"\n"
+ write_stderr(_("The program \"postmaster-8.0\" was found by \"%s\"\n"
"but was not the same version as %s.\n"
"Check your installation.\n"),
full_path, progname);
@@ -892,7 +892,7 @@
}
else
{
- ret = find_other_exec(argv0, "postmaster", PM_VERSIONSTR, cmdLine);
+ ret = find_other_exec(argv0, "postmaster-8.0", PM_VERSIONSTR, cmdLine);
if (ret != 0)
{
write_stderr(_("%s: could not find postmaster program executable\n"), progname);
--- postgresql-8.0.15/src/interfaces/ecpg/compatlib/Makefile 2005-03-13 17:04:45.000000000 -0500
+++ postgresql-8.0.15-new/src/interfaces/ecpg/compatlib/Makefile 2008-01-15 11:05:46.000000000 -0500
@@ -20,6 +20,7 @@
override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir) \
-I$(top_srcdir)/src/include/utils $(CPPFLAGS)
override CFLAGS += $(PTHREAD_CFLAGS)
+override LDFLAGS := -L../ecpglib -L../pgtypeslib -L../../libpq $(LDFLAGS)
SHLIB_LINK = -L../ecpglib -lecpg -L../pgtypeslib -lpgtypes $(libpq) \
$(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -lm, $(LIBS)) $(PTHREAD_LIBS)

--- postgresql-8.0.15/src/interfaces/ecpg/ecpglib/Makefile 2005-03-13 17:04:45.000000000 -0500
+++ postgresql-8.0.15-new/src/interfaces/ecpg/ecpglib/Makefile 2008-01-15 11:05:46.000000000 -0500
@@ -19,6 +19,7 @@

override CPPFLAGS := -DFRONTEND -I$(top_srcdir)/src/interfaces/ecpg/include \
-I$(libpq_srcdir) -I$(top_builddir)/src/port $(CPPFLAGS)
+override LDFLAGS := -L../ecpglib -L../pgtypeslib -L../../libpq $(LDFLAGS)
override CFLAGS += $(PTHREAD_CFLAGS)

# Need to recomple any libpgport object files
--- postgresql-8.0.15/src/makefiles/Makefile.darwin 2006-01-19 16:20:32.000000000 -0500
+++ postgresql-8.0.15-new/src/makefiles/Makefile.darwin 2008-01-15 11:05:46.000000000 -0500
@@ -13,6 +13,6 @@
# Rule for building shared libs (currently used only for regression test
# shlib ... should go away, since this is not really enough knowledge)
%.so: %.o
- $(CC) -bundle -o $@ $< $(BE_DLLLIBS)
+ $(CXX) -bundle -undefined dynamic_lookup -o $@ $< $(BE_DLLLIBS)

sqlmansect = 7
--- postgresql-8.0.15/src/template/darwin 2004-04-26 00:04:42.000000000 -0400
+++ postgresql-8.0.15-new/src/template/darwin 2008-01-15 11:05:46.000000000 -0500
@@ -1,6 +1,2 @@
-# Apple's cpp-precomp seems a tad broken, so don't use it
-# (Note: on OS X before 10.2, you might need -traditional-cpp instead)
-CC="$CC -no-cpp-precomp"
-
# Select appropriate semaphore support
USE_NAMED_POSIX_SEMAPHORES=1