]> git.pld-linux.org Git - packages/postgresql.git/commitdiff
- added link patch - we don't need -lbsd -lnsl -lresolv -lbind(!)
authorJakub Bogusz <qboosh@pld-linux.org>
Wed, 12 Mar 2003 00:39:11 +0000 (00:39 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- added init action to .init (simple only, advices to use initdb in other cases)
- added protection against upgrade when old databases exist
- don't treat restart error in %%post as fatal - it caused leaving two
  versions of postgresql installed

Changed files:
    postgresql-link.patch -> 1.1
    postgresql.init -> 1.48
    postgresql.spec -> 1.199

postgresql-link.patch [new file with mode: 0644]
postgresql.init
postgresql.spec

diff --git a/postgresql-link.patch b/postgresql-link.patch
new file mode 100644 (file)
index 0000000..c1d58b1
--- /dev/null
@@ -0,0 +1,34 @@
+--- postgresql-7.3.2/configure.in.orig Wed Mar 12 00:19:05 2003
++++ postgresql-7.3.2/configure.in      Wed Mar 12 00:31:28 2003
+@@ -599,12 +599,13 @@
+ if test "$PORTNAME" != "aix" -a "$PORTNAME" != "alpha"
+ then
+-      AC_CHECK_LIB(bsd,      main)
++:
++dnl   AC_CHECK_LIB(bsd,      main)
+ fi
+ AC_CHECK_LIB(util,     setproctitle)
+ AC_CHECK_LIB(m,        main)
+ AC_CHECK_LIB(dl,       main)
+-AC_CHECK_LIB(nsl,      main)
++dnl AC_CHECK_LIB(nsl,      main)
+ AC_CHECK_LIB(socket,   main)
+ AC_CHECK_LIB(ipc,      main)
+ AC_CHECK_LIB(IPC,      main)
+@@ -615,13 +615,13 @@
+ AC_CHECK_LIB(BSD,      main)
+ AC_CHECK_LIB(gen,      main)
+ AC_CHECK_LIB(PW,       main)
+-AC_CHECK_LIB(resolv,   main)
++dnl AC_CHECK_LIB(resolv,   main)
+ AC_SEARCH_LIBS(getopt_long, [getopt gnugetopt])
+ # QNX:
+ AC_CHECK_LIB([[unix]], main)
+ AC_SEARCH_LIBS(crypt,  crypt)
+ # BeOS:
+-AC_CHECK_LIB(bind,     __inet_ntoa)
++AC_CHECK_FUNC(inet_ntoa, ,[AC_CHECK_LIB(bind,     __inet_ntoa)])
+ # Solaris:
+ AC_SEARCH_LIBS(fdatasync, [rt posix4])
+ # Cygwin:
index cc0e444a3bd1d88999a5f88ff473597eed130c2d..076518f8d536fd133220a58572907a1ec2a9263a 100644 (file)
@@ -207,6 +207,20 @@ case "$action" in
                done
                pgsubsys
        ;;
+       init)
+               echo "Note: this is only simple init action for convenience."
+               echo "If you want some non-standard options, consider using initdb(1)."
+               echo
+               for pgdir in $DB_CLUSTERS; do
+                       if [ -f $pgdir/PG_VERSION ]; then
+                               echo "Skipping existing cluster $pgdir"
+                       else
+                               echo "Initializing cluster $pgdir"
+                               TMPDIR=/tmp su - postgres -s /bin/sh -c "initdb -D $pgdir"
+                       fi
+               done
+               echo "REMEMBER to setup password for user \"postgres\"!"
+       ;;
        *)
                msg_usage "$0 {start|stop|status|restart|reload}"
                exit 1
index 4cd5b047d96dd1614c79b4783b950d22b05d7080..1e9ffac9b7ad3cee3dc7a8447781a0a39277908c 100644 (file)
@@ -2,7 +2,7 @@
 # - put pgcrypto docs into docdir
 # - put pgcrypto sql files in %{_datadir}/postgresql
 # - remove postgresql-configure patch and create postgresql-doc patch,
