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

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /e/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src openpkg-web          Date:   05-Feb-2003 16:52:54
  Branch: HEAD                             Handle: 2003020515525102

  Modified files:
    openpkg-src/postgresql  pg_migrate postgresql.spec
    openpkg-web             news.txt

  Log:
    be brain-dead enough and add full compatibility option

  Summary:
    Revision    Changes     Path
    1.3         +6  -4      openpkg-src/postgresql/pg_migrate
    1.42        +32 -10     openpkg-src/postgresql/postgresql.spec
    1.3204      +1  -0      openpkg-web/news.txt
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/postgresql/pg_migrate
  ============================================================================
  $ cvs diff -u -r1.2 -r1.3 pg_migrate
  --- openpkg-src/postgresql/pg_migrate 30 Dec 2002 22:06:16 -0000      1.2
  +++ openpkg-src/postgresql/pg_migrate 5 Feb 2003 15:52:53 -0000       1.3
  @@ -28,6 +28,8 @@
   l_prefix="@l_prefix@"
   l_rusr="@l_rusr@"
   l_rgrp="@l_rgrp@"
  +l_pguser="@l_pguser@"
  +l_pgpass="@l_pgpass@"
   
   #   establish sane environment
   LC_CTYPE=C
  @@ -77,7 +79,7 @@
   
           echo "++ dumping all databases into 
$l_prefix/var/postgresql/db.dump.sql.bz2"
           $l_prefix/bin/pg_dumpall \
  -            -U postgresql -Spostgresql -o -Xuse-set-session-authorization |\
  +            -U $l_pguser -S$l_pgpass -o -Xuse-set-session-authorization |\
               $l_prefix/lib/openpkg/bzip2 -9 \
                   >$l_prefix/var/postgresql/db.dump.sql.bz2
           chown ${l_rusr}:${l_rgrp} $l_prefix/var/postgresql/db.dump.sql.bz2
  @@ -134,8 +136,8 @@
   
           su - ${l_rusr} -c \
               "LC_CTYPE=C; export LC_CTYPE; umask 022; \
  -            (echo 'postgresql'; echo 'postgresql') |\
  -            $l_prefix/bin/pg_initdb -U postgresql -W -D 
$l_prefix/var/postgresql/db" 2>&1 |\
  +            (echo $l_pguser; echo $l_pgpass) |\
  +            $l_prefix/bin/pg_initdb -U $l_pguser -W -D $l_prefix/var/postgresql/db" 
2>&1 |\
                   $l_prefix/lib/openpkg/shtool prop \
                       -p "++ creating new database data"
   
  @@ -163,7 +165,7 @@
           echo "++ restoring all databases from 
$l_prefix/var/postgresql/db.dump.sql.bz2"
           $l_prefix/lib/openpkg/bzip2 -c -d \
               $l_prefix/var/postgresql/db.dump.sql.bz2 |\
  -                $l_prefix/bin/psql -U postgresql -d template1 2>&1 |\
  +                $l_prefix/bin/psql -U $l_pguser -d template1 2>&1 |\
                       tee $l_prefix/var/postgresql/db.log |\
                           $l_prefix/lib/openpkg/shtool prop \
                               -p "++ restoring data (see 
$l_prefix/var/postgresql/db.log)"
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/postgresql/postgresql.spec
  ============================================================================
  $ cvs diff -u -r1.41 -r1.42 postgresql.spec
  --- openpkg-src/postgresql/postgresql.spec    4 Feb 2003 18:00:00 -0000       1.41
  +++ openpkg-src/postgresql/postgresql.spec    5 Feb 2003 15:52:53 -0000       1.42
  @@ -40,12 +40,13 @@
   Group:        Database
   License:      GPL
   Version:      %{V_postgresql}
  -Release:      20030204
  +Release:      20030205
   
   #   package options
   %option       with_cxx      no
   %option       with_perl     no
   %option       with_odbc     no
  +%option       with_compat   no
   
   #   list of sources
   Source0:      
