OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /v/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   06-Feb-2007 09:43:33
  Branch: OPENPKG_2_STABLE                 Handle: 2007020608433200

  Modified files:           (Branch: OPENPKG_2_STABLE)
    openpkg-src/postgresql  pg_migrate postgresql.patch postgresql.spec

  Log:
    MFC security fixed version from CURRENT

  Summary:
    Revision    Changes     Path
    1.8.2.1     +8  -6      openpkg-src/postgresql/pg_migrate
    1.2.8.2     +10 -123    openpkg-src/postgresql/postgresql.patch
    1.197.2.5   +44 -23     openpkg-src/postgresql/postgresql.spec
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/postgresql/pg_migrate
  ============================================================================
  $ cvs diff -u -r1.8 -r1.8.2.1 pg_migrate
  --- openpkg-src/postgresql/pg_migrate 1 Jan 2006 13:20:49 -0000       1.8
  +++ openpkg-src/postgresql/pg_migrate 6 Feb 2007 08:43:32 -0000       1.8.2.1
  @@ -1,8 +1,8 @@
   #!/bin/sh
   ##
   ##  pg_migrate -- PostgreSQL Database Migration Utility
  -##  Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
  -##  Copyright (c) 2000-2006 Ralf S. Engelschall <http://engelschall.com/>
  +##  Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
  +##  Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/>
   ##
   ##  Permission to use, copy, modify, and distribute this software for
   ##  any purpose with or without fee is hereby granted, provided that
  @@ -36,15 +36,17 @@
   umask 022
   
   #   check command line
  -if [ $# -ne 1 ]; then
  +if [ $# -ne 1 -a $# -ne 2 ]; then
       echo "$0:ERROR: invalid command line" 1>&2
  -    echo "$0:USAGE: $0 dump|restore" 1>&2
  +    echo "$0:USAGE: $0 dump|restore [<password>]" 1>&2
       exit 1
   fi
  +cmd="$1"; shift
  +if [ $# -eq 1 ]; then
  +    l_pgpass="$1"; shift
  +fi
   
   #   dispatch into commands
  -cmd="$1"
  -shift
   case $cmd in
       dump )
           echo "++ enforcing full-superuser access policy"
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/postgresql/postgresql.patch
  ============================================================================
  $ cvs diff -u -r1.2.8.1 -r1.2.8.2 postgresql.patch
  --- openpkg-src/postgresql/postgresql.patch   7 Oct 2006 10:14:23 -0000       
1.2.8.1
  +++ openpkg-src/postgresql/postgresql.patch   6 Feb 2007 08:43:32 -0000       
1.2.8.2
  @@ -1,132 +1,19 @@
  -Remove lorder(1) and tsort(1) stuff, because it is not needed on modern
  -systems and makes problems under some platforms (e.g. older Linux).
  -
  ---- src/Makefile.global.in.orig      Thu Sep  5 00:54:18 2002
  -+++ src/Makefile.global.in   Tue Jul  1 17:17:25 2003
  -@@ -193,7 +193,7 @@
  - LDREL = -r
  - LDOUT = -o
  - RANLIB = @RANLIB@
  --LORDER = @LORDER@
  -+MK_NO_LORDER= true
  - X = @EXEEXT@
  - 
  - # Perl 
  ---- src/makefiles/Makefile.freebsd.orig      Wed Aug 29 21:14:40 2001
  -+++ src/makefiles/Makefile.freebsd   Tue Jul  1 17:23:00 2003
  -@@ -16,7 +16,7 @@
  -     $(LD) $(LDREL) $(LDOUT) $<.obj -x $<
  -     @echo building shared object $@
  -     @rm -f [EMAIL PROTECTED]
  --    @${AR} cq [EMAIL PROTECTED] `lorder $<.obj | tsort`
  -+    @${AR} cq [EMAIL PROTECTED]
  -     ${RANLIB} [EMAIL PROTECTED]
  -     @rm -f $@
  -     $(LD) -x -Bshareable -Bforcearchive -o $@ [EMAIL PROTECTED]
  ---- src/makefiles/Makefile.openbsd.orig      Wed Aug 29 21:14:40 2001
  -+++ src/makefiles/Makefile.openbsd   Tue Jul  1 17:23:12 2003
  -@@ -16,7 +16,7 @@
  -     $(LD) $(LDREL) $(LDOUT) $<.obj -x $<
  -     @echo building shared object $@
  -     @rm -f [EMAIL PROTECTED]
  --    @${AR} cq [EMAIL PROTECTED] `lorder $<.obj | tsort`
  -+    @${AR} cq [EMAIL PROTECTED]
  -     ${RANLIB} [EMAIL PROTECTED]
  -     @rm -f $@
  -     $(LD) -x -Bshareable -Bforcearchive \
  ---- src/makefiles/Makefile.netbsd.orig       Wed Aug 29 21:14:40 2001
  -+++ src/makefiles/Makefile.netbsd    Tue Jul  1 17:23:39 2003
  -@@ -18,7 +18,7 @@
  -     $(LD) $(LDREL) $(LDOUT) $<.obj -x $<
  -     @echo building shared object $@
  -     @rm -f [EMAIL PROTECTED]
  --    @${AR} cq [EMAIL PROTECTED] `lorder $<.obj | tsort`
  -+    @${AR} cq [EMAIL PROTECTED]
  -     ${RANLIB} [EMAIL PROTECTED]
  -     @rm -f $@
  -     $(LD) -x -Bshareable -Bforcearchive \
   Index: src/template/freebsd
  ---- src/template/freebsd.orig        2004-12-02 19:11:40.000000000 +0100
  -+++ src/template/freebsd     2005-02-16 17:09:09.617038264 +0100
  -@@ -1,3 +1,3 @@
  +--- src/template/freebsd.orig        2006-03-11 05:38:41 +0100
  ++++ src/template/freebsd     2006-11-20 20:54:27 +0100
  +@@ -1,5 +1,5 @@
  + # $PostgreSQL: pgsql/src/template/freebsd,v 1.35 2006/03/11 04:38:41 
momjian Exp $
  + 
    case $host_cpu in
   -  alpha*)   CFLAGS="-O";;  # alpha has problems with -O2
   +  alpha*)   CFLAGS=`echo "x$CFLAGS" | sed -e 's;^x;;' -e 's;-O2;-O;'`;;  # 
