the Fink project is an effort to port
popular Unix programs to Mac OS X
Package: postgresql81
Version: 8.1.13
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,
libxml2,
libxslt,
passwd (>= 20030906-1),
readline5,
system-openssl-dev
<<
Provides: postgresql-server
Conflicts: <<
postgresql (<< %v-%r),
postgresql-ssl (<< %v-%r)
<<
Replaces: <<
postgresql (<< %v-%r),
postgresql-ssl (<< %v-%r),
postgresql-shlibs,
postgresql-ssl-shlibs,
postgresql-python,
postgresql-ssl-python,
postgresql-perl,
postgresql-ssl-perl,
postgresql73,
postgresql73-ssl,
postgresql74 (<< %v-%r),
postgresql74-ssl (<< %v-%r)
<<
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: fb88b45deeed02e8822fa0ed8e03aa13
PatchScript: <<
sed -e 's|@BUILDDIR@|%b|g' -e 's|@INSTPREFIX@|%p|g' < %a/%n.patch | patch -p1
perl -pi -e 's,^enum,static enum,' contrib/pgcrypto/pgp.h
<<
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-bonjour --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
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.1
echo "be sure to back up this database before any upgrades!" >> %i/var/postgresql-8.1/README
rm -rf %i/bin/postmaster
ln -sf postgres-8.1 %i/bin/postmaster
install -d -m 755 %i/var/log
ln -sf %p/var/postgresql-8.1/pgsql.log %i/var/log/pgsql-8.1.log
for libname in libecpg.5.1 libecpg_compat.2.1 libpgtypes.2.1 libpq.4.1; do
mv %i/lib/$libname.dylib %i/lib/$libname.dylib-8.1
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.1"
echo "${file}" >> %i/var/postgresql-8.1/binary.list
install_name_tool -change %p/lib/libpq.4.dylib %p/lib/libpq.4.1.dylib "%i/bin/${file}-8.1" >/dev/null 2>&1 || :
install_name_tool -change %p/lib/libecpg.5.dylib %p/lib/libecpg.5.1.dylib "%i/bin/${file}-8.1" >/dev/null 2>&1 || :
install_name_tool -change %p/lib/libecpg_compat.2.dylib %p/lib/libecpg_compat.2.1.dylib "%i/bin/${file}-8.1" >/dev/null 2>&1 || :
install_name_tool -change %p/lib/libpgtypes.2.dylib %p/lib/libpgtypes.2.1.dylib "%i/bin/${file}-8.1" >/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.1.dylib "$file" >/dev/null 2>&1 || :
install_name_tool -change %p/lib/libecpg.5.dylib %p/lib/libecpg.5.1.dylib "$file" >/dev/null 2>&1 || :
install_name_tool -change %p/lib/libecpg_compat.2.dylib %p/lib/libecpg_compat.2.1.dylib "$file" >/dev/null 2>&1 || :
install_name_tool -change %p/lib/libpgtypes.2.dylib %p/lib/libpgtypes.2.1.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.1"
echo "${file}" >> %i/var/postgresql-8.1/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.1"
echo "${file}" >> %i/var/postgresql-8.1/man7.list
done
cat <
#!/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.1.dylib" "%p/lib/libecpg.5.1.dylib-8.1"
update-alternatives --remove "libecpg.5.dylib" "%p/lib/libecpg.5.1.dylib-8.1"
update-alternatives --remove "libecpg_compat.2.1.dylib" "%p/lib/libecpg_compat.2.1.dylib-8.1"
update-alternatives --remove "libecpg_compat.2.dylib" "%p/lib/libecpg_compat.2.1.dylib-8.1"
update-alternatives --remove "libpgtypes.2.1.dylib" "%p/lib/libpgtypes.2.1.dylib-8.1"
update-alternatives --remove "libpgtypes.2.dylib" "%p/lib/libpgtypes.2.1.dylib-8.1"
update-alternatives --remove "libpq.4.1.dylib" "%p/lib/libpq.4.1.dylib-8.1"
update-alternatives --remove "libpq.4.dylib" "%p/lib/libpq.4.1.dylib-8.1"
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.1/\${TUPLE_FILE}\`; do
update-alternatives --remove "\${file}" "\${TUPLE_PATH}/\${file}-8.1"
done
done
END
cat <
#!/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.1.dylib-8.1" ]; then
update-alternatives --install "%p/lib/libecpg.5.1.dylib" "libecpg.5.1.dylib" "%p/lib/libecpg.5.1.dylib-8.1" 0501000801
update-alternatives --install "%p/lib/libecpg.4.dylib" "libecpg.4.dylib" "%p/lib/libecpg.5.1.dylib-8.1" 0501000801
else
echo "WARNING: %p/lib/libecpg.5.1.dylib-8.1 does not exist"
fi
if [ -e "%p/lib/libecpg_compat.2.1.dylib-8.1" ]; then
update-alternatives --install "%p/lib/libecpg_compat.2.1.dylib" "libecpg_compat.2.1.dylib" "%p/lib/libecpg_compat.2.1.dylib-8.1" 0201000801
update-alternatives --install "%p/lib/libecpg_compat.2.dylib" "libecpg_compat.2.dylib" "%p/lib/libecpg_compat.2.1.dylib-8.1" 0201000801
else
echo "WARNING: %p/lib/libecpg_compat.2.1.dylib-8.1 does not exist"
fi
if [ -e "%p/lib/libpgtypes.2.1.dylib-8.1" ]; then
update-alternatives --install "%p/lib/libpgtypes.2.1.dylib" "libpgtypes.2.1.dylib" "%p/lib/libpgtypes.2.1.dylib-8.1" 0201000801
update-alternatives --install "%p/lib/libpgtypes.2.dylib" "libpgtypes.2.dylib" "%p/lib/libpgtypes.2.1.dylib-8.1" 0201000801
else
echo "WARNING: %p/lib/libpgtypes.2.1.dylib-8.1 does not exist"
fi
if [ -e "%p/lib/libpq.4.1.dylib-8.1" ]; then
update-alternatives --install "%p/lib/libpq.4.1.dylib" "libpq.4.1.dylib" "%p/lib/libpq.4.1.dylib-8.1" 0401000801
update-alternatives --install "%p/lib/libpq.4.dylib" "libpq.4.dylib" "%p/lib/libpq.4.1.dylib-8.1" 0401000801
else
echo "WARNING: %p/lib/libpq.4.1.dylib-8.1 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.1/\${TUPLE_FILE}\`; do
if [ -e "\${TUPLE_PATH}/\${file}-8.1" ]; then
update-alternatives --install "\${TUPLE_PATH}/\${file}" "\${file}" "\${TUPLE_PATH}/\${file}-8.1" 81
fi
done
done
END
chmod 755 %i/var/postgresql-8.1/*.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: <<
postgresql73-dev,
postgresql73-ssl-dev,
postgresql73-unified-dev,
postgresql74-dev,
postgresql74-ssl-dev,
postgresql74-unified-dev,
postgresql80-dev,
postgresql80-ssl-dev,
postgresql80-unified-dev,
postgresql82-dev,
postgresql83-dev
<<
Replaces: <<
postgresql73-dev,
postgresql73-ssl-dev,
postgresql73-unified-dev,
postgresql74-dev,
postgresql74-ssl-dev,
postgresql74-unified-dev,
postgresql80-dev,
postgresql80-ssl-dev,
postgresql80-unified-dev,
%N (<< %v-%r),
postgresql82-dev,
postgresql83-dev
<<
BuildDependsOnly: true
Files: <<
bin/pg_config*
include
lib/*.a
lib/libecpg.dylib
lib/libecpg_compat.dylib
lib/libpgtypes.dylib
lib/libpq.dylib
share/man/man1/pg_config*
<<
PostInstScript: [ -x %p/var/postgresql-8.1/update-alternatives.sh ] && %p/var/postgresql-8.1/update-alternatives.sh
PreRmScript: [ -x %p/var/postgresql-8.1/remove-alternatives.sh ] && %p/var/postgresql-8.1/remove-alternatives.sh
PostRmScript: [ -x %p/var/postgresql-8.1/update-alternatives.sh ] && %p/var/postgresql-8.1/update-alternatives.sh
<<
SplitOff2: <<
Package: %N-shlibs
Description: PostgreSQL shared libraries
Conflicts: <<
postgresql81-shlibs (<< %v-%r),
postgresql81-ssl-shlibs (<< %v-%r)
<<
Replaces: <<
postgresql73-shlibs,
postgresql73-ssl-shlibs,
postgresql73-unified-shlibs,
postgresql74-shlibs,
postgresql74-ssl-shlibs,
postgresql74-unified-shlibs,
postgresql,
postgresql-shlibs,
postgresql80-unified-shlibs
<<
Files: lib/*.dylib* var/postgresql-8.1/*.sh var/postgresql-8.1/*.list
Shlibs: <<
%p/lib/libecpg.5.dylib 5.0.0 postgresql80-unified-shlibs (>= 8.0.1-1) | postgresql81-shlibs (>= 8.1-1)
%p/lib/libecpg_compat.2.dylib 2.0.0 postgresql80-unified-shlibs (>= 8.0.1-1) | postgresql81-shlibs (>= 8.1-1)
%p/lib/libpgtypes.2.dylib 2.0.0 postgresql80-unified-shlibs (>= 8.0.1-1) | postgresql81-shlibs (>= 8.1-1)
%p/lib/libpq.4.dylib 4.0.0 postgresql80-unified-shlibs (>= 8.0.1-1) | postgresql81-shlibs (>= 8.1-1)
<<
PostInstScript: [ -x %p/var/postgresql-8.1/update-alternatives.sh ] && %p/var/postgresql-8.1/update-alternatives.sh
PreRmScript: [ -x %p/var/postgresql-8.1/remove-alternatives.sh ] && %p/var/postgresql-8.1/remove-alternatives.sh
<<
PostInstScript: <<
INSTALL_PHASE="$1"
[ -x %p/var/postgresql-8.1/update-alternatives.sh ] && %p/var/postgresql-8.1/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.1 start >/tmp/pgstart-8.1.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.1 -U postgres -p $PGPORT plpgsql template1 >/tmp/createlang-8.1.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.1 stop >/dev/null 2>&1 || echo "WARNING: unable to stop postgresql: run 'PGPORT=$PGPORT sudo %p/bin/pgsql.sh-8.1 stop' to try again"
else
cat <
If you wish to install it manually, run:
sudo %p/bin/pgsql.sh-8.1 start
sudo -u postgres %p/bin/createlang-8.1 plpgsql template1
END
fi
<<
PreRmScript: <<
[ -x %p/var/postgresql-8.1/remove-alternatives.sh ] && %p/var/postgresql-8.1/remove-alternatives.sh
# clean up
if [ $1 != "upgrade" ]; then
daemonic remove %N
fi
<<
PostRmScript: [ -x %p/var/postgresql-8.1/update-alternatives.sh ] && %p/var/postgresql-8.1/update-alternatives.sh
DaemonicFile: <<
<<
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
When run from the startup script, logs output to
<<
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).
<<
--- postgresql-8.1.11/contrib/Makefile 2005-09-01 18:02:44.000000000 -0400
+++ postgresql-8.1.11-new/contrib/Makefile 2008-01-15 11:06:35.000000000 -0500
@@ -20,6 +20,7 @@
lo \
ltree \
oid2name \
+ oracle \
pg_buffercache \
pg_trgm \
pgbench \
@@ -31,13 +32,13 @@
tips \
tsearch2 \
userlock \
- vacuumlo
+ vacuumlo \
+ xml2
# Missing:
# adddepend \ (does not have a makefile)
# mSQL-interface \ (requires msql installed)
# mac \ (does not have a makefile)
-# oracle \ (does not have a makefile)
# start-scripts \ (does not have a makefile)
# xml2 \ (requires libxml installed)
--- postgresql-8.1.11/contrib/oracle/Makefile 1969-12-31 19:00:00.000000000 -0500
+++ postgresql-8.1.11-new/contrib/oracle/Makefile 2008-01-15 11:06:35.000000000 -0500
@@ -0,0 +1,11 @@
+# oracle conversion Perl scripts
+
+subdir = contrib/oracle
+top_builddir = ../..
+include $(top_builddir)/src/Makefile.global
+
+MODULES =
+SCRIPTS = Ora2Pg.pm ora2pg.pl
+DOCS = README.ora2pg
+
+include $(top_srcdir)/contrib/contrib-global.mk
--- postgresql-8.1.11/contrib/oracle/ora2pg.pl 2003-01-07 17:17:14.000000000 -0500
+++ postgresql-8.1.11-new/contrib/oracle/ora2pg.pl 2008-01-15 11:06:35.000000000 -0500
@@ -17,6 +17,10 @@
use strict;
+# allow to put Ora2Pg.pm in the same directory as this script
+use File::Basename;
+use lib dirname($0);
+
use Ora2Pg;
# Initialyze the database connection
--- postgresql-8.1.11/pgsql.sh 1969-12-31 19:00:00.000000000 -0500
+++ postgresql-8.1.11-new/pgsql.sh 2008-01-15 11:06:46.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.1/data"
+LOGFILE="${PREFIX}/var/postgresql-8.1/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 <
+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.1 -D "$DATADIR" >/tmp/pgsql-init-8.1.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.1" start -D "$DATADIR" -l "$LOGFILE"
+ ;;
+ restart)
+ unset LC_ALL; LANG=C sudo -u postgres "${PREFIX}/bin/pg_ctl-8.1" restart -D "$DATADIR" -m fast
+ ;;
+ stop)
+ unset LC_ALL; LANG=C sudo -u postgres "${PREFIX}/bin/pg_ctl-8.1" stop -D "$DATADIR" -m fast
+ ;;
+esac
--- postgresql-8.1.11/src/Makefile.global.in 2005-09-27 13:39:32.000000000 -0400
+++ postgresql-8.1.11-new/src/Makefile.global.in 2008-01-15 11:06:35.000000000 -0500
@@ -73,14 +73,14 @@
datadir := @datadir@
ifeq "$(findstring pgsql, $(datadir))" ""
ifeq "$(findstring postgres, $(datadir))" ""
-override datadir := $(datadir)/postgresql
+override datadir := $(datadir)/postgresql-8.1
endif
endif
sysconfdir := @sysconfdir@
ifeq "$(findstring pgsql, $(sysconfdir))" ""
ifeq "$(findstring postgres, $(sysconfdir))" ""
-override sysconfdir := $(sysconfdir)/postgresql
+override sysconfdir := $(sysconfdir)/postgresql-8.1
endif
endif
@@ -89,7 +89,7 @@
pkglibdir = $(libdir)
ifeq "$(findstring pgsql, $(pkglibdir))" ""
ifeq "$(findstring postgres, $(pkglibdir))" ""
-override pkglibdir := $(pkglibdir)/postgresql
+override pkglibdir := $(pkglibdir)/postgresql-8.1
endif
endif
@@ -109,7 +109,7 @@
ifneq (,$(docdir))
ifeq "$(findstring pgsql, $(docdir))" ""
ifeq "$(findstring postgres, $(docdir))" ""
-override docdir := $(docdir)/postgresql
+override docdir := $(docdir)/postgresql-8.1
endif
endif
endif
--- postgresql-8.1.11/src/Makefile.shlib 2005-12-03 15:16:39.000000000 -0500
+++ postgresql-8.1.11-new/src/Makefile.shlib 2008-01-15 11:06:35.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 -undefined dynamic_lookup
endif
shlib = lib$(NAME).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)$(DLSUFFIX)
shlib_major = lib$(NAME).$(SO_MAJOR_VERSION)$(DLSUFFIX)
--- postgresql-8.1.11/src/backend/main/main.c 2006-01-31 19:32:05.000000000 -0500
+++ postgresql-8.1.11-new/src/backend/main/main.c 2008-01-15 11:06:35.000000000 -0500
@@ -259,7 +259,8 @@
* possibly first argument) we were called with. The lack of consistency
* here is historical.
*/
- if (strcmp(progname, "postmaster") == 0)
+ if (strlen(progname) >= 10 && strncmp(progname, "postmaster", 10) == 0)
+
{
/* Called as "postmaster" */
exit(PostmasterMain(argc, argv));
--- postgresql-8.1.11/src/backend/storage/file/fd.c 2006-01-17 18:52:50.000000000 -0500
+++ postgresql-8.1.11-new/src/backend/storage/file/fd.c 2008-01-15 11:06:35.000000000 -0500
@@ -51,6 +51,7 @@
#include "storage/fd.h"
#include "storage/ipc.h"
+#include
/*
* We must leave some file descriptors free for system(), the dynamic loader,
@@ -345,15 +346,21 @@
int used = 0;
int highestfd = 0;
int j;
+ struct rlimit rlim;
size = 1024;
fd = (int *) palloc(size * sizeof(int));
+ getrlimit(RLIMIT_NOFILE, &rlim);
/* dup until failure or probe limit reached */
for (;;)
{
int thisfd;
+ /* Don't go beyond RLIMIT_NOFILE */
+ if (highestfd >= rlim.rlim_cur - 1)
+ break;
+
thisfd = dup(0);
if (thisfd < 0)
{
--- postgresql-8.1.11/src/backend/utils/misc/postgresql.conf.sample 2006-05-21 16:11:02.000000000 -0400
+++ postgresql-8.1.11-new/src/backend/utils/misc/postgresql.conf.sample 2008-01-15 11:06:35.000000000 -0500
@@ -63,7 +63,7 @@
# - Security & Authentication -
#authentication_timeout = 60 # 1-600, in seconds
-#ssl = off
+ssl = off
#password_encryption = on
#db_user_namespace = off
--- postgresql-8.1.11/src/bin/initdb/initdb.c 2006-05-27 14:07:22.000000000 -0400
+++ postgresql-8.1.11-new/src/bin/initdb/initdb.c 2008-01-15 11:06:35.000000000 -0500
@@ -116,7 +116,7 @@
/* defaults */
static int n_connections = 10;
-static int n_buffers = 50;
+static int n_buffers = 20;
/*
* Warning messages for authentication methods
@@ -2411,7 +2411,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.1", PG_VERSIONSTR,
backend_exec)) < 0)
{
char full_path[MAXPGPATH];
@@ -2421,14 +2421,14 @@
if (ret == -1)
fprintf(stderr,
- _("The program \"postgres\" is needed by %s "
+ _("The program \"postgres-8.1\" 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.1\" was found by \"%s\"\n"
"but was not the same version as %s.\n"
"Check your installation.\n"),
full_path, progname);
@@ -2715,9 +2715,9 @@
get_parent_directory(bin_dir);
printf(_("\nSuccess. You can now start the database server using:\n\n"
- " %s%s%spostmaster%s -D %s%s%s\n"
+ " %s%s%spostmaster-8.1%s -D %s%s%s\n"
"or\n"
- " %s%s%spg_ctl%s -D %s%s%s -l logfile start\n\n"),
+ " %s%s%spg_ctl-8.1%s -D %s%s%s -l logfile start\n\n"),
QUOTE_PATH, bin_dir, (strlen(bin_dir) > 0) ? DIR_SEP : "", QUOTE_PATH,
QUOTE_PATH, pg_data_native, QUOTE_PATH,
QUOTE_PATH, bin_dir, (strlen(bin_dir) > 0) ? DIR_SEP : "", QUOTE_PATH,
--- postgresql-8.1.11/src/bin/pg_ctl/pg_ctl.c 2006-06-25 00:38:00.000000000 -0400
+++ postgresql-8.1.11-new/src/bin/pg_ctl/pg_ctl.c 2008-01-15 11:06:35.000000000 -0500
@@ -540,7 +540,7 @@
postmaster_path = pg_malloc(MAXPGPATH);
- if ((ret = find_other_exec(argv0, "postmaster", PM_VERSIONSTR,
+ if ((ret = find_other_exec(argv0, "postmaster-8.1", PM_VERSIONSTR,
postmaster_path)) < 0)
{
char full_path[MAXPGPATH];
@@ -549,13 +549,13 @@
StrNCpy(full_path, progname, MAXPGPATH);
if (ret == -1)
- write_stderr(_("The program \"postmaster\" is needed by %s "
+ write_stderr(_("The program \"postmaster-8.1\" 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.1\" was found by \"%s\"\n"
"but was not the same version as %s.\n"
"Check your installation.\n"),
full_path, progname);
@@ -896,7 +896,7 @@
}
else
{
- ret = find_other_exec(argv0, "postmaster", PM_VERSIONSTR, cmdLine);
+ ret = find_other_exec(argv0, "postmaster-8.1", PM_VERSIONSTR, cmdLine);
if (ret != 0)
{
write_stderr(_("%s: could not find postmaster program executable\n"), progname);
--- postgresql-8.1.11/src/interfaces/ecpg/compatlib/Makefile 2005-03-14 12:27:49.000000000 -0500
+++ postgresql-8.1.11-new/src/interfaces/ecpg/compatlib/Makefile 2008-01-15 11:06:35.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.1.11/src/interfaces/ecpg/ecpglib/Makefile 2005-12-05 21:29:26.000000000 -0500
+++ postgresql-8.1.11-new/src/interfaces/ecpg/ecpglib/Makefile 2008-01-15 11:06:35.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 recompile any libpgport object files
--- postgresql-8.1.11/src/makefiles/Makefile.darwin 2006-11-28 00:47:16.000000000 -0500
+++ postgresql-8.1.11-new/src/makefiles/Makefile.darwin 2008-01-15 11:06:35.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) $(CFLAGS) -bundle -o $@ $< $(BE_DLLLIBS)
+ $(CC) $(CFLAGS) -bundle -undefined dynamic_lookup -o $@ $< $(BE_DLLLIBS)
sqlmansect = 7
--- postgresql-8.1.11/src/template/darwin 2004-04-26 00:04:42.000000000 -0400
+++ postgresql-8.1.11-new/src/template/darwin 2008-01-15 11:06:35.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
--- postgresql-8.1.11/src/test/regress/pg_regress.sh 2006-10-08 21:45:41.000000000 -0400
+++ postgresql-8.1.11-new/src/test/regress/pg_regress.sh 2008-01-15 11:06:35.000000000 -0500
@@ -397,6 +397,9 @@
mkdir -p "$LOGDIR" || { (exit 2); exit; }
fi
$GMAKE -C "$top_builddir" DESTDIR="$temp_install/install" install with_perl=no with_python=no >"$LOGDIR/install.log" 2>&1
+ pushd "$temp_install/install/@INSTPREFIX@/bin/"
+ ln -s postgres postgres-8.1
+ popd
if [ $? -ne 0 ]
then
Package: postgresql81
Version: 8.1.14
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,
libxml2,
libxslt,
passwd (>= 20030906-1),
readline5,
system-openssl-dev
<<
Provides: postgresql-server
Conflicts: <<
postgresql (<< %v-%r),
postgresql-ssl (<< %v-%r)
<<
Replaces: <<
postgresql (<< %v-%r),
postgresql-ssl (<< %v-%r),
postgresql-shlibs,
postgresql-ssl-shlibs,
postgresql-python,
postgresql-ssl-python,
postgresql-perl,
postgresql-ssl-perl,
postgresql73,
postgresql73-ssl,
postgresql74 (<< %v-%r),
postgresql74-ssl (<< %v-%r)
<<
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: 1c820aa8e21b890340a79b1a261c65e3
PatchScript: <<
sed -e 's|@BUILDDIR@|%b|g' -e 's|@INSTPREFIX@|%p|g' < %a/%n.patch | patch -p1
perl -pi -e 's,^enum,static enum,' contrib/pgcrypto/pgp.h
<<
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-bonjour --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
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.1
echo "be sure to back up this database before any upgrades!" >> %i/var/postgresql-8.1/README
rm -rf %i/bin/postmaster
ln -sf postgres-8.1 %i/bin/postmaster
install -d -m 755 %i/var/log
ln -sf %p/var/postgresql-8.1/pgsql.log %i/var/log/pgsql-8.1.log
for libname in libecpg.5.1 libecpg_compat.2.1 libpgtypes.2.1 libpq.4.1; do
mv %i/lib/$libname.dylib %i/lib/$libname.dylib-8.1
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.1"
echo "${file}" >> %i/var/postgresql-8.1/binary.list
install_name_tool -change %p/lib/libpq.4.dylib %p/lib/libpq.4.1.dylib "%i/bin/${file}-8.1" >/dev/null 2>&1 || :
install_name_tool -change %p/lib/libecpg.5.dylib %p/lib/libecpg.5.1.dylib "%i/bin/${file}-8.1" >/dev/null 2>&1 || :
install_name_tool -change %p/lib/libecpg_compat.2.dylib %p/lib/libecpg_compat.2.1.dylib "%i/bin/${file}-8.1" >/dev/null 2>&1 || :
install_name_tool -change %p/lib/libpgtypes.2.dylib %p/lib/libpgtypes.2.1.dylib "%i/bin/${file}-8.1" >/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.1.dylib "$file" >/dev/null 2>&1 || :
install_name_tool -change %p/lib/libecpg.5.dylib %p/lib/libecpg.5.1.dylib "$file" >/dev/null 2>&1 || :
install_name_tool -change %p/lib/libecpg_compat.2.dylib %p/lib/libecpg_compat.2.1.dylib "$file" >/dev/null 2>&1 || :
install_name_tool -change %p/lib/libpgtypes.2.dylib %p/lib/libpgtypes.2.1.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.1"
echo "${file}" >> %i/var/postgresql-8.1/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.1"
echo "${file}" >> %i/var/postgresql-8.1/man7.list
done
cat <
#!/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.1.dylib" "%p/lib/libecpg.5.1.dylib-8.1"
update-alternatives --remove "libecpg.5.dylib" "%p/lib/libecpg.5.1.dylib-8.1"
update-alternatives --remove "libecpg_compat.2.1.dylib" "%p/lib/libecpg_compat.2.1.dylib-8.1"
update-alternatives --remove "libecpg_compat.2.dylib" "%p/lib/libecpg_compat.2.1.dylib-8.1"
update-alternatives --remove "libpgtypes.2.1.dylib" "%p/lib/libpgtypes.2.1.dylib-8.1"
update-alternatives --remove "libpgtypes.2.dylib" "%p/lib/libpgtypes.2.1.dylib-8.1"
update-alternatives --remove "libpq.4.1.dylib" "%p/lib/libpq.4.1.dylib-8.1"
update-alternatives --remove "libpq.4.dylib" "%p/lib/libpq.4.1.dylib-8.1"
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.1/\${TUPLE_FILE}\`; do
update-alternatives --remove "\${file}" "\${TUPLE_PATH}/\${file}-8.1"
done
done
END
cat <
#!/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.1.dylib-8.1" ]; then
update-alternatives --install "%p/lib/libecpg.5.1.dylib" "libecpg.5.1.dylib" "%p/lib/libecpg.5.1.dylib-8.1" 0501000801
update-alternatives --install "%p/lib/libecpg.4.dylib" "libecpg.4.dylib" "%p/lib/libecpg.5.1.dylib-8.1" 0501000801
else
echo "WARNING: %p/lib/libecpg.5.1.dylib-8.1 does not exist"
fi
if [ -e "%p/lib/libecpg_compat.2.1.dylib-8.1" ]; then
update-alternatives --install "%p/lib/libecpg_compat.2.1.dylib" "libecpg_compat.2.1.dylib" "%p/lib/libecpg_compat.2.1.dylib-8.1" 0201000801
update-alternatives --install "%p/lib/libecpg_compat.2.dylib" "libecpg_compat.2.dylib" "%p/lib/libecpg_compat.2.1.dylib-8.1" 0201000801
else
echo "WARNING: %p/lib/libecpg_compat.2.1.dylib-8.1 does not exist"
fi
if [ -e "%p/lib/libpgtypes.2.1.dylib-8.1" ]; then
update-alternatives --install "%p/lib/libpgtypes.2.1.dylib" "libpgtypes.2.1.dylib" "%p/lib/libpgtypes.2.1.dylib-8.1" 0201000801
update-alternatives --install "%p/lib/libpgtypes.2.dylib" "libpgtypes.2.dylib" "%p/lib/libpgtypes.2.1.dylib-8.1" 0201000801
else
echo "WARNING: %p/lib/libpgtypes.2.1.dylib-8.1 does not exist"
fi
if [ -e "%p/lib/libpq.4.1.dylib-8.1" ]; then
update-alternatives --install "%p/lib/libpq.4.1.dylib" "libpq.4.1.dylib" "%p/lib/libpq.4.1.dylib-8.1" 0401000801
update-alternatives --install "%p/lib/libpq.4.dylib" "libpq.4.dylib" "%p/lib/libpq.4.1.dylib-8.1" 0401000801
else
echo "WARNING: %p/lib/libpq.4.1.dylib-8.1 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.1/\${TUPLE_FILE}\`; do
if [ -e "\${TUPLE_PATH}/\${file}-8.1" ]; then
update-alternatives --install "\${TUPLE_PATH}/\${file}" "\${file}" "\${TUPLE_PATH}/\${file}-8.1" 81
fi
done
done
END
chmod 755 %i/var/postgresql-8.1/*.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: <<
postgresql73-dev,
postgresql73-ssl-dev,
postgresql73-unified-dev,
postgresql74-dev,
postgresql74-ssl-dev,
postgresql74-unified-dev,
postgresql80-dev,
postgresql80-ssl-dev,
postgresql80-unified-dev,
postgresql82-dev,
postgresql83-dev
<<
Replaces: <<
postgresql73-dev,
postgresql73-ssl-dev,
postgresql73-unified-dev,
postgresql74-dev,
postgresql74-ssl-dev,
postgresql74-unified-dev,
postgresql80-dev,
postgresql80-ssl-dev,
postgresql80-unified-dev,
%N (<< %v-%r),
postgresql82-dev,
postgresql83-dev
<<
BuildDependsOnly: true
Files: <<
bin/pg_config*
include
lib/*.a
lib/libecpg.dylib
lib/libecpg_compat.dylib
lib/libpgtypes.dylib
lib/libpq.dylib
share/man/man1/pg_config*
<<
PostInstScript: [ -x %p/var/postgresql-8.1/update-alternatives.sh ] && %p/var/postgresql-8.1/update-alternatives.sh
PreRmScript: [ -x %p/var/postgresql-8.1/remove-alternatives.sh ] && %p/var/postgresql-8.1/remove-alternatives.sh
PostRmScript: [ -x %p/var/postgresql-8.1/update-alternatives.sh ] && %p/var/postgresql-8.1/update-alternatives.sh
<<
SplitOff2: <<
Package: %N-shlibs
Description: PostgreSQL shared libraries
Conflicts: <<
postgresql81-shlibs (<< %v-%r),
postgresql81-ssl-shlibs (<< %v-%r)
<<
Replaces: <<
postgresql73-shlibs,
postgresql73-ssl-shlibs,
postgresql73-unified-shlibs,
postgresql74-shlibs,
postgresql74-ssl-shlibs,
postgresql74-unified-shlibs,
postgresql,
postgresql-shlibs,
postgresql80-unified-shlibs
<<
Files: lib/*.dylib* var/postgresql-8.1/*.sh var/postgresql-8.1/*.list
Shlibs: <<
%p/lib/libecpg.5.dylib 5.0.0 postgresql80-unified-shlibs (>= 8.0.1-1) | postgresql81-shlibs (>= 8.1-1)
%p/lib/libecpg_compat.2.dylib 2.0.0 postgresql80-unified-shlibs (>= 8.0.1-1) | postgresql81-shlibs (>= 8.1-1)
%p/lib/libpgtypes.2.dylib 2.0.0 postgresql80-unified-shlibs (>= 8.0.1-1) | postgresql81-shlibs (>= 8.1-1)
%p/lib/libpq.4.dylib 4.0.0 postgresql80-unified-shlibs (>= 8.0.1-1) | postgresql81-shlibs (>= 8.1-1)
<<
PostInstScript: [ -x %p/var/postgresql-8.1/update-alternatives.sh ] && %p/var/postgresql-8.1/update-alternatives.sh
PreRmScript: [ -x %p/var/postgresql-8.1/remove-alternatives.sh ] && %p/var/postgresql-8.1/remove-alternatives.sh
<<
PostInstScript: <<
INSTALL_PHASE="$1"
[ -x %p/var/postgresql-8.1/update-alternatives.sh ] && %p/var/postgresql-8.1/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.1 start >/tmp/pgstart-8.1.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.1 -U postgres -p $PGPORT plpgsql template1 >/tmp/createlang-8.1.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.1 stop >/dev/null 2>&1 || echo "WARNING: unable to stop postgresql: run 'PGPORT=$PGPORT sudo %p/bin/pgsql.sh-8.1 stop' to try again"
else
cat <
If you wish to install it manually, run:
sudo %p/bin/pgsql.sh-8.1 start
sudo -u postgres %p/bin/createlang-8.1 plpgsql template1
END
fi
<<
PreRmScript: <<
[ -x %p/var/postgresql-8.1/remove-alternatives.sh ] && %p/var/postgresql-8.1/remove-alternatives.sh
# clean up
if [ $1 != "upgrade" ]; then
daemonic remove %N
fi
<<
PostRmScript: [ -x %p/var/postgresql-8.1/update-alternatives.sh ] && %p/var/postgresql-8.1/update-alternatives.sh
DaemonicFile: <<
<<
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
When run from the startup script, logs output to
<<
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).
<<
--- postgresql-8.1.11/contrib/Makefile 2005-09-01 18:02:44.000000000 -0400
+++ postgresql-8.1.11-new/contrib/Makefile 2008-01-15 11:06:35.000000000 -0500
@@ -20,6 +20,7 @@
lo \
ltree \
oid2name \
+ oracle \
pg_buffercache \
pg_trgm \
pgbench \
@@ -31,13 +32,13 @@
tips \
tsearch2 \
userlock \
- vacuumlo
+ vacuumlo \
+ xml2
# Missing:
# adddepend \ (does not have a makefile)
# mSQL-interface \ (requires msql installed)
# mac \ (does not have a makefile)
-# oracle \ (does not have a makefile)
# start-scripts \ (does not have a makefile)
# xml2 \ (requires libxml installed)
--- postgresql-8.1.11/contrib/oracle/Makefile 1969-12-31 19:00:00.000000000 -0500
+++ postgresql-8.1.11-new/contrib/oracle/Makefile 2008-01-15 11:06:35.000000000 -0500
@@ -0,0 +1,11 @@
+# oracle conversion Perl scripts
+
+subdir = contrib/oracle
+top_builddir = ../..
+include $(top_builddir)/src/Makefile.global
+
+MODULES =
+SCRIPTS = Ora2Pg.pm ora2pg.pl
+DOCS = README.ora2pg
+
+include $(top_srcdir)/contrib/contrib-global.mk
--- postgresql-8.1.11/contrib/oracle/ora2pg.pl 2003-01-07 17:17:14.000000000 -0500
+++ postgresql-8.1.11-new/contrib/oracle/ora2pg.pl 2008-01-15 11:06:35.000000000 -0500
@@ -17,6 +17,10 @@
use strict;
+# allow to put Ora2Pg.pm in the same directory as this script
+use File::Basename;
+use lib dirname($0);
+
use Ora2Pg;
# Initialyze the database connection
--- postgresql-8.1.11/pgsql.sh 1969-12-31 19:00:00.000000000 -0500
+++ postgresql-8.1.11-new/pgsql.sh 2008-01-15 11:06:46.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.1/data"
+LOGFILE="${PREFIX}/var/postgresql-8.1/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 <
+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.1 -D "$DATADIR" >/tmp/pgsql-init-8.1.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.1" start -D "$DATADIR" -l "$LOGFILE"
+ ;;
+ restart)
+ unset LC_ALL; LANG=C sudo -u postgres "${PREFIX}/bin/pg_ctl-8.1" restart -D "$DATADIR" -m fast
+ ;;
+ stop)
+ unset LC_ALL; LANG=C sudo -u postgres "${PREFIX}/bin/pg_ctl-8.1" stop -D "$DATADIR" -m fast
+ ;;
+esac
--- postgresql-8.1.11/src/Makefile.global.in 2005-09-27 13:39:32.000000000 -0400
+++ postgresql-8.1.11-new/src/Makefile.global.in 2008-01-15 11:06:35.000000000 -0500
@@ -73,14 +73,14 @@
datadir := @datadir@
ifeq "$(findstring pgsql, $(datadir))" ""
ifeq "$(findstring postgres, $(datadir))" ""
-override datadir := $(datadir)/postgresql
+override datadir := $(datadir)/postgresql-8.1
endif
endif
sysconfdir := @sysconfdir@
ifeq "$(findstring pgsql, $(sysconfdir))" ""
ifeq "$(findstring postgres, $(sysconfdir))" ""
-override sysconfdir := $(sysconfdir)/postgresql
+override sysconfdir := $(sysconfdir)/postgresql-8.1
endif
endif
@@ -89,7 +89,7 @@
pkglibdir = $(libdir)
ifeq "$(findstring pgsql, $(pkglibdir))" ""
ifeq "$(findstring postgres, $(pkglibdir))" ""
-override pkglibdir := $(pkglibdir)/postgresql
+override pkglibdir := $(pkglibdir)/postgresql-8.1
endif
endif
@@ -109,7 +109,7 @@
ifneq (,$(docdir))
ifeq "$(findstring pgsql, $(docdir))" ""
ifeq "$(findstring postgres, $(docdir))" ""
-override docdir := $(docdir)/postgresql
+override docdir := $(docdir)/postgresql-8.1
endif
endif
endif
--- postgresql-8.1.11/src/Makefile.shlib 2005-12-03 15:16:39.000000000 -0500
+++ postgresql-8.1.11-new/src/Makefile.shlib 2008-01-15 11:06:35.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 -undefined dynamic_lookup
endif
shlib = lib$(NAME).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)$(DLSUFFIX)
shlib_major = lib$(NAME).$(SO_MAJOR_VERSION)$(DLSUFFIX)
--- postgresql-8.1.11/src/backend/main/main.c 2006-01-31 19:32:05.000000000 -0500
+++ postgresql-8.1.11-new/src/backend/main/main.c 2008-01-15 11:06:35.000000000 -0500
@@ -259,7 +259,8 @@
* possibly first argument) we were called with. The lack of consistency
* here is historical.
*/
- if (strcmp(progname, "postmaster") == 0)
+ if (strlen(progname) >= 10 && strncmp(progname, "postmaster", 10) == 0)
+
{
/* Called as "postmaster" */
exit(PostmasterMain(argc, argv));
--- postgresql-8.1.11/src/backend/storage/file/fd.c 2006-01-17 18:52:50.000000000 -0500
+++ postgresql-8.1.11-new/src/backend/storage/file/fd.c 2008-01-15 11:06:35.000000000 -0500
@@ -51,6 +51,7 @@
#include "storage/fd.h"
#include "storage/ipc.h"
+#include
/*
* We must leave some file descriptors free for system(), the dynamic loader,
@@ -345,15 +346,21 @@
int used = 0;
int highestfd = 0;
int j;
+ struct rlimit rlim;
size = 1024;
fd = (int *) palloc(size * sizeof(int));
+ getrlimit(RLIMIT_NOFILE, &rlim);
/* dup until failure or probe limit reached */
for (;;)
{
int thisfd;
+ /* Don't go beyond RLIMIT_NOFILE */
+ if (highestfd >= rlim.rlim_cur - 1)
+ break;
+
thisfd = dup(0);
if (thisfd < 0)
{
--- postgresql-8.1.11/src/backend/utils/misc/postgresql.conf.sample 2006-05-21 16:11:02.000000000 -0400
+++ postgresql-8.1.11-new/src/backend/utils/misc/postgresql.conf.sample 2008-01-15 11:06:35.000000000 -0500
@@ -63,7 +63,7 @@
# - Security & Authentication -
#authentication_timeout = 60 # 1-600, in seconds
-#ssl = off
+ssl = off
#password_encryption = on
#db_user_namespace = off
--- postgresql-8.1.11/src/bin/initdb/initdb.c 2006-05-27 14:07:22.000000000 -0400
+++ postgresql-8.1.11-new/src/bin/initdb/initdb.c 2008-01-15 11:06:35.000000000 -0500
@@ -116,7 +116,7 @@
/* defaults */
static int n_connections = 10;
-static int n_buffers = 50;
+static int n_buffers = 20;
/*
* Warning messages for authentication methods
@@ -2411,7 +2411,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.1", PG_VERSIONSTR,
backend_exec)) < 0)
{
char full_path[MAXPGPATH];
@@ -2421,14 +2421,14 @@
if (ret == -1)
fprintf(stderr,
- _("The program \"postgres\" is needed by %s "
+ _("The program \"postgres-8.1\" 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.1\" was found by \"%s\"\n"
"but was not the same version as %s.\n"
"Check your installation.\n"),
full_path, progname);
@@ -2715,9 +2715,9 @@
get_parent_directory(bin_dir);
printf(_("\nSuccess. You can now start the database server using:\n\n"
- " %s%s%spostmaster%s -D %s%s%s\n"
+ " %s%s%spostmaster-8.1%s -D %s%s%s\n"
"or\n"
- " %s%s%spg_ctl%s -D %s%s%s -l logfile start\n\n"),
+ " %s%s%spg_ctl-8.1%s -D %s%s%s -l logfile start\n\n"),
QUOTE_PATH, bin_dir, (strlen(bin_dir) > 0) ? DIR_SEP : "", QUOTE_PATH,
QUOTE_PATH, pg_data_native, QUOTE_PATH,
QUOTE_PATH, bin_dir, (strlen(bin_dir) > 0) ? DIR_SEP : "", QUOTE_PATH,
--- postgresql-8.1.11/src/bin/pg_ctl/pg_ctl.c 2006-06-25 00:38:00.000000000 -0400
+++ postgresql-8.1.11-new/src/bin/pg_ctl/pg_ctl.c 2008-01-15 11:06:35.000000000 -0500
@@ -540,7 +540,7 @@
postmaster_path = pg_malloc(MAXPGPATH);
- if ((ret = find_other_exec(argv0, "postmaster", PM_VERSIONSTR,
+ if ((ret = find_other_exec(argv0, "postmaster-8.1", PM_VERSIONSTR,
postmaster_path)) < 0)
{
char full_path[MAXPGPATH];
@@ -549,13 +549,13 @@
StrNCpy(full_path, progname, MAXPGPATH);
if (ret == -1)
- write_stderr(_("The program \"postmaster\" is needed by %s "
+ write_stderr(_("The program \"postmaster-8.1\" 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.1\" was found by \"%s\"\n"
"but was not the same version as %s.\n"
"Check your installation.\n"),
full_path, progname);
@@ -896,7 +896,7 @@
}
else
{
- ret = find_other_exec(argv0, "postmaster", PM_VERSIONSTR, cmdLine);
+ ret = find_other_exec(argv0, "postmaster-8.1", PM_VERSIONSTR, cmdLine);
if (ret != 0)
{
write_stderr(_("%s: could not find postmaster program executable\n"), progname);
--- postgresql-8.1.11/src/interfaces/ecpg/compatlib/Makefile 2005-03-14 12:27:49.000000000 -0500
+++ postgresql-8.1.11-new/src/interfaces/ecpg/compatlib/Makefile 2008-01-15 11:06:35.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.1.11/src/interfaces/ecpg/ecpglib/Makefile 2005-12-05 21:29:26.000000000 -0500
+++ postgresql-8.1.11-new/src/interfaces/ecpg/ecpglib/Makefile 2008-01-15 11:06:35.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 recompile any libpgport object files
--- postgresql-8.1.11/src/makefiles/Makefile.darwin 2006-11-28 00:47:16.000000000 -0500
+++ postgresql-8.1.11-new/src/makefiles/Makefile.darwin 2008-01-15 11:06:35.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) $(CFLAGS) -bundle -o $@ $< $(BE_DLLLIBS)
+ $(CC) $(CFLAGS) -bundle -undefined dynamic_lookup -o $@ $< $(BE_DLLLIBS)
sqlmansect = 7
--- postgresql-8.1.11/src/template/darwin 2004-04-26 00:04:42.000000000 -0400
+++ postgresql-8.1.11-new/src/template/darwin 2008-01-15 11:06:35.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
--- postgresql-8.1.11/src/test/regress/pg_regress.sh 2006-10-08 21:45:41.000000000 -0400
+++ postgresql-8.1.11-new/src/test/regress/pg_regress.sh 2008-01-15 11:06:35.000000000 -0500
@@ -397,6 +397,9 @@
mkdir -p "$LOGDIR" || { (exit 2); exit; }
fi
$GMAKE -C "$top_builddir" DESTDIR="$temp_install/install" install with_perl=no with_python=no >"$LOGDIR/install.log" 2>&1
+ pushd "$temp_install/install/@INSTPREFIX@/bin/"
+ ln -s postgres postgres-8.1
+ popd
if [ $? -ne 0 ]
then