ftp://ftp.postgresql.org/pub/source/v%{V_postgresql}/postgresql-%{V_postgresql}.tar.gz
  @@ -207,10 +208,15 @@
       for prog in \
           createdb createlang createuser dropdb droplang \
           dropuser initdb initlocation ipcclean vacuumdb; do
  -        mv $RPM_BUILD_ROOT%{l_prefix}/bin/$prog \
  -           $RPM_BUILD_ROOT%{l_prefix}/bin/pg_$prog
  -        mv $RPM_BUILD_ROOT%{l_prefix}/man/man1/$prog.1 \
  -           $RPM_BUILD_ROOT%{l_prefix}/man/man1/pg_$prog.1
  +%if "%{with_compat}" == "yes"
  +        cmd="ln"
  +%else
  +        cmd="mv"
  +%endif
  +        $cmd $RPM_BUILD_ROOT%{l_prefix}/bin/$prog \
  +             $RPM_BUILD_ROOT%{l_prefix}/bin/pg_$prog
  +        $cmd $RPM_BUILD_ROOT%{l_prefix}/man/man1/$prog.1 \
  +             $RPM_BUILD_ROOT%{l_prefix}/man/man1/pg_$prog.1
       done
       ( cd $RPM_BUILD_ROOT%{l_prefix}/man/man7
         for man in *.7; do
  @@ -224,10 +230,19 @@
           $RPM_BUILD_ROOT%{l_prefix}/var/postgresql/run
   
       #   install migration utility
  +%if "%{with_compat}" == "yes"
  +    l_pguser="postgres"
  +    l_pgpass="postgres"
  +%else
  +    l_pguser="postgresql"
  +    l_pgpass="postgresql"
  +%endif
       %{l_shtool} install -c -m 755 \
           -e 's;@l_prefix@;%{l_prefix};g' \
           -e 's;@l_rusr@;%{l_rusr};g' \
           -e 's;@l_rgrp@;%{l_rgrp};g' \
  +        -e "s;@l_pguser@;${l_pguser};g" \
  +        -e "s;@l_pgpass@;${l_pgpass};g" \
           %{SOURCE pg_migrate} \
           $RPM_BUILD_ROOT%{l_prefix}/bin/
   
  @@ -321,11 +336,18 @@
   %post
       if [ $1 -eq 1 ]; then
           #   create initial database
  +%if "%{with_compat}" == "yes"
  +        l_pguser="postgres"
  +        l_pgpass="postgres"
  +%else
  +        l_pguser="postgresql"
  +        l_pgpass="postgresql"
  +%endif
           su - %{l_rusr} -c \
               "LC_CTYPE=C; export LC_CTYPE; umask 022; \
  -            (echo 'postgresql'; echo 'postgresql') |\
  +            (echo $l_pguser; echo $l_pgpass) |\
               $RPM_INSTALL_PREFIX/bin/pg_initdb \
  -                -U postgresql -W -D $RPM_INSTALL_PREFIX/var/postgresql/db" 2>&1 |\
  +                -U $l_pguser -W -D $RPM_INSTALL_PREFIX/var/postgresql/db" 2>&1 |\
           $RPM_INSTALL_PREFIX/lib/openpkg/shtool prop \
               -p "Creating initial PostgreSQL DB in 
$RPM_INSTALL_PREFIX/var/postgresql/db"
   
  @@ -345,11 +367,11 @@
           #   display information about next steps
           ( echo "An initial PostgreSQL DB was created with the two standard"
             echo "databases 'template0' and 'template1'. The owner of both"
  -          echo "is the DB user 'postgresql'. Its initial password is 'postgresql'."
  +          echo "is the DB user '$l_pguser'. Its initial password is '$l_pgpass'."
             echo "After starting PostgreSQL you should change this as quick as"
             echo "possible with the following command:"
  -          echo "\$ $RPM_INSTALL_PREFIX/bin/psql -U postgresql -d template1 \\"
  -          echo "  -c \"ALTER USER postgresql WITH PASSWORD '<new-password>'\""
  +          echo "\$ $RPM_INSTALL_PREFIX/bin/psql -U $l_pguser -d template1 \\"
  +          echo "  -c \"ALTER USER $l_pguser WITH PASSWORD '<new-password>'\""
           ) | %{l_rpmtool} msg -b -t notice
   
           #   optionally link into unixODBC
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-web/news.txt
  ============================================================================
  $ cvs diff -u -r1.3203 -r1.3204 news.txt
  --- openpkg-web/news.txt      5 Feb 2003 14:32:24 -0000       1.3203
  +++ openpkg-web/news.txt      5 Feb 2003 15:52:51 -0000       1.3204
  @@ -1,3 +1,4 @@
  +05-Feb-2003: Upgraded package: P<postgresql-7.3.2-20030205>
   05-Feb-2003: Upgraded package: P<openpkg-20030205-20030205>
   05-Feb-2003: Upgraded package: P<sendmail-8.12.7-20030205>
   05-Feb-2003: Upgraded package: P<aica-0.81-20030205>
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to