alpha has problems with -O2
    esac
   Index: src/template/linux
  ---- src/template/linux.orig  2004-12-02 19:11:40.000000000 +0100
  -+++ src/template/linux       2005-02-16 17:08:13.160599508 +0100
  -@@ -1,2 +1,2 @@
  +--- src/template/linux.orig  2006-03-11 05:38:41 +0100
  ++++ src/template/linux       2006-11-20 20:54:27 +0100
  +@@ -1,4 +1,4 @@
  + # $PostgreSQL: pgsql/src/template/linux,v 1.28 2006/03/11 04:38:41 momjian 
Exp $
  + 
    # Force _GNU_SOURCE on; plperl is broken with Perl 5.8.0 otherwise
   -CPPFLAGS="-D_GNU_SOURCE"
   +CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
  -
  ------------------------------------------------------------------------------
  -
  -A small patch to allow DSO-based PostgreSQL extensions to be more
  -flexible by providing initialization and finishing hooks. This patch was
  -contributed by Ralf S. Engelschall to the upstream vendor in August 2006
  -and taken over by the upstream vendor for inclusion into the next major
  -PostgreSQL release.
  -
  
-http://groups.google.com/group/pgsql.hackers/browse_frm/thread/ce7858f865a6fecd/19a3f052656f3a69?tvc=1&q=PG_init#19a3f052656f3a69
  -
  -Index: src/backend/utils/fmgr/dfmgr.c
  ---- src/backend/utils/fmgr/dfmgr.c.orig      2005-10-15 04:49:32 +0200
  -+++ src/backend/utils/fmgr/dfmgr.c   2006-10-07 11:53:58 +0200
  -@@ -60,6 +60,10 @@
  - static char *expand_dynamic_library_name(const char *name);
  - static char *substitute_libpath_macro(const char *name);
  - 
  -+/* types for PostgreSQL-specific DSO init/fini functions */
  -+typedef void (*PG_init_t)(void);
  -+typedef void (*PG_fini_t)(void);
  -+
  - /*
  -  * Load the specified dynamic-link library file, and look for a function
  -  * named funcname in it.  (funcname can be NULL to just load the file.)
  -@@ -77,6 +81,7 @@
  - load_external_function(char *filename, char *funcname,
  -                                        bool signalNotFound, void 
**filehandle)
  - {
  -+    PG_init_t *PG_init;
  -     DynamicFileList *file_scanner;
  -     PGFunction      retval;
  -     char       *load_error;
  -@@ -146,6 +151,13 @@
  -                                                     fullname, load_error)));
  -             }
  - 
  -+            /* optionally give the DSO a chance to initialize by calling a
  -+               PostgreSQL-specific (and this way portable) "_PG_init" 
function
  -+               similar to what dlopen(3) implicitly does with "_init" on 
some
  -+               Unix platforms. */
  -+            if ((PG_init = (PG_init_t *)pg_dlsym(file_scanner->handle, 
"_PG_init")) != NULL)
  -+                    (*PG_init)();
  -+
  -             /* OK to link it into list */
  -             if (file_list == NULL)
  -                     file_list = file_scanner;
  -@@ -187,6 +199,7 @@
  - void
  - load_file(char *filename)
  - {
  -+    PG_fini_t *PG_fini;
  -     DynamicFileList *file_scanner,
  -                        *prv,
  -                        *nxt;
  -@@ -223,6 +236,14 @@
  -                             prv->next = nxt;
  -                     else
  -                             file_list = nxt;
  -+
  -+                    /* optionally give the DSO a chance to finish by calling
  -+                       a PostgreSQL-specific (and this way portable) 
"_PG_fini"
  -+                       function similar to what dlopen(3) implicitly does 
with
  -+                       "_fini" on some Unix platforms. */
  -+                    if ((PG_fini = (PG_fini_t 
*)pg_dlsym(file_scanner->handle, "_PG_fini")) != NULL)
  -+                            (*PG_fini)();
  -+
  -                     clear_external_function_hash(file_scanner->handle);
  -                     pg_dlclose(file_scanner->handle);
  -                     free((char *) file_scanner);
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/postgresql/postgresql.spec
  ============================================================================
  $ cvs diff -u -r1.197.2.4 -r1.197.2.5 postgresql.spec
  --- openpkg-src/postgresql/postgresql.spec    25 Oct 2006 11:38:52 -0000      
1.197.2.4
  +++ openpkg-src/postgresql/postgresql.spec    6 Feb 2007 08:43:32 -0000       
1.197.2.5
  @@ -1,7 +1,7 @@
   ##
   ##  postgresql.spec -- OpenPKG RPM Package Specification
  -##  Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
  -##  Copyright (c) 2000-2006 Ralf S. Engelschall <http://engelschall.com/>
  +##  Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
  +##  Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/>
   ##
   ##  Permission to use, copy, modify, and distribute this software for
   ##  any purpose with or without fee is hereby granted, provided that
  @@ -23,14 +23,16 @@
   ##
   
   #   package versions
  -%define       V_postgresql      8.1.5
  +%define       V_postgresql      8.2.2
   %define       V_libpqpp         4.0
   %define       V_libpqxx         2.5.5
  +%define       V_perl            5.8.8
   %define       V_pgperl          2.0.2
   %define       V_psqlodbc        08.02.0200
  -%define       V_slony1          1.1.5
  -%define       V_pgcluster       1.5.0rc9
  -%define       V_pgcluster_dir   1123
  +%define       V_slony1          1.2.6
  +%define       V_slony1_dir      1215
  +%define       V_pgcluster       1.7.0rc3
  +%define       V_pgcluster_dir   1221
   %define       V_mysqlcompat     1.0b3
   %define       V_mysqlcompat_dir 548
   
  @@ -45,7 +47,7 @@
   Group:        Database
   License:      GPL
   Version:      %{V_postgresql}
  -Release:      2.20061025
  +Release:      2.20070206
   
   #   package options
   %option       with_server       yes
  @@ -62,12 +64,12 @@
   %option       with_setproctitle no
   
   #   list of sources
  -Source0:      
ftp://ftp.postgresql.org/pub/source/v%{V_postgresql}/postgresql-%{V_postgresql}.tar.gz
  +Source0:      
ftp://ftp.postgresql.org/pub/source/v%{V_postgresql}/postgresql-%{V_postgresql}.tar.bz2
   Source1:      
ftp://gborg.postgresql.org/pub/libpqpp/stable/libpq++-%{V_libpqpp}.tar.gz
   Source2:      
ftp://gborg.postgresql.org/pub/libpqxx/stable/libpqxx-%{V_libpqxx}.tar.gz
   Source3:      
ftp://gborg.postgresql.org/pub/pgperl/stable/pgperl-%{V_pgperl}.tar.gz
   Source4:      
ftp://ftp.postgresql.org/pub/odbc/versions/src/psqlodbc-%{V_psqlodbc}.tar.gz
  -Source5:      
http://developer.postgresql.org/~wieck/slony1/download/slony1-%{V_slony1}.tar.bz2
  +Source5:      
http://pgfoundry.org/frs/download.php/%{V_slony1_dir}/slony1-%{V_slony1}-tar.bz2
   Source6:      
http://pgfoundry.org/frs/download.php/%{V_pgcluster_dir}/pgcluster-%{V_pgcluster}-patch.tar.gz
   Source7:      
http://pgfoundry.org/frs/download.php/%{V_mysqlcompat_dir}/mysqlcompat-%{V_mysqlcompat}.tar.gz
   Source8:      rc.postgresql
  @@ -82,8 +84,13 @@
   BuildPreReq:  readline, zlib, openssl, getopt
   PreReq:       readline, zlib, openssl, getopt
   %if "%{with_perl}" == "yes"
  -BuildPreReq:  perl, perl-openpkg >= 5.8.3-2.20061018
  +<<<<<<< postgresql.spec
  +BuildPreReq:  perl, perl-openpkg >= 2.20061018
   PreReq:       perl
  +=======
  +BuildPreReq:  perl >= %{V_perl}, perl-openpkg >= 2.20061018
  +PreReq:       perl >= %{V_perl}
  +>>>>>>> 1.229
   %endif
   %if "%{with_odbc}" == "yes"
   BuildPreReq:  unixodbc
  @@ -123,9 +130,9 @@
       prog postgresql = {
           version   = %{V_postgresql}
           url       = ftp://ftp.postgresql.org/pub/source/
  -        regex     = v(\d+\.\d+(\.\d+)*)(?!beta)
  +        regex     = v(\d+\.\d+(\.\d+)*)
           url       = ftp://ftp.postgresql.org/pub/source/v__NEWVER__/
  -        regex     = postgresql-(\d+\.\d+(\.\d+)*)\.tar\.(?:gz|bz2)
  +        regex     = postgresql-(\d+(\.\d+)+)\.tar\.(bz2|gz)
       }
       prog postgresql:libpq++ = {
           version   = %{V_libpqpp}
  @@ -148,19 +155,20 @@
           regex     = psqlodbc-(\d{2}\.\d{2}\.\d{4})\.tar\.gz
       }
       prog postgresql:slony1 = {
  -        version   = %{V_slony1}
  -        url       = http://developer.postgresql.org/~wieck/slony1/download/
  -        regex     = slony1-(\d+\.\d+\.\d+)\.tar\.bz2
  +        version   = %{V_slony1}.%{V_slony1_dir}
  +        url       = http://pgfoundry.org/frs/?group_id=1000122
  +        regex     = /(\d+/slony1-\d+\.\d+\.\d+)[-.]tar\.bz2
  +        transform = "s/^(\\d+)\/slony1-(\d+\.\d+\.\d+)$/$2.$1/; $_"
       }
       prog postgresql:pgcluster = {
           version   = %{V_pgcluster}.%{V_pgcluster_dir}
  -        url       = http://pgfoundry.org/frs/?group_id=1000072&release_id=168
  +        url       = http://pgfoundry.org/frs/?group_id=1000072
           regex     = /(\d+/pgcluster-__VER__)-patch\.tar\.gz
           transform = "s/^(\\d+)\/pgcluster-(.+)$/$2.$1/; $_"
       }
       prog postgresql:mysqlcompat = {
           version   = %{V_mysqlcompat}.%{V_mysqlcompat_dir}
  -        url       = http://pgfoundry.org/frs/?group_id=1000154&release_id=379
  +        url       = http://pgfoundry.org/frs/?group_id=1000154
           regex     = (\d+/mysqlcompat-__VER__)\.tar\.gz
           transform = "s/^(\\d+)\/mysqlcompat-(.+)$/$2.$1/; $_"
       }
  @@ -241,8 +249,9 @@
       ) >config.cache
       export CC="%{l_cc}"
       export CFLAGS="%{l_cflags -O}"
  -    export CPPFLAGS="%{l_cppflags readline} 