-#   which will prevent documentation and manulas installation (the routine
+#   which will prevent documentation and manuals installation (the routine
 #   is bad and we install docs and mans manually, at all) or create good
 #   routine and send it to postgresql team...
 #
@@ -38,6 +38,7 @@ Patch1:               %{name}-pg_ctl-silent.patch
 Patch2:                %{name}-pg_ctl-nopsql.patch
 Patch3:                %{name}-conf.patch
 Patch4:                %{name}-absolute_dbpaths.patch
+Patch5:                %{name}-link.patch
 Icon:          postgresql.xpm
 URL:           http://www.postgresql.org/
 BuildRequires: XFree86-devel
@@ -739,6 +740,7 @@ Funkcje kryptograficzne dla PostgreSQL.
 %patch2 -p0
 %patch3 -p1
 %{?_with_absolute_dbpaths:%patch4 -p1}
+%patch5 -p1
 
 tar xzf doc/man*.tar.gz
 
@@ -816,17 +818,39 @@ cd contrib/pgcrypto/
 rm -rf $RPM_BUILD_ROOT
 
 %pre
-echo "If you are upgrading from *pre* 7.3 version,"
-echo "then please downgrade and dump your databases."
-echo
-echo "Warning for upgrade from version *before* 7.2."
-echo "Please note, that postgresql module path changed from"
-echo "/usr/lib/pgsql/module to /usr/lib/postgresql. Change the path"
-echo "in dump file before restore."
-echo
-echo "Warning for upgrade from version *before* 7.3."
-echo "Reading following webpage is encouraged:"
-echo "http://www.ca.postgresql.org/docs/momjian/upgrade_tips_7.3."
+PG_DB_CLUSTERS=""
+if [ -f /etc/sysconfig/postgresql ]; then
+       . /etc/sysconfig/postgresql
+       if [ -z "$PG_DB_CLUSTERS" -a -n "$POSTGRES_DATA_DIR" ]; then
+               PG_DB_CLUSTERS="$POSTGRES_DATA_DIR"
+       fi
+fi
+foundold=0
+for pgdir in $PG_DB_CLUSTERS; do
+       if [ -f $pgdir/PG_VERSION ]; then
+               if [ `cat $pgdir/PG_VERSION` != '7.3' ]; then
+                       echo "Found database(s) in older, incompatible format in cluster $pgdir."
+                       foundold=1
+               fi
+       fi
+done
+if [ "$foundold" = "1" ]; then
+       echo
+       echo "Dump all data from clusters mentioned above (using pg_dump or pg_dumpall)"
+       echo "and clean (or rename) those directories; then upgrade postgresql and"
+       echo "restore all data (using pg_restore or psql)."
+       echo "Remember to stop the daemon before upgrading!"
+       echo
+       echo "Warning for upgrade from version *before* 7.2."
+       echo "Please note, that postgresql module path changed from"
+       echo "/usr/lib/pgsql/module to /usr/lib/postgresql. Change the path"
+       echo "in dump file before restore."
+       echo
+       echo "Warning for upgrade from version *before* 7.3."
+       echo "Reading following webpage is encouraged:"
+       echo "http://www.ca.postgresql.org/docs/momjian/upgrade_tips_7.3."
+       exit 1
+fi
 
 getgid postgres >/dev/null 2>&1 || /usr/sbin/groupadd -g 88 -r -f postgres
 if id postgres >/dev/null 2>&1 ; then
@@ -839,9 +863,8 @@ fi
 
 %post
 /sbin/chkconfig --add postgresql
-
 if [ -f /var/lock/subsys/postgresql ]; then
-       /etc/rc.d/init.d/postgresql restart >&2
+       /etc/rc.d/init.d/postgresql restart >&2 || :
 else
        echo "Run \"/etc/rc.d/init.d/postgresql start\" to start postgresql server."
 fi
This page took 0.219364 seconds and 4 git commands to generate.