Update of /cvsroot/fink/dists/10.7/stable/main/finkinfo/database
In directory vz-cvs-3.sog:/tmp/cvs-serv13460/10.7/stable/main/finkinfo/database

Added Files:
        postgresql90.info postgresql90.patch 
Log Message:
to 10.7

--- NEW FILE: postgresql90.info ---
Info4: <<
Package: postgresql90
Version: 9.0.4
Revision: 33
Description: PostgreSQL open-source database
License: BSD
Maintainer: Benjamin Reed <postgresq...@fink.raccoonfink.com>

Depends: <<
        daemonic (>= 20010902-1),
        libxml2-shlibs,
        libxslt-shlibs,
        passwd-postgres | passwd (>= 20030906-1),
        readline5-shlibs,
        %N-shlibs (>= %v-%r)
<<
BuildDepends: <<
        bison,
        fink (>= 0.30.0-1),
        fink-mirrors (>= 0.28.7.1-2),
        libxml2,
        libxslt,
        passwd-postgres | passwd (>= 20030906-1),
        readline5,
        system-openssl-dev,
        system-perl,
        tcltk,
        tcltk-dev
<<
Provides: postgresql-server
GCC: 3.3

Source: mirror:postgresql:source/v%v/postgresql-%v.tar.bz2
Source-MD5: 80390514d568a7af5ab61db1cda27e29
PatchScript: sed -e 's|@BUILDDIR@|%b|g' -e 's|@INSTPREFIX@|%p|g' < %{PatchFile} 
| patch -p1
PatchFile: %n.patch
PatchFile-MD5: 3a631636c02956ab807bd4b08eef5e00

SetCPPFLAGS: -I%p/lib/system-openssl/include -DHAVE_OPTRESET -fno-common
SetLDFLAGS: -L%p/lib/system-openssl/lib -F/System/Library/Frameworks
UseMaxBuildJobs: true
CompileScript: <<
        #!/bin/sh -xe
        
        if [[ $(sw_vers -productVersion | cut -d. -f1-2) > 10.6 ]]; then
        export CC=clang
        export CXX=clang++
        elif [ -x /usr/bin/gcc-4.2 ]; then
        export CC=gcc-4.2
        export CXX=g++-4.2
        fi
        
        export PERL=/usr/bin/perl
        export PYTHON=/usr/bin/python
        
        ./configure \
        --prefix='%p/opt/postgresql-9.0' \
        --docdir='%p/share/doc/%N' \
        --mandir='${prefix}/share/man' \
        --infodir='${prefix}/share/info' \
        --with-libraries=%p/lib \
        --with-includes=%p/include \
        \
        --with-perl \
        --with-python \
        --with-tcl \
        --with-tclconfig=%p/lib \
        \
        --enable-thread-safety \
        --with-openssl \
        --with-pam \
        --with-bonjour \
        --with-krb5 \
        --with-gssapi \
        \
        --with-libxml \
        --with-libxslt
        
        perl -pi -e 's,-arch x86_64,,g; s,-arch i386,,g; s,-arch ppc,,g' 
src/Makefile.global
        make
        make -C contrib
<<

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

        # postgresql
        make -j1 install DESTDIR="%d" 
BE_DLLLIBS=%p/opt/postgresql-9.0/bin/postgres
        make -j1 -C contrib install DESTDIR="%d" 
BE_DLLLIBS=%p/opt/postgresql-9.0/bin/postgres

        ranlib %i/opt/postgresql-9.0/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/pgsql.sh-9.0

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

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

        for file in `ls -1 %i/opt/postgresql-9.0/bin/`; do
                echo "${file}" >> %i/var/postgresql-9.0/binary.list
        done

        cat <<END > %i/var/postgresql-9.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 "pgsql.sh" "%p/bin/pgsql.sh-9.0"