-DOPENSSL_DISABLE_OLD_DES_SUPPORT"
  +    export CPPFLAGS="%{l_cppflags readline}"
       export LDFLAGS="%{l_ldflags}"
  +    export LIBS=""
   %if "%{with_slony1}" == "yes"
       CFLAGS="$CFLAGS -pthread"
   %endif
  @@ -254,6 +263,11 @@
       CPPFLAGS="$CPPFLAGS %{l_cppflags kerberos}"
       LDFLAGS="$LDFLAGS %{l_ldflags kerberos}"
   %endif
  +%if "%{with_pgcluster}" == "yes"
  +    case "%{l_platform -t}" in
  +        *-freebsd* ) LIBS="$LIBS -lcompat" ;;
  +    esac
  +%endif
       export TAR="%{l_tar}"
       export YACC="bison -y"
       ./configure \
  @@ -373,8 +387,8 @@
         ln  ../src/pl/plpgsql/src/libplpgsql.so \
             ../src/pl/plpgsql/src/plpgsql.so
         %{l_shtool} subst \
  -          -e 's;-lpq;-lpq -lssl -lcrypto -lcrypt;' \
  -          src/slon/Makefile src/slonik/Makefile
  +          -e 's;-lpq;-lpq @LIBS@;' \
  +          Makefile.global.in
         export CC="%{l_cc}"
         export CFLAGS="%{l_cflags -O}"
         export CPPFLAGS="%{l_cppflags}"
  @@ -505,6 +519,9 @@
       #   install Slony-1 replication engine
   %if "%{with_slony1}" == "yes"
       ( cd slony1-%{V_slony1}
  +      %{l_shtool} subst \
  +          -e 's;$(SQL_NAME80);$(SQL_NAME74);g' \
  +          src/xxid/Makefile
         %{l_make} %{l_mflags} install \
             DESTDIR=$RPM_BUILD_ROOT \
             pgconfigdir=%{l_prefix}/bin \
  @@ -667,7 +684,7 @@
             echo "    \$ $RPM_INSTALL_PREFIX/etc/rc postgresql start"
             echo "you should immediately change this with the following 
command:"
             echo "    \$ $RPM_INSTALL_PREFIX/bin/psql -U $l_pguser -d 
template1 \\"
  -          echo "      -c \"ALTER USER $l_pguser WITH PASSWORD 
'<new-password>'\""
  +          echo "      -c \"ALTER ROLE $l_pguser WITH PASSWORD 
'<new-password>'\""
             echo "Then you usually create a database for a user <user> 
(assuming that"
             echo "his home directory is /u/<user>) with password <password> 
under"
             echo "path /u/<user>/rdbms with the commands:"
  @@ -688,13 +705,13 @@
             echo "    \$ psql"
           ) | %{l_rpmtool} msg -b -t notice
   
  -        #   optionally link into unixODBC
  +        #   optionally link into ODBC
   %if "%{with_odbc}" == "yes"
           ( echo "[PostgreSQL]"
             echo "Description     = PostgreSQL ODBC driver"
             echo "Driver          = $RPM_INSTALL_PREFIX/lib/psqlodbc.so"
             echo "Threading       = 2"
  -        ) | $RPM_INSTALL_PREFIX/bin/odbcinst -i -d -r
  +        ) | $RPM_INSTALL_PREFIX/bin/odbcinst -i -d -r -n "PostgreSQL"
   %endif
       fi
       if [ $1 -eq 2 ]; then
  @@ -730,6 +747,10 @@
       [ $1 -eq 0 ] || exit 0
       %{l_rc} postgresql stop 2>/dev/null
       rm -f $RPM_INSTALL_PREFIX/var/postgresql/run/* >/dev/null 2>&1 || true
  +    #   optionally unlink from ODBC
  +%if "%{with_odbc}" == "yes"
  +    $RPM_INSTALL_PREFIX/bin/odbcinst -u -d -n "PostgreSQL"
  +%endif
       exit 0
   %endif
   
  @@ .
______________________________________________________________________
OpenPKG                                             http://openpkg.org
CVS Repository Commit List                     [email protected]

Reply via email to