summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2005-04-28 21:21:38 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2005-04-28 21:21:38 +0000
commit479be66112401ac3e9712b325ab53060ad2393b5 (patch)
treea43b5e91b50c0460abc231f6d96cbe0d884a3255
parent95336ade399bc304811c76c8d28fa8c1c2dcacb3 (diff)
update postgresql and fix gcc 3.4 build
git-svn-id: svn://svn.openwrt.org/openwrt/trunk/openwrt@748 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--package/postgresql/Makefile11
-rw-r--r--package/postgresql/patches/100-debian-12asmconstraints21
-rw-r--r--package/postgresql/patches/101-debian-27dbf2pg-textfield14
-rw-r--r--package/postgresql/patches/102-debian-30libpq33
-rw-r--r--package/postgresql/patches/500-debian-subset.patch1029
5 files changed, 76 insertions, 1032 deletions
diff --git a/package/postgresql/Makefile b/package/postgresql/Makefile
index 12fbde500..592d4cc34 100644
--- a/package/postgresql/Makefile
+++ b/package/postgresql/Makefile
@@ -3,9 +3,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=postgresql
-PKG_VERSION:=7.4.6
+PKG_VERSION:=7.4.7
PKG_RELEASE:=3
-PKG_MD5SUM:=f0ea2b372a7bdaf2613e92176ebf5e0f
+PKG_MD5SUM:=32dac2916d16287d95e0c958a75161fa
PKG_SOURCE_URL:=\
ftp://ftp3.us.postgresql.org/pub/postgresql/source/v$(PKG_VERSION)/ \
@@ -22,6 +22,11 @@ IPKG_LIBPQ:=$(PACKAGE_DIR)/libpq_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
IDIR_LIBPQ:=$(PKG_BUILD_DIR)/ipkg
INFO_LIBPQ:=$(IPKG_STATE_DIR)/info/libpq.list
+EXTRA_CFLAGS:=
+ifeq ($(BR2_GCC_3_4),y)
+ EXTRA_CFLAGS += -fno-unit-at-a-time
+endif
+
$(DL_DIR)/$(PKG_SOURCE):
$(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
@@ -34,7 +39,7 @@ $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
# ./configure advertise "--infodir", but does not support it, replaced with "--docdir"
(cd $(PKG_BUILD_DIR); rm -rf config.cache config.status; \
$(TARGET_CONFIGURE_OPTS) \
- CFLAGS="$(TARGET_CFLAGS)" \
+ CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
CPPFLAGS="$$CPPFLAGS -I$(STAGING_DIR)/usr/include" \
LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
./configure \
diff --git a/package/postgresql/patches/100-debian-12asmconstraints b/package/postgresql/patches/100-debian-12asmconstraints
new file mode 100644
index 000000000..f43eedc80
--- /dev/null
+++ b/package/postgresql/patches/100-debian-12asmconstraints
@@ -0,0 +1,21 @@
+diff -ruN postgresql-7.4.7-old/src/include/storage/s_lock.h postgresql-7.4.7/src/include/storage/s_lock.h
+--- postgresql-7.4.7-old/src/include/storage/s_lock.h 2004-06-15 16:09:30.000000000 +0200
++++ postgresql-7.4.7/src/include/storage/s_lock.h 2004-06-15 16:19:02.000000000 +0200
+@@ -125,7 +125,7 @@
+ __asm__ __volatile__(
+ " xchg4 %0=%1,%2 \n"
+ : "=r"(ret), "=m"(*lock)
+-: "r"(1), "1"(*lock)
++: "r"(1), "m"(*lock)
+ : "memory");
+
+ return (int) ret;
+@@ -294,7 +294,7 @@
+ " tas %1 \n"
+ " sne %0 \n"
+ : "=d"(rv), "=m"(*lock)
+-: "1"(*lock)
++: "m"(*lock)
+ : "cc");
+
+ return rv;
diff --git a/package/postgresql/patches/101-debian-27dbf2pg-textfield b/package/postgresql/patches/101-debian-27dbf2pg-textfield
new file mode 100644
index 000000000..a4507710f
--- /dev/null
+++ b/package/postgresql/patches/101-debian-27dbf2pg-textfield
@@ -0,0 +1,14 @@
+diff -ruN postgresql-7.4.7-old/contrib/dbase/dbf2pg.c postgresql-7.4.7/contrib/dbase/dbf2pg.c
+--- postgresql-7.4.7-old/contrib/dbase/dbf2pg.c 2004-10-31 20:09:10.923855000 +0100
++++ postgresql-7.4.7/contrib/dbase/dbf2pg.c 2004-10-31 20:11:24.676521696 +0100
+@@ -324,6 +324,10 @@
+ case 'L':
+ strcat(query, " char");
+ break;
++
++ case 'M':
++ strcat(query, " text");
++ break;
+ }
+ }
+
diff --git a/package/postgresql/patches/102-debian-30libpq b/package/postgresql/patches/102-debian-30libpq
new file mode 100644
index 000000000..245b97fac
--- /dev/null
+++ b/package/postgresql/patches/102-debian-30libpq
@@ -0,0 +1,33 @@
+diff -ruN postgresql-7.4.7-old/src/interfaces/libpq/Makefile postgresql-7.4.7/src/interfaces/libpq/Makefile
+--- postgresql-7.4.7-old/src/interfaces/libpq/Makefile 2003-08-23 05:21:59.000000000 +0100
++++ postgresql-7.4.7/src/interfaces/libpq/Makefile 2003-08-29 18:35:25.000000000 +0100
+@@ -32,7 +32,7 @@
+ SHLIB_LINK += $(filter -lcrypt -ldes -lkrb -lcom_err -lcrypto -lk5crypto -lkrb5 -lssl -lsocket -lnsl -lresolv -lintl, $(LIBS)) $(THREAD_LIBS)
+
+
+-all: all-lib
++all: all-lib libpq3-config
+
+ # Shared library stuff
+ include $(top_srcdir)/src/Makefile.shlib
+@@ -58,6 +58,8 @@
+ encnames.c wchar.c : % : $(backend_src)/utils/mb/%
+ rm -f $@ && $(LN_S) $< .
+
++libpq3-config:
++ sed -e "s|%LIBRARIES%|$(SHLIB_LINK)|" <libpq3-config.in | sed "s/-L[^ ]\+ //" >libpq3-config
+
+ install: all installdirs install-lib
+ $(INSTALL_DATA) $(srcdir)/libpq-fe.h $(DESTDIR)$(includedir)
+@@ -73,3 +75,4 @@
+
+ clean distclean maintainer-clean: clean-lib
+ rm -f $(OBJS) crypt.c getaddrinfo.c inet_aton.c snprintf.c strerror.c path.c thread.c dllist.c md5.c ip.c encnames.c wchar.c
++ rm -f libpq3-config
+diff -ruN postgresql-7.4.7-old/src/interfaces/libpq/libpq3-config.in postgresql-7.4.7/src/interfaces/libpq/libpq3-config.in
+--- postgresql-7.4.7-old/src/interfaces/libpq/libpq3-config.in 1970-01-01 01:00:00.000000000 +0100
++++ postgresql-7.4.7/src/interfaces/libpq/libpq3-config.in 2003-08-29 18:34:25.000000000 +0100
+@@ -0,0 +1,3 @@
++#!/bin/bash
++
++echo %LIBRARIES%
diff --git a/package/postgresql/patches/500-debian-subset.patch b/package/postgresql/patches/500-debian-subset.patch
deleted file mode 100644
index eb9dca7e3..000000000
--- a/package/postgresql/patches/500-debian-subset.patch
+++ /dev/null
@@ -1,1029 +0,0 @@
-diff -ruN postgresql-7.4.6-orig/contrib/Makefile postgresql-7.4.6-3/contrib/Makefile
---- postgresql-7.4.6-orig/contrib/Makefile 2003-09-11 19:15:27.000000000 +0200
-+++ postgresql-7.4.6-3/contrib/Makefile 2005-03-09 15:56:11.000000000 +0100
-@@ -22,8 +22,10 @@
- lo \
- ltree \
- miscutil \
-+ mysql \
- noupdate \
- oid2name \
-+ oracle \
- pg_autovacuum \
- pg_dumplo \
- pg_logger \
-@@ -40,7 +42,8 @@
- tsearch \
- tsearch2 \
- userlock \
-- vacuumlo
-+ vacuumlo \
-+ xml
-
- # Missing:
- # array \ (removed all but the README)
-@@ -48,13 +51,10 @@
- # ipc_check \ (does not have a makefile)
- # mSQL-interface \ (requires msql installed)
- # mac \ (does not have a makefile)
--# mysql \ (does not have a makefile)
--# oracle \ (does not have a makefile)
- # pg_upgrade \ (does not have a makefile)
- # reindexdb \ (does not have a makefile)
- # start-scripts \ (does not have a makefile)
- # tools \ (does not have a makefile)
--# xml \ (non-standard makefile)
-
-
- all install installdirs uninstall clean distclean maintainer-clean check installcheck:
-diff -ruN postgresql-7.4.6-orig/contrib/dbase/dbf2pg.c postgresql-7.4.6-3/contrib/dbase/dbf2pg.c
---- postgresql-7.4.6-orig/contrib/dbase/dbf2pg.c 2003-09-28 00:24:49.000000000 +0200
-+++ postgresql-7.4.6-3/contrib/dbase/dbf2pg.c 2005-03-09 15:56:11.000000000 +0100
-@@ -324,6 +324,10 @@
- case 'L':
- strcat(query, " char");
- break;
-+
-+ case 'M':
-+ strcat(query, " text");
-+ break;
- }
- }
-
-@@ -335,7 +339,10 @@
- printf("%s\n", query);
- }
-
-- if ((res = PQexec(conn, query)) == NULL)
-+ if ((res = PQexec(conn, query)) == NULL ||
-+ PQresultStatus(res) == PGRES_BAD_RESPONSE ||
-+ PQresultStatus(res) == PGRES_NONFATAL_ERROR ||
-+ PQresultStatus(res) == PGRES_FATAL_ERROR)
- {
- fprintf(stderr, "Error creating table!\n");
- fprintf(stderr, "Detailed report: %s\n", PQerrorMessage(conn));
-@@ -429,7 +436,10 @@
- }
- sprintf(query, "COPY %s FROM stdin", table);
- res = PQexec(conn, query);
-- if (res == NULL)
-+ if (res == NULL ||
-+ PQresultStatus(res)==PGRES_BAD_RESPONSE ||
-+ PQresultStatus(res)==PGRES_NONFATAL_ERROR ||
-+ PQresultStatus(res)==PGRES_FATAL_ERROR)
- {
- fprintf(stderr, "Error starting COPY!\n");
- fprintf(stderr, "Detailed report: %s\n", PQerrorMessage(conn));
-diff -ruN postgresql-7.4.6-orig/contrib/dbmirror/Makefile postgresql-7.4.6-3/contrib/dbmirror/Makefile
---- postgresql-7.4.6-orig/contrib/dbmirror/Makefile 2002-06-23 23:58:07.000000000 +0200
-+++ postgresql-7.4.6-3/contrib/dbmirror/Makefile 2005-03-09 15:56:11.000000000 +0100
-@@ -5,6 +5,8 @@
- include $(top_builddir)/src/Makefile.global
-
- MODULES = pending
-+SCRIPTS = clean_pending.pl DBMirror.pl
-+DATA = AddTrigger.sql MirrorSetup.sql slaveDatabase.conf
- DOCS = README.dbmirror
-
- include $(top_srcdir)/contrib/contrib-global.mk
-diff -ruN postgresql-7.4.6-orig/contrib/mysql/Makefile postgresql-7.4.6-3/contrib/mysql/Makefile
---- postgresql-7.4.6-orig/contrib/mysql/Makefile 1970-01-01 01:00:00.000000000 +0100
-+++ postgresql-7.4.6-3/contrib/mysql/Makefile 2005-03-09 15:56:11.000000000 +0100
-@@ -0,0 +1,12 @@
-+# mysql conversion Perl scripts
-+
-+subdir = contrib/mysql
-+top_builddir = ../..
-+include $(top_builddir)/src/Makefile.global
-+
-+MODULES =
-+SCRIPTS = my2pg.pl mysql2pgsql
-+DOCS = README.mysql
-+
-+include $(top_srcdir)/contrib/contrib-global.mk
-+
-diff -ruN postgresql-7.4.6-orig/contrib/mysql/mysql2pgsql postgresql-7.4.6-3/contrib/mysql/mysql2pgsql
---- postgresql-7.4.6-orig/contrib/mysql/mysql2pgsql 2001-01-18 08:16:56.000000000 +0100
-+++ postgresql-7.4.6-3/contrib/mysql/mysql2pgsql 2005-03-09 15:56:11.000000000 +0100
-@@ -1,4 +1,4 @@
--# -*- perl -*-
-+#!/usr/bin/perl -w
- # mysql2pgsql
- # Take a MySQL schema dump and turn it into SQL92 and PostgreSQL form.
- # Thomas Lockhart, (c) 2000, PostgreSQL Inc.
-diff -ruN postgresql-7.4.6-orig/contrib/oracle/Makefile postgresql-7.4.6-3/contrib/oracle/Makefile
---- postgresql-7.4.6-orig/contrib/oracle/Makefile 1970-01-01 01:00:00.000000000 +0100
-+++ postgresql-7.4.6-3/contrib/oracle/Makefile 2005-03-09 15:56:11.000000000 +0100
-@@ -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
-diff -ruN postgresql-7.4.6-orig/contrib/oracle/ora2pg.pl postgresql-7.4.6-3/contrib/oracle/ora2pg.pl
---- postgresql-7.4.6-orig/contrib/oracle/ora2pg.pl 2003-01-07 23:17:14.000000000 +0100
-+++ postgresql-7.4.6-3/contrib/oracle/ora2pg.pl 2005-03-09 15:56:11.000000000 +0100
-@@ -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
-diff -ruN postgresql-7.4.6-orig/contrib/pg_autovacuum/pg_autovacuum.c postgresql-7.4.6-3/contrib/pg_autovacuum/pg_autovacuum.c
---- postgresql-7.4.6-orig/contrib/pg_autovacuum/pg_autovacuum.c 2004-05-26 20:48:36.000000000 +0200
-+++ postgresql-7.4.6-3/contrib/pg_autovacuum/pg_autovacuum.c 2005-03-09 15:56:11.000000000 +0100
-@@ -5,6 +5,12 @@
- */
-
- #include "pg_autovacuum.h"
-+#include <string.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <fcntl.h>
-+
- #define TIMEBUFF 256
- FILE *LOGOUTPUT;
- char timebuffer[TIMEBUFF];
-@@ -30,6 +36,15 @@
- daemonize()
- {
- pid_t pid;
-+ int nullfd;
-+ char* pgdata = getenv("PGDATA");
-+
-+ /* Check if PGDATA is set. Needed to create pid file. */
-+ if (!pgdata)
-+ {
-+ fprintf(stderr, "Error: PGDATA not defined. Could not create pid file. Aborting\n");
-+ _exit(1);
-+ }
-
- pid = fork();
- if (pid == (pid_t) -1)
-@@ -40,10 +55,39 @@
- }
- else if (pid)
- { /* parent */
-+#define PIDFILEBUF 1024
-+ char databuf[PIDFILEBUF];
-+ char *dataptr = databuf;
-+ char *pidfilename = "/autovacuum.pid";
-+ FILE *PIDFILE;
-+
-+ /* If we can determine PGDATA, write a PID file there.
-+ * This is a fudge that depends on Debian's setting PGDATA
-+ * before calling pg_autovacuum in the init script. It
-+ * could do with being cleaned up for submission upstream. */
-+ strncpy(dataptr, pgdata, PIDFILEBUF - 1);
-+ databuf[PIDFILEBUF - 1] = '\0';
-+ if (strlen(dataptr) > 0 && strlen(dataptr) < PIDFILEBUF - strlen(pidfilename - 1)) {
-+ strcat(dataptr, pidfilename);
-+ /* Don't bother to report errors in opening PIDFILE */
-+ if ((PIDFILE = fopen((const char *) dataptr, "w")) != NULL) {
-+ fprintf(PIDFILE, "%d\n", pid);
-+ fclose(PIDFILE);
-+ }
-+ }
- /* Parent should just exit, without doing any atexit cleanup */
- _exit(0);
- }
-
-+ /* detach from stdin, stdout and stderr
-+ * (patched by Martin Pitt <mpitt@debian.org> for the Debian package) */
-+ nullfd = open("/dev/null", O_RDWR);
-+ dup2(nullfd, 0);
-+ dup2(nullfd, 1);
-+ dup2(nullfd, 2);
-+ if (nullfd != 0 && nullfd != 1 && nullfd != 2)
-+ close(nullfd);
-+
- /* GH: If there's no setsid(), we hopefully don't need silent mode.
- * Until there's a better solution. */
- #ifdef HAVE_SETSID
-diff -ruN postgresql-7.4.6-orig/contrib/xml/Makefile postgresql-7.4.6-3/contrib/xml/Makefile
---- postgresql-7.4.6-orig/contrib/xml/Makefile 2002-10-22 22:03:09.000000000 +0200
-+++ postgresql-7.4.6-3/contrib/xml/Makefile 2005-03-09 15:56:11.000000000 +0100
-@@ -4,6 +4,7 @@
- top_builddir = ../..
- include $(top_builddir)/src/Makefile.global
-
-+CFLAGS += $(shell xml2-config --cflags)
- MODULE_big = pgxml_dom
- OBJS = pgxml_dom.o
- SHLIB_LINK = -lxml2
-diff -ruN postgresql-7.4.6-orig/doc/src/sgml/Makefile postgresql-7.4.6-3/doc/src/sgml/Makefile
---- postgresql-7.4.6-orig/doc/src/sgml/Makefile 2004-03-09 21:10:19.000000000 +0100
-+++ postgresql-7.4.6-3/doc/src/sgml/Makefile 2005-03-09 15:56:11.000000000 +0100
-@@ -66,6 +66,9 @@
- $(NSGMLS) $(NSGMLS_FLAGS) $< | $(SGMLSPL) $(D2MSCRIPT) --lowercase --section $(DEFAULTSECTION) --date "`date '+%Y-%m-%d'`"
- $(mkinstalldirs) man1 man$(DEFAULTSECTION)
- mv *.1 man1/
-+ mmv '*.' "#l1.$(DEFAULTSECTION)"
-+ mmv '* *.'$(DEFAULTSECTION) "#1_#2.$(DEFAULTSECTION)"
-+ mmv '* *.'$(DEFAULTSECTION) "#1_#2.$(DEFAULTSECTION)"
- mv *.$(DEFAULTSECTION) man$(DEFAULTSECTION)/
-
-
-diff -ruN postgresql-7.4.6-orig/doc/src/sgml/ref/initdb.sgml postgresql-7.4.6-3/doc/src/sgml/ref/initdb.sgml
---- postgresql-7.4.6-orig/doc/src/sgml/ref/initdb.sgml 2003-08-31 19:32:23.000000000 +0200
-+++ postgresql-7.4.6-3/doc/src/sgml/ref/initdb.sgml 2005-03-09 15:56:11.000000000 +0100
-@@ -227,6 +227,24 @@
- </para>
- </listitem>
- </varlistentry>
-+
-+ <varlistentry>
-+ <term><option>--debian-conffile</option></term>
-+ <listitem>
-+ <para>
-+ On Debian systems, this option is used by the package's
-+ post-initialisation script when it runs <command>initdb</command> to
-+ create a database.
-+ It symlinks the configuration files into the <filename>/etc/postgresql</filename>
-+ directory, whereas the standard behaviour is to put these files
-+ into the database directory.
-+ </para>
-+ <para>
-+ This option disables that behaviour, thus causing <command>initdb</command>
-+ to behave as expected.
-+ </para>
-+ </listitem>
-+ </varlistentry>
- </variablelist>
- </para>
-
-diff -ruN postgresql-7.4.6-orig/doc/src/sgml/ref/pg_dump.sgml postgresql-7.4.6-3/doc/src/sgml/ref/pg_dump.sgml
---- postgresql-7.4.6-orig/doc/src/sgml/ref/pg_dump.sgml 2004-10-22 00:49:04.000000000 +0200
-+++ postgresql-7.4.6-3/doc/src/sgml/ref/pg_dump.sgml 2005-03-09 15:56:11.000000000 +0100
-@@ -304,6 +304,18 @@
- </varlistentry>
-
- <varlistentry>
-+ <term><option>-N</></term>
-+ <term><option>--convert-now</></term>
-+ <listitem>
-+ <para>
-+ In DEFAULT clauses of table column definitions, convert the old
-+ <literal>DEFAULT 'now'</literal> syntax (up to PostgreSQL 7.3) to
-+ <literal>DEFAULT now()</literal>.
-+ </para>
-+ </listitem>
-+ </varlistentry>
-+
-+ <varlistentry>
- <term><option>-o</></term>
- <term><option>--oids</></term>
- <listitem>
-diff -ruN postgresql-7.4.6-orig/doc/src/sgml/ref/pg_dumpall.sgml postgresql-7.4.6-3/doc/src/sgml/ref/pg_dumpall.sgml
---- postgresql-7.4.6-orig/doc/src/sgml/ref/pg_dumpall.sgml 2003-11-04 10:45:30.000000000 +0100
-+++ postgresql-7.4.6-3/doc/src/sgml/ref/pg_dumpall.sgml 2005-03-09 15:56:11.000000000 +0100
-@@ -164,6 +164,18 @@
- </varlistentry>
-
- <varlistentry>
-+ <term><option>-N</></term>
-+ <term><option>--convert-now</></term>
-+ <listitem>
-+ <para>
-+ In DEFAULT clauses of table column definitions, convert the old
-+ <literal>DEFAULT 'now'</literal> syntax (up to PostgreSQL 7.3) to
-+ <literal>DEFAULT now()</literal>.
-+ </para>
-+ </listitem>
-+ </varlistentry>
-+
-+ <varlistentry>
- <term><option>-o</></term>
- <term><option>--oids</></term>
- <listitem>
-diff -ruN postgresql-7.4.6-orig/doc/src/sgml/ref/psql-ref.sgml postgresql-7.4.6-3/doc/src/sgml/ref/psql-ref.sgml
---- postgresql-7.4.6-orig/doc/src/sgml/ref/psql-ref.sgml 2003-11-01 02:56:29.000000000 +0100
-+++ postgresql-7.4.6-3/doc/src/sgml/ref/psql-ref.sgml 2005-03-09 15:56:11.000000000 +0100
-@@ -494,7 +494,9 @@
- local host. The default port number is compile-time determined.
- Since the database server uses the same default, you will not have
- to specify the port in most cases. The default user name is your
-- Unix user name, as is the default database name. Note that you can't
-+ Unix user name. In standard PostgreSQL, the database name defaults to your
-+ username too, but in this Debian version, when called through pg_wrapper,
-+ the database must be specified. Note that you can't
- just connect to any database under any user name. Your database
- administrator should have informed you about your access rights. To
- save you some typing you can also set the environment variables
-diff -ruN postgresql-7.4.6-orig/ipkg/libpq/CONTROL/control postgresql-7.4.6-3/ipkg/libpq/CONTROL/control
-diff -ruN postgresql-7.4.6-orig/ipkg/libpq-dev/CONTROL/control postgresql-7.4.6-3/ipkg/libpq-dev/CONTROL/control
-diff -ruN postgresql-7.4.6-orig/ipkg/pgsql-utils/CONTROL/control postgresql-7.4.6-3/ipkg/pgsql-utils/CONTROL/control
-diff -ruN postgresql-7.4.6-orig/ipkg/rules postgresql-7.4.6-3/ipkg/rules
-diff -ruN postgresql-7.4.6-orig/ipkg/version postgresql-7.4.6-3/ipkg/version
-diff -ruN postgresql-7.4.6-orig/src/Makefile.global.in postgresql-7.4.6-3/src/Makefile.global.in
---- postgresql-7.4.6-orig/src/Makefile.global.in 2003-12-20 00:29:29.000000000 +0100
-+++ postgresql-7.4.6-3/src/Makefile.global.in 2005-03-09 15:56:11.000000000 +0100
-@@ -87,7 +87,7 @@
- pkglibdir = $(libdir)
- ifeq "$(findstring pgsql, $(pkglibdir))" ""
- ifeq "$(findstring postgres, $(pkglibdir))" ""
--override pkglibdir := $(pkglibdir)/postgresql
-+override pkglibdir := $(pkglibdir)/postgresql/lib
- endif
- endif
-
-diff -ruN postgresql-7.4.6-orig/src/backend/libpq/pg_hba.conf.sample postgresql-7.4.6-3/src/backend/libpq/pg_hba.conf.sample
---- postgresql-7.4.6-orig/src/backend/libpq/pg_hba.conf.sample 2003-09-13 18:43:38.000000000 +0200
-+++ postgresql-7.4.6-3/src/backend/libpq/pg_hba.conf.sample 2005-03-09 15:56:11.000000000 +0100
-@@ -24,39 +24,77 @@
- # DATABASE can be "all", "sameuser", "samegroup", a database name (or
- # a comma-separated list thereof), or a file name prefixed with "@".
- # USER can be "all", an actual user name or a group name prefixed with
--# "+" or a list containing either. IP-ADDRESS and IP-MASK specify the
--# set of hosts the record matches. CIDR-MASK is an integer between 0
--# and 32 (IPv6) or 128(IPv6) inclusive, that specifies the number of
--# significant bits in the mask, so an IPv4 CIDR-MASK of 8 is equivalent
--# to an IP-MASK of 255.0.0.0, and an IPv6 CIDR-MASK of 64 is equivalent
--# to an IP-MASK of ffff:ffff:ffff:ffff::. METHOD can be "trust", "reject",
--# "md5", "crypt", "password", "krb4", "krb5", "ident", or "pam". Note
--# that "password" uses clear-text passwords; "md5" is preferred for
-+# "+", an include file prefixed with "@" or a list containing either.
-+# IP-ADDRESS and IP-MASK specify the set of hosts the record matches.
-+# CIDR-MASK is an integer between 0 and 32 (IPv6) or 128(IPv6)
-+# inclusive, that specifies the number of significant bits in the
-+# mask, so an IPv4 CIDR-MASK of 8 is equivalent to an IP-MASK of
-+# 255.0.0.0, and an IPv6 CIDR-MASK of 64 is equivalent to an IP-MASK
-+# of ffff:ffff:ffff:ffff::. METHOD can be "trust", "reject", "md5",
-+# "crypt", "password", "krb5", "ident", or "pam". Note that
-+# "password" uses clear-text passwords; "md5" is preferred for
- # encrypted passwords. OPTION is the ident map or the name of the PAM
- # service.
- #
-+# INCLUDE FILES:
-+# If you use include files for users and/or databases (see PostgreSQL
-+# documentation, section 19.1), these files must be placed in the
-+# database directory. Usually this is /var/lib/postgres/data/, but
-+# that can be changed in /etc/postgresql/postmaster.conf with the
-+# POSTGRES_DATA variable. Putting them in /etc/postgresql/ will NOT
-+# work since the configuration files are only symlinked from
-+# POSTGRES_DATA.
-+#
- # This file is read on server startup and when the postmaster receives
- # a SIGHUP signal. If you edit the file on a running system, you have
- # to SIGHUP the postmaster for the changes to take effect, or use
- # "pg_ctl reload".
--
-+#
-+# Upstream default configuration
-+#
-+# The following configuration is the upstream default, which allows
-+# unrestricted access to amy database by any user on the local machine.
-+#
-+# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
-+#
-+#local all all trust
-+# IPv4-style local connections:
-+#host all all 127.0.0.1 255.255.255.255 trust
-+# IPv6-style local connections:
-+#
- # Put your actual configuration here
- # ----------------------------------
- #
--# CAUTION: The default configuration allows any local user to connect
--# using any PostgreSQL user name, including the superuser, over either
--# Unix-domain sockets or TCP/IP. If you are on a multiple-user
--# machine, the default configuration is probably too liberal for you.
--# Change it to use something other than "trust" authentication.
-+# This default configuration allows any local user to connect as himself
-+# without a password, either through a Unix socket or through TCP/IP; users
-+# on other machines are denied access.
- #
- # If you want to allow non-local connections, you need to add more
--# "host" records. Also, remember TCP/IP connections are only enabled
--# if you enable "tcpip_socket" in postgresql.conf.
--
-+# "host" records before the final line that rejects all TCP/IP connections.
-+# Also, remember TCP/IP connections are only enabled if you enable
-+# "tcpip_socket" in /etc/postgresql/postgresql.conf.
-+#
-+# DO NOT DISABLE!
-+# If you change this first entry you will need to make sure the postgres user
-+# can access the database using some other method. The postgres user needs
-+# non-interactive access to all databases during automatic maintenance
-+# (see the vacuum command and the /usr/lib/postgresql/bin/do.maintenance
-+# script).
-+#
- # TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
-+# Database administrative login by UNIX sockets
-+local all postgres ident sameuser
-+#
-+# All other connections by UNIX sockets
-+local all all ident sameuser
-+#
-+# All IPv4 connections from localhost
-+host all all 127.0.0.1 255.255.255.255 ident sameuser
-+#
-+# All IPv6 localhost connections
-+host all all ::1 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff ident sameuser
-+host all all ::ffff:127.0.0.1/128 ident sameuser
-+#
-+# reject all other connection attempts
-+host all all 0.0.0.0 0.0.0.0 reject
-
--local all all trust
--# IPv4-style local connections:
--host all all 127.0.0.1 255.255.255.255 trust
--# IPv6-style local connections:
--host all all ::1 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff trust
-diff -ruN postgresql-7.4.6-orig/src/backend/storage/file/fd.c postgresql-7.4.6-3/src/backend/storage/file/fd.c
---- postgresql-7.4.6-orig/src/backend/storage/file/fd.c 2004-02-24 00:03:43.000000000 +0100
-+++ postgresql-7.4.6-3/src/backend/storage/file/fd.c 2005-03-09 15:56:11.000000000 +0100
-@@ -50,6 +50,9 @@
- #include "storage/fd.h"
- #include "storage/ipc.h"
-
-+#ifdef CHECK_RLIMIT_NOFILE
-+#include <sys/resource.h>
-+#endif
-
- /* Filename components for OpenTemporaryFile */
- #define PG_TEMP_FILES_DIR "pgsql_tmp"
-@@ -272,15 +275,28 @@
- int used = 0;
- int highestfd = 0;
- int j;
-+#ifdef CHECK_RLIMIT_NOFILE
-+ struct rlimit rlim;
-+#endif
-
- size = 1024;
- fd = (int *) palloc(size * sizeof(int));
-
-+#ifdef CHECK_RLIMIT_NOFILE
-+ getrlimit(RLIMIT_NOFILE, &rlim);
-+#endif
-+
- /* dup until failure ... */
- for (;;)
- {
- int thisfd;
-
-+#ifdef CHECK_RLIMIT_NOFILE
-+ /* Don't go beyond RLIMIT_NOFILE */
-+ if (highestfd >= rlim.rlim_cur - 1)
-+ break;
-+#endif
-+
- thisfd = dup(0);
- if (thisfd < 0)
- {
-diff -ruN postgresql-7.4.6-orig/src/bin/initdb/initdb.sh postgresql-7.4.6-3/src/bin/initdb/initdb.sh
---- postgresql-7.4.6-orig/src/bin/initdb/initdb.sh 2004-05-05 18:09:56.000000000 +0200
-+++ postgresql-7.4.6-3/src/bin/initdb/initdb.sh 2005-03-09 15:56:11.000000000 +0100
-@@ -71,7 +71,6 @@
- echo "$ret"
- }
-
--
- CMDNAME=`basename $0`
-
- # Placed here during build
-@@ -196,6 +195,7 @@
- debug=
- noclean=
- show_setting=
-+debian_conffile=
-
- # Note: There is a single compelling reason that the name of the database
- # superuser be the same as the Unix user owning the server process:
-@@ -318,6 +318,14 @@
- --lc-time=*)
- PGLC_TIME=`echo $1 | sed 's/^[^=]*=//'`
- ;;
-+# Debian's initdb is going to try to symlink the files from $PGDATA to
-+# /etc/postgres... but if you're initialising a database somewhere else,
-+# you don't want this behaviour, so tell initdb to not do it.
-+ --debian-conffile)
-+ debian_conffile=yes
-+ echo "use debian conffile location"
-+ ;;
-+
-
- -*)
- echo "$CMDNAME: invalid option: $1"
-@@ -590,6 +598,8 @@
- #
- # CREATE CONFIG FILES
-
-+if [ -z "$debian_conffile" ]
-+then
- $ECHO_N "creating configuration files... "$ECHO_C
-
- sed -e "s/^#shared_buffers = 1000/shared_buffers = $nbuffers/" \
-@@ -611,6 +621,32 @@
- chmod 0600 "$PGDATA"/pg_hba.conf "$PGDATA"/pg_ident.conf \
- "$PGDATA"/postgresql.conf
-
-+else
-+
-+# debian-conffile option set:
-+# In a Debian primary installation, the config files go to /etc/postgresql/
-+# rather than to $PGDATA.
-+ln -sf /etc/postgresql/pg_hba.conf $PGDATA/pg_hba.conf || exit_nicely
-+ln -sf /etc/postgresql/pg_ident.conf $PGDATA/pg_ident.conf || exit_nicely
-+ln -sf /etc/postgresql/postgresql.conf $PGDATA/postgresql.conf || exit_nicely
-+
-+# Since postgresql.conf is a permanent file, rather than created with the
-+# database, it must have the LC_ values replaced rather than just tacked
-+# on the end.
-+(
-+ grep -vE '^LC_(MESSAGES|MONETARY|NUMERIC|TIME) *=' /etc/postgresql/postgresql.conf
-+ for cat in MESSAGES MONETARY NUMERIC TIME; do
-+ echo "LC_$cat = '`pg_getlocale $cat`'"
-+ done
-+) >/etc/postgresql/$$ || exit_nicely
-+cat /etc/postgresql/$$ >/etc/postgresql/postgresql.conf || exit_nicely
-+rm /etc/postgresql/$$
-+
-+chmod 0600 /etc/postgresql/pg_hba.conf /etc/postgresql/pg_ident.conf
-+chmod 0644 /etc/postgresql/postgresql.conf
-+
-+fi
-+
- echo "ok"
-
- ##########################################################################
-@@ -1143,13 +1179,9 @@
- # FINISHED
-
- echo
--echo "Success. You can now start the database server using:"
--echo ""
--echo " $PGPATH/postmaster -D $PGDATA"
--echo "or"
--# (Advertise -l option here, otherwise we have a background
--# process writing to the terminal.)
--echo " $PGPATH/pg_ctl -D $PGDATA -l logfile start"
-+echo "Success. The database server should be started automatically."
-+echo "If not, you can start the database server using:"
- echo
-+echo " /etc/init.d/postgresql start"
-
- exit 0
-diff -ruN postgresql-7.4.6-orig/src/bin/pg_ctl/pg_ctl.sh postgresql-7.4.6-3/src/bin/pg_ctl/pg_ctl.sh
---- postgresql-7.4.6-orig/src/bin/pg_ctl/pg_ctl.sh 2004-10-22 02:24:27.000000000 +0200
-+++ postgresql-7.4.6-3/src/bin/pg_ctl/pg_ctl.sh 2005-03-09 15:56:11.000000000 +0100
-@@ -139,31 +139,72 @@
- exit 0
- ;;
- -D)
-- shift
-+ PGDATA="$2"
-+ if [ -z "$PGDATA" -o `echo x$PGDATA | cut -c1-2` = "x-" ]
-+ then
-+ echo "$CMDNAME: option '-D' specified without a data directory"
-+ exit 1
-+ fi
- # we need to do this so -D datadir shows in ps display
-- PGDATAOPTS="-D $1"
-- PGDATA="$1"
-+ PGDATAOPTS="-D $PGDATA"
- export PGDATA
-+ shift
- ;;
- -l)
- logfile="$2"
-+ if [ -z "$logfile" -o `echo x$logfile | cut -c1-2` = "x-" ]
-+ then
-+ echo "$CMDNAME: option '-l' specified without a logfile"
-+ exit 1
-+ fi
- shift;;
- -l*)
- logfile=`echo "$1" | sed 's/^-l//'`
-+ if [ -z "$logfile" -o `echo x$logfile | cut -c1-2` = "x-" ]
-+ then
-+ echo "$CMDNAME: option '-l' specified without a logfile"
-+ exit 1
-+ fi
- ;;
- -m)
- shutdown_mode="$2"
-+ if [ -z "$shutdown_mode" -o `echo x$shutdown_mode | cut -c1-2` = "x-" ]
-+ then
-+ echo "$CMDNAME: option '-m' specified without a shutdown mode"
-+ exit 1
-+ fi
- shift;;
- -m*)
- shutdown_mode=`echo "$1" | sed 's/^-m//'`
-+ if [ -z "$shutdown_mode" -o `echo x$shutdown_mode | cut -c1-2` = "x-" ]
-+ then
-+ echo "$CMDNAME: option '-m' specified without a shutdown mode"
-+ exit 1
-+ fi
- ;;
- -o)
-+ POSTOPTS="$2"
-+ if [ -z "$POSTOPTS" ]
-+ then
-+ echo "$CMDNAME: option '-o' specified without any passed options"
-+ exit 1
-+ fi
-+ if [ `echo x$POSTOPTS | cut -c1-2` != x- ]
-+ then
-+ echo "$CMDNAME: option -o must be followed by one or more further options
-+ to pass to the postmaster"
-+ exit 1
-+ fi
- shift
-- POSTOPTS="$1"
- ;;
- -p)
-+ po_path="$2"
-+ if [ -z "$po_path" -o `echo x$po_path | cut -c1-2` = "x-" ]
-+ then
-+ echo "$CMDNAME: option '-p' specified without a path"
-+ exit 1
-+ fi
- shift
-- po_path="$1"
- ;;
- -s)
- silence_echo=:
-diff -ruN postgresql-7.4.6-orig/src/bin/pg_dump/pg_dump.c postgresql-7.4.6-3/src/bin/pg_dump/pg_dump.c
---- postgresql-7.4.6-orig/src/bin/pg_dump/pg_dump.c 2004-05-26 20:27:23.000000000 +0200
-+++ postgresql-7.4.6-3/src/bin/pg_dump/pg_dump.c 2005-03-09 15:56:11.000000000 +0100
-@@ -135,6 +135,7 @@
- bool schemaOnly;
- bool dataOnly;
- bool aclsSkip;
-+bool convertNow;
-
- /* obsolete as of 7.3: */
- static Oid g_last_builtin_oid; /* value of the last builtin oid */
-@@ -198,6 +199,7 @@
- {"no-owner", no_argument, NULL, 'O'},
- {"port", required_argument, NULL, 'p'},
- {"schema", required_argument, NULL, 'n'},
-+ {"convert-now", no_argument, NULL, 'N'},
- {"schema-only", no_argument, NULL, 's'},
- {"superuser", required_argument, NULL, 'S'},
- {"table", required_argument, NULL, 't'},
-@@ -233,7 +235,7 @@
- g_comment_end[0] = '\0';
- strcpy(g_opaque_type, "opaque");
-
-- dataOnly = schemaOnly = dumpData = attrNames = false;
-+ dataOnly = schemaOnly = dumpData = attrNames = convertNow = false;
-
- progname = get_progname(argv[0]);
-
-@@ -258,7 +260,7 @@
- }
- }
-
-- while ((c = getopt_long(argc, argv, "abcCdDf:F:h:in:oOp:RsS:t:uU:vWxX:Z:",
-+ while ((c = getopt_long(argc, argv, "abcCdDf:F:h:in:NoOp:RsS:t:uU:vWxX:Z:",
- long_options, &optindex)) != -1)
- {
- switch (c)
-@@ -310,6 +312,10 @@
- selectSchemaName = strdup(optarg);
- break;
-
-+ case 'N': /* convert DEFAULT 'now' to DEFAULT now() */
-+ convertNow = true;
-+ break;
-+
- case 'o': /* Dump oids */
- oids = true;
- break;
-@@ -535,6 +541,13 @@
- exit_horribly(g_fout, NULL, "could not set extra_float_digits: %s",
- PQerrorMessage(g_conn));
- PQclear(res);
-+
-+ /* Set datestyle to ISO to ensure portability */
-+ res = PQexec(g_conn, "SET DATESTYLE = ISO");
-+ if (!res || PQresultStatus(res) != PGRES_COMMAND_OK)
-+ exit_horribly(g_fout, NULL, "could not set datestyle to ISO: %s",
-+ PQerrorMessage(g_conn));
-+ PQclear(res);
- }
-
- /* Find the last built-in OID, if needed */
-@@ -633,6 +646,7 @@
- printf(_(" -d, --inserts dump data as INSERT, rather than COPY, commands\n"));
- printf(_(" -D, --column-inserts dump data as INSERT commands with column names\n"));
- printf(_(" -n, --schema=SCHEMA dump the named schema only\n"));
-+ printf(_(" -N, --convert-now convert DEFAULT 'now' to DEFAULT now()\n"));
- printf(_(" -o, --oids include OIDs in dump\n"));
- printf(_(" -O, --no-owner do not output commands to set object ownership\n"
- " in plain text format\n"));
-@@ -665,6 +679,19 @@
- }
-
- /*
-+ * handleConvertNow: called on DEFAULT arguments in table column definitions;
-+ * if conversion is enabled, returns now() instead of 'now'
-+ */
-+const char*
-+handleConvertNow(const char* value)
-+{
-+ if( convertNow && !strcmp(value,"'now'"))
-+ return "now()";
-+ else
-+ return value;
-+}
-+
-+/*
- * selectDumpableNamespace: policy-setting subroutine
- * Mark a namespace as to be dumped or not
- */
-@@ -5334,7 +5361,7 @@
- !tbinfo->inhAttrDef[j] &&
- !tbinfo->attisserial[j])
- appendPQExpBuffer(q, " DEFAULT %s",
-- tbinfo->adef_expr[j]);
-+ handleConvertNow( tbinfo->adef_expr[j] ) );
-
- /*
- * Not Null constraint --- suppress if inherited
-diff -ruN postgresql-7.4.6-orig/src/bin/pg_dump/pg_dumpall.c postgresql-7.4.6-3/src/bin/pg_dump/pg_dumpall.c
---- postgresql-7.4.6-orig/src/bin/pg_dump/pg_dumpall.c 2004-01-22 20:09:48.000000000 +0100
-+++ postgresql-7.4.6-3/src/bin/pg_dump/pg_dumpall.c 2005-03-09 15:56:11.000000000 +0100
-@@ -86,6 +86,7 @@
- {"globals-only", no_argument, NULL, 'g'},
- {"host", required_argument, NULL, 'h'},
- {"ignore-version", no_argument, NULL, 'i'},
-+ {"convert-now", no_argument, NULL, 'N'},
- {"oids", no_argument, NULL, 'o'},
- {"port", required_argument, NULL, 'p'},
- {"password", no_argument, NULL, 'W'},
-@@ -124,7 +125,7 @@
- pgdumploc = findPgDump(argv[0]);
- pgdumpopts = createPQExpBuffer();
-
-- while ((c = getopt_long(argc, argv, "acdDgh:iop:sU:vWx", long_options, &optindex)) != -1)
-+ while ((c = getopt_long(argc, argv, "acdDgh:iNop:sU:vWx", long_options, &optindex)) != -1)
- {
- switch (c)
- {
-@@ -156,6 +157,10 @@
- appendPQExpBuffer(pgdumpopts, " -%c", c);
- break;
-
-+ case 'N':
-+ appendPQExpBuffer(pgdumpopts, " -N");
-+ break;
-+
- case 'p':
- pgport = optarg;
- appendPQExpBuffer(pgdumpopts, " -p '%s'", pgport);
-@@ -243,6 +248,7 @@
- printf(_(" -g, --globals-only dump only global objects, no databases\n"));
- printf(_(" -i, --ignore-version proceed even when server version mismatches\n"
- " pg_dumpall version\n"));
-+ printf(_(" -N, --convert-now convert DEFAULT 'now' to DEFAULT now()\n"));
- printf(_(" -s, --schema-only dump only the schema, no data\n"));
- printf(_(" -o, --oids include OIDs in dump\n"));
- printf(_(" -v, --verbose verbose mode\n"));
-diff -ruN postgresql-7.4.6-orig/src/include/Makefile postgresql-7.4.6-3/src/include/Makefile
---- postgresql-7.4.6-orig/src/include/Makefile 2003-11-25 20:10:15.000000000 +0100
-+++ postgresql-7.4.6-3/src/include/Makefile 2005-03-10 23:38:56.000000000 +0100
-@@ -79,8 +79,8 @@
-
-
- uninstall:
-- rm -f $(addprefix $(DESTDIR)$(includedir)/, pg_config.h pg_config_os.h postgres_ext.h libpq/libpq-fs.h)
-- rm -f $(addprefix $(DESTDIR)$(includedir_internal)/, c.h postgres_fe.h lib/dllist.h libpq/pqcomm.h)
-+ rm -f $(addprefix $(DESTDIR)$(includedir)/, pg_config.h pg_config_manual.h pg_config_os.h postgres_ext.h libpq/libpq-fs.h)
-+ rm -f $(addprefix $(DESTDIR)$(includedir_internal)/, c.h port.h postgres_fe.h lib/dllist.h libpq/pqcomm.h)
- # heuristic...
- rm -rf $(addprefix $(DESTDIR)$(includedir_server)/, $(SUBDIRS) *.h)
-
-diff -ruN postgresql-7.4.6-orig/src/include/pg_config_manual.h postgresql-7.4.6-3/src/include/pg_config_manual.h
---- postgresql-7.4.6-orig/src/include/pg_config_manual.h 2003-09-21 19:57:21.000000000 +0200
-+++ postgresql-7.4.6-3/src/include/pg_config_manual.h 2005-03-09 15:56:11.000000000 +0100
-@@ -165,7 +165,7 @@
- * here's where to twiddle it. You can also override this at runtime
- * with the postmaster's -k switch.
- */
--#define DEFAULT_PGSOCKET_DIR "/tmp"
-+#define DEFAULT_PGSOCKET_DIR "/var/run/postgresql"
-
- /*
- * Defining this will make float4 and float8 operations faster by
-diff -ruN postgresql-7.4.6-orig/src/include/port/linux.h postgresql-7.4.6-3/src/include/port/linux.h
---- postgresql-7.4.6-orig/src/include/port/linux.h 2003-10-26 02:41:10.000000000 +0100
-+++ postgresql-7.4.6-3/src/include/port/linux.h 2005-03-09 15:56:11.000000000 +0100
-@@ -48,4 +48,12 @@
-
- #define HAS_TEST_AND_SET
-
-+#elif defined(__hppa__)
-+typedef struct
-+{
-+ int sema[4];
-+} slock_t;
-+
-+#define HAS_TEST_AND_SET
-+
- #endif
-diff -ruN postgresql-7.4.6-orig/src/include/storage/s_lock.h postgresql-7.4.6-3/src/include/storage/s_lock.h
---- postgresql-7.4.6-orig/src/include/storage/s_lock.h 2003-11-04 10:43:56.000000000 +0100
-+++ postgresql-7.4.6-3/src/include/storage/s_lock.h 2005-03-09 15:56:11.000000000 +0100
-@@ -125,7 +125,7 @@
- __asm__ __volatile__(
- " xchg4 %0=%1,%2 \n"
- : "=r"(ret), "=m"(*lock)
--: "r"(1), "1"(*lock)
-+: "r"(1), "m"(*lock)
- : "memory");
-
- return (int) ret;
-@@ -151,6 +151,29 @@
-
- #endif /* __arm__ */
-
-+#if defined(__hppa__)
-+/*
-+ * * HP PA-RISC Linux
-+ * */
-+#define TAS(lock) tas(lock)
-+#define TAS_ACTIVE_WORD(lock) ((volatile int *) (((long) (lock) + 15) & ~15))
-+#define S_UNLOCK(lock) (*TAS_ACTIVE_WORD(lock) = -1)
-+
-+static __inline__ int
-+tas(volatile slock_t *lock)
-+{
-+ volatile int *lockword = TAS_ACTIVE_WORD(lock);
-+ register int lockval;
-+
-+ __asm__ __volatile__(
-+ " ldcwx 0(0,%2),%0 \n"
-+ : "=r"(lockval), "=m"(*lockword)
-+ : "r"(lockword));
-+ return (lockval == 0);
-+}
-+
-+#endif /* __hppa__ */
-+
-
- #if defined(__s390__) && !defined(__s390x__)
- /*
-@@ -271,7 +294,7 @@
- " tas %1 \n"
- " sne %0 \n"
- : "=d"(rv), "=m"(*lock)
--: "1"(*lock)
-+: "m"(*lock)
- : "cc");
-
- return rv;
-diff -ruN postgresql-7.4.6-orig/src/interfaces/libpq/Makefile postgresql-7.4.6-3/src/interfaces/libpq/Makefile
---- postgresql-7.4.6-orig/src/interfaces/libpq/Makefile 2003-09-27 17:32:48.000000000 +0200
-+++ postgresql-7.4.6-3/src/interfaces/libpq/Makefile 2005-03-09 15:56:11.000000000 +0100
-@@ -35,7 +35,7 @@
- SHLIB_LINK += $(filter -lcrypt -ldes -lkrb -lcom_err -lcrypto -lk5crypto -lkrb5 -lssl -lsocket -lnsl -lresolv -lintl, $(LIBS)) $(THREAD_LIBS)
-
-
--all: all-lib
-+all: all-lib libpq3-config
-
- # Shared library stuff
- include $(top_srcdir)/src/Makefile.shlib
-@@ -61,6 +61,8 @@
- encnames.c wchar.c : % : $(backend_src)/utils/mb/%
- rm -f $@ && $(LN_S) $< .
-
-+libpq3-config:
-+ sed -e "s|%LIBRARIES%|$(SHLIB_LINK)|" <libpq3-config.in | sed "s/-L[^ ]\+ //" >libpq3-config
-
- install: all installdirs install-lib
- $(INSTALL_DATA) $(srcdir)/libpq-fe.h $(DESTDIR)$(includedir)
-@@ -76,3 +78,4 @@
-
- clean distclean maintainer-clean: clean-lib
- rm -f $(OBJS) crypt.c getaddrinfo.c inet_aton.c snprintf.c strerror.c path.c thread.c dllist.c md5.c ip.c encnames.c wchar.c
-+ rm -f libpq3-config
-diff -ruN postgresql-7.4.6-orig/src/interfaces/libpq/libpq3-config.in postgresql-7.4.6-3/src/interfaces/libpq/libpq3-config.in
---- postgresql-7.4.6-orig/src/interfaces/libpq/libpq3-config.in 1970-01-01 01:00:00.000000000 +0100
-+++ postgresql-7.4.6-3/src/interfaces/libpq/libpq3-config.in 2005-03-09 15:56:11.000000000 +0100
-@@ -0,0 +1,3 @@
-+#!/bin/bash
-+
-+echo %LIBRARIES%
-diff -ruN postgresql-7.4.6-orig/src/makefiles/Makefile.linux postgresql-7.4.6-3/src/makefiles/Makefile.linux
---- postgresql-7.4.6-orig/src/makefiles/Makefile.linux 2003-06-05 18:07:25.000000000 +0200
-+++ postgresql-7.4.6-3/src/makefiles/Makefile.linux 2005-03-09 15:56:11.000000000 +0100
-@@ -5,11 +5,7 @@
- allow_nonpic_in_shlib = yes
- DLSUFFIX = .so
-
--ifeq "$(findstring sparc,$(host_cpu))" "sparc"
- CFLAGS_SL = -fPIC
--else
--CFLAGS_SL = -fpic
--endif
-
- %.so: %.o
- $(CC) -shared -o $@ $<
-diff -ruN postgresql-7.4.6-orig/src/pl/plperl/GNUmakefile postgresql-7.4.6-3/src/pl/plperl/GNUmakefile
---- postgresql-7.4.6-orig/src/pl/plperl/GNUmakefile 2004-01-21 20:25:11.000000000 +0100
-+++ postgresql-7.4.6-3/src/pl/plperl/GNUmakefile 2005-03-09 15:56:11.000000000 +0100
-@@ -9,6 +9,9 @@
- shared_libperl = yes
- endif
-
-+# Line addded for Debian - needed for any Linux build, I believe
-+CFLAGS += -D_GNU_SOURCE
-+
- # If we don't have a shared library and the platform doesn't allow it
- # to work without, we have to skip it.
- ifneq (,$(findstring yes, $(shared_libperl)$(allow_nonpic_in_shlib)))
-diff -ruN postgresql-7.4.6-orig/src/test/regress/pg_regress.sh postgresql-7.4.6-3/src/test/regress/pg_regress.sh
---- postgresql-7.4.6-orig/src/test/regress/pg_regress.sh 2003-11-02 22:56:15.000000000 +0100
-+++ postgresql-7.4.6-3/src/test/regress/pg_regress.sh 2005-03-09 15:56:11.000000000 +0100
-@@ -382,6 +382,10 @@
- (exit 2); exit
- fi
-
-+
-+ echo "unix_socket_directory = '/tmp'" >>$PGDATA/postgresql.conf
-+ psql_options="$psql_options --host=/tmp"
-+
-
- # ----------
- # Start postmaster
-diff -ruN postgresql-7.4.6-orig/src/tutorial/Makefile postgresql-7.4.6-3/src/tutorial/Makefile
---- postgresql-7.4.6-orig/src/tutorial/Makefile 2002-09-05 20:28:46.000000000 +0200
-+++ postgresql-7.4.6-3/src/tutorial/Makefile 2005-03-09 15:56:11.000000000 +0100
-@@ -6,15 +6,15 @@
- # IDENTIFICATION
- # $Header$
- #
-+# Please note that this Makefile was modified for Debian to allow
-+# compilation in an arbitrary directory and without the complete
-+# PostgreSQL source tree.
- #-------------------------------------------------------------------------
-
--subdir = src/tutorial
--top_builddir = ../..
--include $(top_builddir)/src/Makefile.global
--
--override CFLAGS+= $(CFLAGS_SL)
--SHLIB_LINK = $(BE_DLLLIBS)
--
-+DLSUFFIX=.so
-+INCLUDES= -I/usr/include/postgresql/ -I/usr/include/postgresql/server/
-+CC= gcc $(INCLUDES)
-+
- #
- # DLOBJS are the dynamically-loaded object files. The "funcs" queries
- # include CREATE FUNCTIONs that load routines from these files.
-@@ -25,6 +25,9 @@
-
- all: $(DLOBJS) $(QUERIES)
-
-+%$(DLSUFFIX): %.c
-+ $(CC) -shared -o $@ $<
-+
- %.sql: %.source
- rm -f $@; \
- C=`pwd`; \
-@@ -32,3 +35,5 @@
-
- clean distclean maintainer-clean:
- rm -f $(DLOBJS) $(QUERIES)
-+
-+.PHONY: clean distclean maintainer-clean
-diff -ruN postgresql-7.4.6-orig/src/tutorial/README postgresql-7.4.6-3/src/tutorial/README
---- postgresql-7.4.6-orig/src/tutorial/README 2001-10-26 22:45:33.000000000 +0200
-+++ postgresql-7.4.6-3/src/tutorial/README 2005-03-09 15:56:11.000000000 +0100
-@@ -2,10 +2,16 @@
- % make
- to compile all the scripts and C files for the user-defined functions
- and types. (make needs to be GNU make --- it may be named something
--different on your system, often gmake)
-+different on your system, often gmake.) The package postgresql-dev
-+must be installed for the tutorials to compile.
-
- Then, run psql with the -s (single-step) flag:
- % psql -s
-
- From within psql, you can try each individual script file by using
- psql's \i <filename> command.
-+
-+Please note that you need database superuser privileges to execute the
-+examples which load dynamic libraries ('funcs' and 'complex') since
-+the language C is usually not 'trusted', i. e. may not be used by
-+normal users.