for tuple in %p/opt/postgresql-9.0/bin:binary.list; do
        TUPLE_PATH=\`echo \$tuple | cut -d: -f1\`
        TUPLE_FILE=\`echo \$tuple | cut -d: -f2\`

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

END

        cat <<END > %i/var/postgresql-9.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

update-alternatives --install "%p/bin/pgsql.sh" "pgsql.sh" 
"%p/bin/pgsql.sh-9.0" 90

for tuple in bin:binary.list; do
        TUPLE_PATH=\`echo \$tuple | cut -d: -f1\`
        TUPLE_FILE=\`echo \$tuple | cut -d: -f2\`

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

END

        chmod 755 %i/var/postgresql-9.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)
        BuildDependsOnly: true
        Files: <<
                opt/postgresql-9.0/bin/pg_config*
                opt/postgresql-9.0/include
                opt/postgresql-9.0/lib/*.a
                opt/postgresql-9.0/lib/libecpg_compat.dylib
                opt/postgresql-9.0/lib/libecpg.dylib
                opt/postgresql-9.0/lib/libpgtypes.dylib
                opt/postgresql-9.0/lib/libpq.dylib
        <<
        PreInstScript: <<
PG_ID=`id -u postgres 2>/dev/null || true`
if [ -z "$PG_ID" ]; then
        echo "Whoa there!  You must have a postgres user to install this 
package."
        echo "Please do a 'fink reinstall passwd' or 'fink reinstall 
passwd-postgres'"
        echo "and make sure you hit 'y' when it asks if you want to update your 
users."
        exit 1
fi
        <<
        PostInstScript: [ -x %p/var/postgresql-9.0/update-alternatives.sh ] && 
%p/var/postgresql-9.0/update-alternatives.sh
        PreRmScript: if [ "$1" != "upgrade" ]; then [ -x 
%p/var/postgresql-9.0/remove-alternatives.sh ] && 
%p/var/postgresql-9.0/remove-alternatives.sh; fi
<<
SplitOff2: <<
        Package: %N-shlibs
        Description: PostgreSQL shared libraries
        Files: <<
                opt/postgresql-9.0/lib/lib*.*.dylib
                var/postgresql-9.0/*.sh
                var/postgresql-9.0/*.list
        <<
        Shlibs: <<
                %p/opt/postgresql-9.0/lib/libecpg.6.dylib        6.0.0 
postgresql90-shlibs (>= 9.0.0-1)
                %p/opt/postgresql-9.0/lib/libecpg_compat.3.dylib 3.0.0 
postgresql90-shlibs (>= 9.0.0-1)
                %p/opt/postgresql-9.0/lib/libpgtypes.3.dylib     3.0.0 
postgresql90-shlibs (>= 9.0.0-1)
                %p/opt/postgresql-9.0/lib/libpq.5.dylib          5.0.0 
postgresql90-shlibs (>= 9.0.0-1)
        <<
        PostInstScript: <<
[ -x %p/var/postgresql-9.0/update-alternatives.sh ] && 
%p/var/postgresql-9.0/update-alternatives.sh
if [ -d "%p/var/postgresql-9.0/data" ]; then
        if [ `%p/bin/dpkg -s postgresql90 | grep -c 9.0.0-0` -gt 0 ]; then
                echo ""
                echo '!!! ERROR !!!'
                echo ""
                echo "The PostgreSQL 9.0 on-disk format has changed since the 
9.0 betas."
                echo "You must remove %p/var/postgresql-9.0/data before 
proceeding."
                echo "You should probably back up with pg_dump if there's 
anything important.  ;)"
                echo ""
                exit 1
        fi
fi
        <<
        PreRmScript: if [ "$1" != "upgrade" ]; then [ -x 
%p/var/postgresql-9.0/remove-alternatives.sh ] && 
%p/var/postgresql-9.0/remove-alternatives.sh; fi
<<

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

[ -x %p/var/postgresql-9.0/update-alternatives.sh ] && 
%p/var/postgresql-9.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 >/dev/null 2>&1 || :

# 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-9.0 start >/tmp/pgstart-9.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/opt/postgresql-9.0/bin/createlang -U postgres -p $PGPORT plpgsql 
template1 >/tmp/createlang-9.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-9.0 stop >/dev/null 2>&1 || echo "WARNING: unable to 
stop postgresql: run 'PGPORT=$PGPORT sudo %p/bin/pgsql.sh-9.0 stop' to try 
again"

else

        cat <<END
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-9.0 start
                sudo -u postgres %p/opt/postgresql-9.0/bin/createlang plpgsql 
template1
        
END

fi
<<
PreRmScript: <<
# clean up
if [ $1 != "upgrade" ]; then
        [ -x %p/var/postgresql-9.0/remove-alternatives.sh ] && 
%p/var/postgresql-9.0/remove-alternatives.sh
        daemonic remove %N >/dev/null 2>&1 || :
fi
<<
DaemonicFile: <<
<service>
<description>PostgreSQL database server</description>
<message> PostgreSQL database server</message>

<daemon name="%N">
        <executable background="no">%p/bin/pgsql.sh-9.0</executable>
        <parameters>start</parameters>
</daemon>

</service>
<<

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 %p/opt/postgresql-9.0/bin/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 <prefix>/var/postgresql-9.0/data.

When run from the startup script, logs output to 
<prefix>/var/postgresql-9.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).
<<
<<


--- NEW FILE: postgresql90.patch ---
diff -Nurd postgresql-9.0beta3/pgsql.sh postgresql-9.0beta3-new/pgsql.sh
--- postgresql-9.0beta3/pgsql.sh        1969-12-31 18:00:00.000000000 -0600
+++ postgresql-9.0beta3-new/pgsql.sh    2010-07-26 11:06:05.000000000 -0500
@@ -0,0 +1,83 @@
+#!/bin/sh
+
+die () {
+       echo "failed"
+       echo ""
+       echo "*** bailing because an error ocurred:"
+       echo ""
+       echo "$*"
+       exit 1
+}
+
+PREFIX="@INSTPREFIX@/opt/postgresql-9.0"
+DATADIR="@INSTPREFIX@/var/postgresql-9.0/data"
+LOGFILE="@INSTPREFIX@/var/postgresql-9.0/pgsql.log"
+
+export LANG=C
+unset LC_ALL
+
+export PATH="$PREFIX/bin:@INSTPREFIX@/bin:$PATH"
+
+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 <<END >/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 -E UNICODE -D "$DATADIR" 
>/tmp/pgsql-init-9.0.log 2>&1 || die "couldn't initialize database"
+       echo "ok"
+fi
+
+PG_COMMAND="sudo -u postgres env"
+if [ -n "$PGPORT" ]; then
+       PG_COMMAND="$PG_COMMAND PGPORT=$PGPORT"
+fi
+PG_COMMAND="$PG_COMMAND ${PREFIX}/bin/pg_ctl"
+
+case "$1" in
+       init)
+               ;;
+       start)
+               $PG_COMMAND -D "$DATADIR" -l "$LOGFILE" start
+               ;;
+       restart)
+               $PG_COMMAND -D "$DATADIR" -m fast restart
+               ;;
+       stop)
+               $PG_COMMAND -D "$DATADIR" -m fast stop
+               ;;
+esac
diff -Nurd postgresql-9.0beta3/src/Makefile.global.in 
postgresql-9.0beta3-new/src/Makefile.global.in
--- postgresql-9.0beta3/src/Makefile.global.in  2010-07-06 17:03:05.000000000 
-0500
+++ postgresql-9.0beta3-new/src/Makefile.global.in      2010-07-26 
14:14:55.000000000 -0500
@@ -243,7 +243,7 @@
 ifdef PGXS
   LDFLAGS = -L$(libdir)
 else
-  LDFLAGS = -L$(top_builddir)/src/port
+  LDFLAGS = -L$(top_builddir)/src/port -L$(top_builddir)/src/interfaces/libpq 
-L$(top_builddir)/src/interfaces/ecpg/ecpglib 
-L$(top_builddir)/src/interfaces/ecpg/pgtypeslib 
-L$(top_builddir)/src/interfaces/ecpg/compatlib
 endif
 LDFLAGS += @LDFLAGS@
 
diff -Nurd postgresql-9.0beta3/src/backend/utils/misc/postgresql.conf.sample 
postgresql-9.0beta3-new/src/backend/utils/misc/postgresql.conf.sample
--- postgresql-9.0beta3/src/backend/utils/misc/postgresql.conf.sample   
2010-07-03 16:23:58.000000000 -0500
+++ postgresql-9.0beta3-new/src/backend/utils/misc/postgresql.conf.sample       
2010-07-26 11:06:05.000000000 -0500
@@ -77,7 +77,7 @@
 # - Security and Authentication -
 
 #authentication_timeout = 1min         # 1s-600s
-#ssl = off                             # (change requires restart)
+ssl = off                              # (change requires restart)
 #ssl_ciphers = 'ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH'     # allowed SSL ciphers
                                        # (change requires restart)
 #ssl_renegotiation_limit = 512MB       # amount of data between renegotiations
diff -Nurd postgresql-9.0beta3/src/bin/initdb/initdb.c 
postgresql-9.0beta3-new/src/bin/initdb/initdb.c
--- postgresql-9.0beta3/src/bin/initdb/initdb.c 2010-02-25 20:01:15.000000000 
-0600
+++ postgresql-9.0beta3-new/src/bin/initdb/initdb.c     2010-07-26 
11:06:05.000000000 -0500
@@ -114,7 +114,7 @@
 
 /* defaults */
 static int     n_connections = 10;
-static int     n_buffers = 50;
+static int     n_buffers = 20;
 
 /*
  * Warning messages for authentication methods
diff -Nurd postgresql-9.0beta3/src/interfaces/ecpg/compatlib/Makefile 
postgresql-9.0beta3-new/src/interfaces/ecpg/compatlib/Makefile
--- postgresql-9.0beta3/src/interfaces/ecpg/compatlib/Makefile  2010-01-02 
10:58:10.000000000 -0600
+++ postgresql-9.0beta3-new/src/interfaces/ecpg/compatlib/Makefile      
2010-07-26 13:54:16.000000000 -0500
@@ -21,6 +21,7 @@
        -I$(libpq_srcdir) -I$(top_srcdir)/src/include/utils $(CPPFLAGS)
 override CFLAGS += $(PTHREAD_CFLAGS)
 
+LDFLAGS := -L../ecpglib -L../pgtypeslib $(LDFLAGS)
 SHLIB_LINK = -L../ecpglib -lecpg -L../pgtypeslib -lpgtypes $(libpq) \
        $(filter -lintl -lm, $(LIBS)) $(PTHREAD_LIBS)
 
diff -Nurd postgresql-9.0beta3/src/interfaces/ecpg/ecpglib/Makefile 
postgresql-9.0beta3-new/src/interfaces/ecpg/ecpglib/Makefile
--- postgresql-9.0beta3/src/interfaces/ecpg/ecpglib/Makefile    2010-01-05 
10:38:23.000000000 -0600
+++ postgresql-9.0beta3-new/src/interfaces/ecpg/ecpglib/Makefile        
2010-07-26 13:54:28.000000000 -0500
@@ -33,6 +33,7 @@
 OBJS += thread.o
 endif
 
+LDFLAGS := -L../pgtypeslib $(LDFLAGS)
 SHLIB_LINK = -L../pgtypeslib -lpgtypes $(libpq) $(filter -lintl -lm, $(LIBS)) 
$(PTHREAD_LIBS)
 
 SHLIB_EXPORTS = exports.txt
diff -Nurd postgresql-9.0beta3/src/makefiles/Makefile.darwin 
postgresql-9.0beta3-new/src/makefiles/Makefile.darwin
--- postgresql-9.0beta3/src/makefiles/Makefile.darwin   2010-07-05 
18:15:56.000000000 -0500
+++ postgresql-9.0beta3-new/src/makefiles/Makefile.darwin       2010-07-26 
11:06:31.000000000 -0500
@@ -10,4 +10,4 @@
 
 # Rule for building a shared library from a single .o file
 %.so: %.o
-       $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -bundle $(BE_DLLLIBS) -o $@ $<
+       $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -bundle $(BE_DLLLIBS) 
-undefined dynamic_lookup -o $@ $<


------------------------------------------------------------------------------
10 Tips for Better Web Security
Learn 10 ways to better secure your business today. Topics covered include:
Web security, SSL, hacker attacks & Denial of Service (DoS), private keys,
security Microsoft Exchange, secure Instant Messaging, and much more.
http://www.accelacomm.com/jaw/sfnl/114/51426210/
_______________________________________________
Fink-commits mailing list
Fink-commits@lists.sourceforge.net
http://news.gmane.org/gmane.os.apple.fink.cvs

Reply via email to