summaryrefslogtreecommitdiff
path: root/databases/postgresql82
diff options
context:
space:
mode:
authoradam <adam@pkgsrc.org>2006-12-09 15:34:13 +0000
committeradam <adam@pkgsrc.org>2006-12-09 15:34:13 +0000
commit4114b9ec4faafb281204b43ea9bf11c859cd45e4 (patch)
tree23d35fae2cbc526b75353b476806d5fe4a3ec1fb /databases/postgresql82
parentb203a8d567b8304825662f2f72fd8522d284b650 (diff)
downloadpkgsrc-4114b9ec4faafb281204b43ea9bf11c859cd45e4.tar.gz
Changes 8.2.0:
* Query language enhancements including "INSERT/UPDATE/DELETE RETURNING", multirow VALUES lists, and optional target-table alias in "UPDATE"/"DELETE" * Index creation without blocking concurrent "INSERT"/"UPDATE"/"DELETE" operations * Many query optimization improvements, including support for reordering outer joins * Improved sorting performance with lower memory usage * More efficient locking with better concurrency * More efficient vacuuming * Easier administration of warm standby servers * New FILLFACTOR support for tables and indexes * Monitoring, logging, and performance tuning additions * More control over creating and dropping objects * Table inheritance relationships can be defined for and removed from pre-existing tables * "COPY TO" can copy the output of an arbitrary "SELECT" statement * Array improvements, including nulls in arrays * Aggregate-function improvements, including multiple-input aggregates and SQL:2003 statistical functions * Many "contrib/" improvements
Diffstat (limited to 'databases/postgresql82')
-rw-r--r--databases/postgresql82/DESCR9
-rw-r--r--databases/postgresql82/Makefile19
-rw-r--r--databases/postgresql82/Makefile.common175
-rw-r--r--databases/postgresql82/Makefile.mirrors101
-rw-r--r--databases/postgresql82/PLIST2
-rw-r--r--databases/postgresql82/distinfo19
-rw-r--r--databases/postgresql82/files/GNUmakefile.libpq20
-rw-r--r--databases/postgresql82/files/Makefile.custom42
-rw-r--r--databases/postgresql82/files/Makefile.libtool120
-rw-r--r--databases/postgresql82/files/dynloader-ltdl.h17
-rw-r--r--databases/postgresql82/options.mk13
-rw-r--r--databases/postgresql82/patches/patch-aa14
-rw-r--r--databases/postgresql82/patches/patch-ab23
-rw-r--r--databases/postgresql82/patches/patch-ac15
-rw-r--r--databases/postgresql82/patches/patch-ad79
-rw-r--r--databases/postgresql82/patches/patch-ae45
-rw-r--r--databases/postgresql82/patches/patch-af30
-rw-r--r--databases/postgresql82/patches/patch-ag15
-rw-r--r--databases/postgresql82/patches/patch-ah13
-rw-r--r--databases/postgresql82/patches/patch-ai80
-rw-r--r--databases/postgresql82/patches/patch-aj30
-rw-r--r--databases/postgresql82/patches/patch-ak30
-rw-r--r--databases/postgresql82/patches/patch-al29
-rw-r--r--databases/postgresql82/patches/patch-am39
-rw-r--r--databases/postgresql82/patches/patch-an13
25 files changed, 992 insertions, 0 deletions
diff --git a/databases/postgresql82/DESCR b/databases/postgresql82/DESCR
new file mode 100644
index 00000000000..9f6b5b5b0f9
--- /dev/null
+++ b/databases/postgresql82/DESCR
@@ -0,0 +1,9 @@
+PostgreSQL is a robust, next-generation, Object-Relational DBMS (ORDBMS),
+derived from the Berkeley Postgres database management system. While
+PostgreSQL retains the powerful object-relational data model, rich data types
+and easy extensibility of Postgres, it replaces the PostQuel query language
+with an extended subset of SQL.
+
+PostgreSQL is free and the complete source is available.
+
+This is the meta-package for the PostgreSQL database system.
diff --git a/databases/postgresql82/Makefile b/databases/postgresql82/Makefile
new file mode 100644
index 00000000000..2dded510ebe
--- /dev/null
+++ b/databases/postgresql82/Makefile
@@ -0,0 +1,19 @@
+# $NetBSD: Makefile,v 1.1.1.1 2006/12/09 15:34:13 adam Exp $
+
+PKGNAME= postgresql82-${BASE_VERS}
+COMMENT= Robust, next generation, object-relational DBMS
+
+DEPENDS+= postgresql82-client>=${BASE_VERS}:../../databases/postgresql82-client
+DEPENDS+= postgresql82-server>=${BASE_VERS}:../../databases/postgresql82-server
+
+.include "Makefile.common"
+
+EXTRACT_ONLY= # empty
+NO_CHECKSUM= yes
+NO_CONFIGURE= yes
+NO_BUILD= yes
+
+do-install: # empty
+do-patch: # empty
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/databases/postgresql82/Makefile.common b/databases/postgresql82/Makefile.common
new file mode 100644
index 00000000000..158bf5365e1
--- /dev/null
+++ b/databases/postgresql82/Makefile.common
@@ -0,0 +1,175 @@
+# $NetBSD: Makefile.common,v 1.1.1.1 2006/12/09 15:34:13 adam Exp $
+#
+# This Makefile fragment is included by all PostgreSQL packages built from
+# the main sources of the PostgreSQL distribution except jdbc-postgresql.
+#
+# The PostgreSQL package naming scheme, aside from the obvious piecewise
+# packages, is as follows:
+#
+# <lang>-postgresql client-side interface to PostgreSQL
+# postgresql-<lang> server-side module for PostgreSQL backend
+
+.include "../../databases/postgresql82/Makefile.mirrors"
+
+DISTNAME?= postgresql-${DIST_VERS}
+CATEGORIES+= databases
+MASTER_SITES?= ${PGSQL_MIRRORS:=source/v${DIST_VERS}/}
+EXTRACT_SUFX= .tar.bz2
+
+MAINTAINER?= adam@NetBSD.org
+HOMEPAGE?= http://www.postgresql.org/
+
+CONFLICTS+= postgresql-[0-9]*
+CONFLICTS+= postgresql73-[0-9]*
+CONFLICTS+= postgresql74-[0-9]*
+CONFLICTS+= postgresql80-[0-9]*
+CONFLICTS+= postgresql81-[0-9]*
+
+DISTINFO_FILE?= ${.CURDIR}/../postgresql82/distinfo
+COMMON_FILESDIR?= ${.CURDIR}/../postgresql82/files
+PATCHDIR?= ${.CURDIR}/../postgresql82/patches
+
+# Version numbering scheme:
+#
+# DIST_VERS version number on the postgresql distfile
+# BASE_VERS pkgsrc-mangled version number (convert pl -> .)
+#
+# Note: Do not forget jdbc-postgresql82 when updating version
+#
+DIST_VERS?= 8.2.0
+BASE_VERS?= ${DIST_VERS}
+
+BUILDLINK_API_DEPENDS.postgresql82-client+= postgresql82-client>=${BASE_VERS}
+
+GNU_CONFIGURE= yes
+USE_TOOLS+= bison gmake lex msgfmt
+PKG_SYSCONFSUBDIR= postgresql
+
+# in 7.4.x/8.0.x, this is done by autoconf stuff which has leading whitespace
+USE_PKGLOCALEDIR= yes
+SUBST_CLASSES+= pglocale
+SUBST_FILES.pglocale= configure config/programs.m4
+SUBST_STAGE.pglocale= pre-configure
+SUBST_SED.pglocale= -e 's|\( localedir[ :]*=\).*|\1${PG_LOCALE_DIR}|'
+
+.include "../../mk/bsd.prefs.mk"
+
+PGSQL_TEMPLATE.SunOS= solaris
+PGSQL_TEMPLATE.IRIX= irix5
+.if !defined(PGSQL_TEMPLATE.${OPSYS})
+PGSQL_TEMPLATE.${OPSYS}= ${LOWER_OPSYS}
+.endif
+
+PG_SUBPREFIX= # empty
+.if empty(PG_SUBPREFIX)
+PG_PREFIX= ${PREFIX}
+PLIST_SUBST+= PG_SUBPREFIX=
+.else
+PG_PREFIX= ${PREFIX}/${PG_SUBPREFIX}
+BUILD_DEFS+= PG_SUBPREFIX
+PLIST_SUBST+= PG_SUBPREFIX=${PG_SUBPREFIX}/
+BUILDLINK_PASSTHRU_DIRS+= ${PG_PREFIX}
+.endif
+PG_DATA_DIR= ${PG_PREFIX}/share/postgresql
+PG_DOC_DIR= ${PG_PREFIX}/share/doc/postgresql
+PG_LOCALE_DIR= ${PG_PREFIX}/${PKGLOCALEDIR}/locale
+PG_ETC_DIR= ${PKG_SYSCONFDIR:S/^${PREFIX}\//${PG_PREFIX}\//}
+
+GNU_CONFIGURE_PREFIX= ${PG_PREFIX}
+CONFIGURE_ARGS+= --sysconfdir=${PG_ETC_DIR}
+CONFIGURE_ARGS+= --datadir=${PG_DATA_DIR}
+CONFIGURE_ARGS+= --with-docdir=${PG_DOC_DIR}
+CONFIGURE_ARGS+= --with-template=${PGSQL_TEMPLATE.${OPSYS}}
+CONFIGURE_ARGS+= --without-readline
+CONFIGURE_ARGS+= --without-zlib
+CONFIGURE_ARGS+= --enable-nls
+
+CONFIGURE_ARGS+= --without-java
+CONFIGURE_ARGS+= --without-perl
+CONFIGURE_ARGS+= --without-python
+CONFIGURE_ARGS+= --without-tcl
+
+# Enable Rendezvous on Mac OS X
+.if ${OPSYS} == "Darwin"
+CONFIGURE_ARGS+= --with-rendezvous
+.endif
+
+# PostgreSQL explicitly forbids any use of -ffast-math
+BUILDLINK_TRANSFORM+= rm:-ffast-math
+
+# USE_LIBLTDL is "yes" or "no" depending on whether we're using libltdl
+# to provide "dlopen" functionality for the PostgreSQL backend.
+#
+.if ${OPSYS} == "Interix"
+USE_LIBLTDL?= yes
+.endif
+USE_LIBLTDL?= no
+
+FILES_SUBST+= PG_PREFIX=${PG_PREFIX:Q}
+
+.include "../../devel/gettext-lib/buildlink3.mk"
+
+post-extract:
+ if ${TEST} -d ${WRKSRC}/src; then \
+ rm -f ${WRKSRC}/src/Makefile.custom; \
+ cp -f ${COMMON_FILESDIR}/Makefile.custom \
+ ${WRKSRC}/src/Makefile.custom; \
+ rm -f ${WRKSRC}/src/Makefile.shlib; \
+ cp -f ${COMMON_FILESDIR}/Makefile.libtool \
+ ${WRKSRC}/src/Makefile.shlib; \
+ fi
+ if ${TEST} -d ${WRKSRC}/src/interfaces/libpq; then \
+ rm -f ${WRKSRC}/src/interfaces/libpq/GNUmakefile; \
+ cp -f ${COMMON_FILESDIR}/GNUmakefile.libpq \
+ ${WRKSRC}/src/interfaces/libpq/GNUmakefile; \
+ fi
+ if ${TEST} -d ${WRKSRC}/src/interfaces/libpgtcl; then \
+ rm -f ${WRKSRC}/src/interfaces/libpgtcl/GNUmakefile; \
+ cp -f ${COMMON_FILESDIR}/GNUmakefile.libpgtcl \
+ ${WRKSRC}/src/interfaces/libpgtcl/GNUmakefile; \
+ fi
+.if !empty(USE_LIBLTDL:M[yY][eE][sS])
+ if ${TEST} -d ${WRKSRC}/src/backend/port/dynloader; then \
+ template=${PGSQL_TEMPLATE.${OPSYS}:Q}; \
+ rm -f ${WRKSRC}/src/backend/port/dynloader/$$template.[ch]; \
+ cp -f ${COMMON_FILESDIR}/dynloader-ltdl.h \
+ ${WRKSRC}/src/backend/port/dynloader/$$template.h; \
+ ${ECHO} "static int dummy = 0;" \
+ >${WRKSRC}/src/backend/port/dynloader/$$template.c
+ fi
+.endif
+ if ${TEST} -d ${WRKSRC}/src/template; then \
+ touch ${WRKSRC}/src/template/dragonfly; \
+ fi
+ if ${TEST} -d ${WRKSRC}/src/backend/port/dynloader; then \
+ cp ${WRKSRC}/src/backend/port/dynloader/freebsd.c \
+ ${WRKSRC}/src/backend/port/dynloader/dragonfly.c; \
+ cp ${WRKSRC}/src/backend/port/dynloader/freebsd.h \
+ ${WRKSRC}/src/backend/port/dynloader/dragonfly.h; \
+ fi
+ if ${TEST} -d ${WRKSRC}/src/include/port; then \
+ cp ${WRKSRC}/src/include/port/freebsd.h \
+ ${WRKSRC}/src/include/port/dragonfly.h; \
+ fi
+ if ${TEST} -d ${WRKSRC}/src/makefiles; then \
+ cp ${WRKSRC}/src/makefiles/Makefile.freebsd \
+ ${WRKSRC}/src/makefiles/Makefile.dragonfly; \
+ fi
+
+# PGSQL_BLCKSZ is the size in bytes of a PostgreSQL disk page or block.
+# This also limits the size of a tuple. The valid values are powers
+# of 2 up to 32768, and the default size is 8196 (hardcoded in the
+# PostgreSQL sources). Please don't change this value unless you know
+# what you are doing.
+#
+BUILD_DEFS+= PGSQL_BLCKSZ
+
+.if defined(PGSQL_BLCKSZ)
+.PHONY: pgsql-blcksz
+pre-configure: pgsql-blcksz
+pgsql-blcksz:
+ for file in ${WRKSRC}/src/include/pg_config_manual.h; do \
+ ${SED} -e "/^#define[ ]*BLCKSZ[ ]*/s/^\(#define[ ]*BLCKSZ\).*/\1 ${PGSQL_BLCKSZ}/" $$file > $$file.new; \
+ ${MV} -f $$file.new $$file; \
+ done
+.endif
diff --git a/databases/postgresql82/Makefile.mirrors b/databases/postgresql82/Makefile.mirrors
new file mode 100644
index 00000000000..19f9ac892cc
--- /dev/null
+++ b/databases/postgresql82/Makefile.mirrors
@@ -0,0 +1,101 @@
+# $NetBSD: Makefile.mirrors,v 1.1.1.1 2006/12/09 15:34:13 adam Exp $
+#
+# This Makefile fragment contains the mirror sites for fetching PostgreSQL.
+#
+# To fetch from the nearest mirror, you may need to set
+# PGSQL_MIRRORS_SORT appropriately, e.g.:
+#
+# PGSQL_MIRRORS_SORT= .at .de
+#
+
+###
+### This list was last updated on 20050801.
+###
+PGSQL_MIRRORS= \
+ ftp://ftp.au.postgresql.org/pub/postgresql/ \
+ ftp://ftp2.au.postgresql.org/pub/postgresql/ \
+ ftp://ftp.at.postgresql.org/db/www.postgresql.org/pub/ \
+ ftp://ftp.be.postgresql.org/postgresql/ \
+ ftp://ftp.ba.postgresql.org/pub/postgresql/ \
+ ftp://ftp.br.postgresql.org/pub/PostgreSQL/ \
+ ftp://ftp3.bg.postgresql.org/postgresql/ \
+ ftp://ftp3.ca.postgresql.org/pub/ \
+ ftp://ftp4.ca.postgresql.org/pub/postgresql/ \
+ ftp://ftp.cl.postgresql.org/ftp/pub/postgresql/ \
+ ftp://ftp.cn.postgresql.org/ftp.postgresql.org/ \
+ ftp://ftp.co.postgresql.org/pub/mirrors/postgresql/ \
+ ftp://ftp2.cr.postgresql.org/pub/Unix/postgres/ \
+ ftp://ftp.hr.postgresql.org/postgresql/ \
+ ftp://ftp.cz.postgresql.org/pub/ftp.postgresql.org/ \
+ ftp://ftp2.cz.postgresql.org/pub/postgresql/ \
+ ftp://ftp.dk.postgresql.org/postgresql/ \
+ ftp://ftp.ee.postgresql.org/mirrors/postgresql/ \
+ ftp://ftp.fr.postgresql.org/ \
+ ftp://ftp2.fr.postgresql.org/postgresql/ \
+ ftp://ftp3.fr.postgresql.org/pub/postgresql/ \
+ ftp://ftp.de.postgresql.org/mirror/postgresql/ \
+ ftp://ftp2.de.postgresql.org/pub/postgresql/ \
+ ftp://ftp3.de.postgresql.org/pub/Mirrors/ftp.postgresql.org/ \
+ ftp://ftp7.de.postgresql.org/pub/ftp.postgresql.org/ \
+ ftp://ftp8.de.postgresql.org/pub/misc/pgsql/ \
+ ftp://ftp.gr.postgresql.org/pub/databases/postgresql/ \
+ ftp://ftp2.gr.postgresql.org/pub/databases/postgresql/ \
+ ftp://ftp.hk.postgresql.org/postgresql/ \
+ ftp://ftp3.hu.postgresql.org/pub/postgresql/ \
+ ftp://ftp7.id.postgresql.org/pub/postgresql/ \
+ ftp://ftp8.id.postgresql.org/pub/PostgreSQL/ \
+ ftp://ftp.ie.postgresql.org/mirrors/ftp.postgresql.org/pub/ \
+ ftp://ftp2.ie.postgresql.org/mirrors/ftp.postgresql.org/ \
+ ftp://ftp.il.postgresql.org/ftp.postgresql.org/ \
+ ftp://ftp2.it.postgresql.org/mirrors/postgres/ \
+ ftp://ftp6.it.postgresql.org/pub/PostgreSQL/ \
+ ftp://ftp7.it.postgresql.org/pub/unix/postgres/ \
+ ftp://ftp.jp.postgresql.org/ \
+ ftp://ftp2.jp.postgresql.org/pub/postgresql/ \
+ ftp://ftp.kr.postgresql.org/postgresql/ \
+ ftp://ftp.lv.postgresql.org/pub/software/postgresql/ \
+ ftp://ftp.eu.postgresql.org/pub/unix/db/postgresql/ \
+ ftp://ftp.nl.postgresql.org:21/pub/mirror/postgresql/ \
+ ftp://ftp2.nl.postgresql.org/mirror/postgresql/ \
+ ftp://ftp4.nl.postgresql.org/postgresql.zeelandnet.nl/ \
+ ftp://ftp.nz.postgresql.org/postgresql/ \
+ ftp://ftp.no.postgresql.org/pub/databases/postgresql/ \
+ ftp://ftp6.pl.postgresql.org/pub/postgresql/ \
+ ftp://ftp7.pl.postgresql.org/pub/mirror/ftp.postgresql.org/ \
+ ftp://ftp8.pl.postgresql.org/pub/postgresql/ \
+ ftp://ftp.pt.postgresql.org/postgresql/ \
+ ftp://ftp.pr.postgresql.org/pub/Mirrors/postgresql/ \
+ ftp://ftp6.ro.postgresql.org/pub/mirrors/ftp.postgresql.org/ \
+ ftp://ftp.ru.postgresql.org/pub/mirrors/pgsql/ \
+ ftp://ftp2.ru.postgresql.org/pub/databases/postgresql/ \
+ ftp://ftp3.ru.postgresql.org/pub/mirror/postgresql/pub/ \
+ ftp://ftp7.ru.postgresql.org/pub/mirror/postgresql/ \
+ ftp://ftp2.sk.postgresql.org/pub/postgresql/ \
+ ftp://ftp5.es.postgresql.org/mirror/postgresql/ \
+ ftp://ftp.se.postgresql.org/pub/databases/relational/postgresql/ \
+ ftp://ftp2.ch.postgresql.org/pub/postgresql/ \
+ ftp://ftp.tw.postgresql.org/pub/postgresql/ \
+ ftp://ftp3.tw.postgresql.org/pub/Unix/Database/postgresql/ \
+ ftp://ftp5.tw.postgresql.org/pub/Unix/Database/PostgreSQL/ \
+ ftp://ftp6.tr.postgresql.org/postgresql/ \
+ ftp://ftp2.uk.postgresql.org/sites/ftp.postgresql.org/ \
+ ftp://ftp4.uk.postgresql.org/sites/ftp.postgresql.org/ \
+ ftp://ftp8.uk.postgresql.org/sites/ftp.postgresql.org/ \
+ ftp://ftp.us.postgresql.org/pub/mirrors/postgresql/ \
+ ftp://ftp3.us.postgresql.org/pub/postgresql/ \
+ ftp://ftp5.us.postgresql.org/pub/PostgreSQL/ \
+ ftp://ftp8.us.postgresql.org/postgresql/ \
+ ftp://ftp9.us.postgresql.org/pub/mirrors/postgresql/ \
+ ftp://ftp10.us.postgresql.org/pub/postgresql/ \
+ ftp://ftp22.us.postgresql.org/mirrors/ftp.postgresql.org/ \
+ ftp://ftp24.us.postgresql.org/postgresql/
+
+# Default to fetching from a .us mirror for the sake of the main NetBSD
+# ftp server.
+#
+PGSQL_MIRRORS_SORT?= .us
+
+# Craft a MASTER_SORT_REGEX that understands the location of the country
+# code in the FTP server name for the PostgreSQL mirror sites.
+#
+MASTER_SORT_REGEX+= ${PGSQL_MIRRORS_SORT:S/./\\./g:C/.*/:\/\/[^[\/]*&\/ :\/\/[^\/]*&\\./}
diff --git a/databases/postgresql82/PLIST b/databases/postgresql82/PLIST
new file mode 100644
index 00000000000..20b389c4bc1
--- /dev/null
+++ b/databases/postgresql82/PLIST
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2006/12/09 15:34:13 adam Exp $
+@comment this plist intentionally left empty
diff --git a/databases/postgresql82/distinfo b/databases/postgresql82/distinfo
new file mode 100644
index 00000000000..6ded177f358
--- /dev/null
+++ b/databases/postgresql82/distinfo
@@ -0,0 +1,19 @@
+$NetBSD: distinfo,v 1.1.1.1 2006/12/09 15:34:13 adam Exp $
+
+SHA1 (postgresql-8.2.0.tar.bz2) = 377034c155ebc6a063a1d54069d1a56da4d11f93
+RMD160 (postgresql-8.2.0.tar.bz2) = 2627ffd2ec46ba85fa0edc339fdeaf9359121a9b
+Size (postgresql-8.2.0.tar.bz2) = 12459207 bytes
+SHA1 (patch-aa) = a7112ce2e9fc28f638afcf2e196d3cdc0f4c254d
+SHA1 (patch-ab) = c602b4c381c730368c19fb5ab765c69c7b5573bb
+SHA1 (patch-ac) = cbd302a60d43171854c37171b57ee7bbf1194ad9
+SHA1 (patch-ad) = ce322ef8b279e1e25b4ed018ab975a25e82a69a1
+SHA1 (patch-ae) = 8b3e47320dfe05d94b769c9b079fd7ca6d26f5d6
+SHA1 (patch-af) = 89cb9318946cb7c34ad79dbae107ce66bd1c5022
+SHA1 (patch-ag) = 402d5d211af99efdfa35677299c97e91e14ed85d
+SHA1 (patch-ah) = 3640573195f66a46c37d9fca2648d6be39f5593b
+SHA1 (patch-ai) = 6f7f5c1182ded751650e0ae7858c5784dfa96987
+SHA1 (patch-aj) = 0ffb4c0aa8a32a61cd753d0e7cf67fdc5ae94195
+SHA1 (patch-ak) = 3009e020dc5f9397846dd3339c2bdd15269bb332
+SHA1 (patch-al) = 32818ae8de92ef66d839d4891f4f686db732f7b6
+SHA1 (patch-am) = 507252fc50ce59e1d6f596367f12338a8892bfd2
+SHA1 (patch-an) = ca4caddde9ea68e4f8648f5abf9369e407874702
diff --git a/databases/postgresql82/files/GNUmakefile.libpq b/databases/postgresql82/files/GNUmakefile.libpq
new file mode 100644
index 00000000000..e9496d173dd
--- /dev/null
+++ b/databases/postgresql82/files/GNUmakefile.libpq
@@ -0,0 +1,20 @@
+# $NetBSD: GNUmakefile.libpq,v 1.1.1.1 2006/12/09 15:34:13 adam Exp $
+#
+# This GNUmakefile overrides the `all' target of $(libpq_srcdir)/Makefile
+# to be empty if INSTALLED_LIBPQ is defined. This handles the submake
+# targets sprinkled throughout the PostgreSQL Makefiles that execute
+#
+# @$(MAKE) -C $(libpq_builddir) all
+#
+# to ensure that the libpq libraries are built first. If INSTALLED_LIBPQ
+# is defined, then have the `all' target simple return success.
+
+ifdef INSTALLED_LIBPQ
+all:
+ @test -f libpq.a || touch libpq.a
+endif
+
+%: force
+ @$(MAKE) -f Makefile $@
+
+force: ;
diff --git a/databases/postgresql82/files/Makefile.custom b/databases/postgresql82/files/Makefile.custom
new file mode 100644
index 00000000000..8940a095016
--- /dev/null
+++ b/databases/postgresql82/files/Makefile.custom
@@ -0,0 +1,42 @@
+# $NetBSD: Makefile.custom,v 1.1.1.1 2006/12/09 15:34:13 adam Exp $
+#
+# This file is included at the end of Makefile.global, which is included
+# by every sub-Makefile in the build tree. Makefiles for shared
+# libraries include Makefile.global then Makefile.shlib.
+#
+
+# Override any OS-specific locations for where to put SQL man pages.
+sqlmansect = 7
+
+# Override installation paths to avoid logic in Makefile.global.
+includedir = $(prefix)/include
+libdir = $(exec_prefix)/lib
+pkglibdir = $(libdir)/postgresql
+pkgincludedir = $(includedir)/postgresql
+
+# INSTALLED_LIBPQ is passed in from the environment and tells the build
+# system how to link to an installed libpq.*.
+#
+ifdef INSTALLED_LIBPQ
+libpq = -lpq
+else
+ifdef LIBTOOL
+libpq = $(libpq_builddir)/libpq.la
+endif
+ifdef PGFILEDESC
+libpq = -L$(libpq_builddir)/.libs -lpq
+endif
+endif
+
+# In pkgsrc, libpython is always present as a shared library.
+shared_libpython = yes
+
+# $(libpq_builddir)/libpq.a is used in several places as a dependency,
+# but if we're building with libtool, then we don't actually want to
+# create that file since it will mess up the re-linking process.
+# Declare it to be phony to prevent GNU make from thinking it's a
+# target.
+#
+ifdef LIBTOOL
+.PHONY: $(libpq_builddir)/libpq.a
+endif
diff --git a/databases/postgresql82/files/Makefile.libtool b/databases/postgresql82/files/Makefile.libtool
new file mode 100644
index 00000000000..32490195a5a
--- /dev/null
+++ b/databases/postgresql82/files/Makefile.libtool
@@ -0,0 +1,120 @@
+#-------------------------------------------------------------------------
+#
+# Makefile.libtool
+# Common rules for buildling libtool archives
+#
+# IDENTIFICATION
+# $NetBSD: Makefile.libtool,v 1.1.1.1 2006/12/09 15:34:13 adam Exp $
+#
+#-------------------------------------------------------------------------
+
+##
+## Hacks/workarounds for makefiles in certain directories
+##
+
+# The following directories are building loadable shared modules, not
+# shared libraries.
+#
+ifneq (,$(findstring src/backend/utils/mb/conversion_procs/,$(subdir)))
+shmodule = yes
+else
+ifneq (,$(findstring src/pl/,$(subdir)))
+shmodule = yes
+else
+shmodule = no
+endif
+endif
+
+# Fix dependencies in some makefiles that assume the target matches
+# %.o so that when built for libtool, the target matches the corresponding
+# %.lo.
+#
+ifeq ($(subdir), src/interfaces/ecpg/ecpglib)
+path.lo: path.c $(top_builddir)/src/port/pg_config_paths.h
+endif
+
+ifeq ($(subdir), src/interfaces/libpq)
+fe-connect.lo: fe-connect.c $(top_builddir)/src/port/pg_config_paths.h
+endif
+
+ifeq ($(subdir), src/pl/plpgsql/src)
+pl_gram.lo pl_handler.lo pl_comp.lo pl_exec.lo pl_funcs.lo: plpgsql.h $(srcdir)/pl.tab.h
+pl_gram.lo: $(srcdir)/pl_scan.c
+endif
+
+
+##
+## VARIABLE DEFINITIONS
+##
+
+# Loadable shared modules are named differently from shared libraries
+# and are installed into $(pkglibdir).
+#
+ifeq ($(shmodule),yes)
+ltlib = $(NAME)$(DLSUFFIX)
+ltmodule = -module
+rpathdir = $(pkglibdir)
+else
+ltlib = lib$(NAME)$(DLSUFFIX)
+ltmodule =
+endif
+
+DLSUFFIX = .la
+
+LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS)
+LTLINK = $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(ltmodule) -rpath $(rpathdir) -version-info $(SO_MAJOR_VERSION):$(SO_MINOR_VERSION)
+LTOBJS = $(OBJS:%.o=%.lo)
+
+# Define INSTALL_SHLIB and shlib for the benefit of Makefiles for
+# loadable modules that have their own target for installing the
+# module.
+#
+INSTALL_LTLIB = $(LIBTOOL) --mode=install $(INSTALL)
+INSTALL_STLIB = $(INSTALL_LTLIB)
+INSTALL_SHLIB = $(INSTALL_LTLIB)
+shlib = $(ltlib)
+
+%.lo : %.c
+ $(LTCOMPILE) -c $< -o $@
+
+
+##
+## BUILD
+##
+
+.PHONY: all-lib all-static-lib all-shared-lib all-la-lib
+all-lib all-static-lib all-shared-lib: all-la-lib
+
+all-la-lib: $(ltlib)
+
+$(ltlib): $(LTOBJS)
+ $(LTLINK) -o $@ $(LTOBJS) $(SHLIB_LINK)
+
+
+##
+## INSTALL
+##
+
+.PHONY: install-lib install-lib-static install-lib-shared install-lib-la
+install-lib install-static-lib install-shared-lib: install-lib-la
+
+install-lib-la: $(ltlib)
+ $(INSTALL_LTLIB) $< $(DESTDIR)$(libdir)/$(ltlib)
+
+
+##
+## UNINSTALL
+##
+
+.PHONY: uninstall-lib
+uninstall-lib:
+ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(ltlib)
+
+
+##
+## CLEAN
+##
+
+.PHONY: clean-lib
+clean-lib:
+ $(LIBTOOL) --mode=clean rm -f $(ltlib) $(LTOBJS)
diff --git a/databases/postgresql82/files/dynloader-ltdl.h b/databases/postgresql82/files/dynloader-ltdl.h
new file mode 100644
index 00000000000..807552db4af
--- /dev/null
+++ b/databases/postgresql82/files/dynloader-ltdl.h
@@ -0,0 +1,17 @@
+/* $NetBSD: dynloader-ltdl.h,v 1.1.1.1 2006/12/09 15:34:13 adam Exp $ */
+
+/*
+ * dynamic loader based on libltdl
+ */
+#ifndef PORT_PROTOS_H
+#define PORT_PROTOS_H
+
+#include <ltdl.h>
+#include "utils/dynamic_loader.h"
+
+#define pg_dlopen(a) ((void *)lt_dlopen(a))
+#define pg_dlsym(a,b) lt_dlsym((lt_dlhandle)(a), (b))
+#define pg_dlclose(a) lt_dlclose((lt_dlhandle)(a))
+#define pg_dlerror lt_dlerror
+
+#endif /* PORT_PROTOS_H */
diff --git a/databases/postgresql82/options.mk b/databases/postgresql82/options.mk
new file mode 100644
index 00000000000..d540b779953
--- /dev/null
+++ b/databases/postgresql82/options.mk
@@ -0,0 +1,13 @@
+# $NetBSD: options.mk,v 1.1.1.1 2006/12/09 15:34:13 adam Exp $
+
+PKG_SUPPORTED_OPTIONS+= # empty
+
+.include "../../mk/bsd.options.mk"
+
+###
+### PAM authentication for the PostgreSQL backend.
+###
+.if !empty(PKG_OPTIONS:Mpam)
+. include "../../mk/pam.buildlink3.mk"
+CONFIGURE_ARGS+= --with-pam
+.endif
diff --git a/databases/postgresql82/patches/patch-aa b/databases/postgresql82/patches/patch-aa
new file mode 100644
index 00000000000..f50877d2737
--- /dev/null
+++ b/databases/postgresql82/patches/patch-aa
@@ -0,0 +1,14 @@
+$NetBSD: patch-aa,v 1.1.1.1 2006/12/09 15:34:13 adam Exp $
+
+--- config/perl.m4.orig 2003-11-30 04:51:17.000000000 +0900
++++ config/perl.m4
+@@ -28,8 +28,6 @@ AC_DEFUN([PGAC_CHECK_PERL_CONFIGS],
+ AC_DEFUN([PGAC_CHECK_PERL_EMBED_LDFLAGS],
+ [AC_REQUIRE([PGAC_PATH_PERL])
+ AC_MSG_CHECKING(for flags to link embedded Perl)
+-pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
+-pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
+-perl_embed_ldflags=`echo X"$pgac_tmp1" | sed "s/^X//;s%$pgac_tmp2%%"`
++perl_embed_ldflags=`$PERL -MExtUtils::Embed -e ldopts`
+ AC_SUBST(perl_embed_ldflags)dnl
+ AC_MSG_RESULT([$perl_embed_ldflags])])
diff --git a/databases/postgresql82/patches/patch-ab b/databases/postgresql82/patches/patch-ab
new file mode 100644
index 00000000000..4b781eab3cc
--- /dev/null
+++ b/databases/postgresql82/patches/patch-ab
@@ -0,0 +1,23 @@
+$NetBSD: patch-ab,v 1.1.1.1 2006/12/09 15:34:13 adam Exp $
+
+--- configure.orig 2006-12-02 09:36:39.000000000 +0100
++++ configure
+@@ -1504,6 +1504,7 @@ case $host_os in
+ darwin*) template=darwin ;;
+ dgux*) template=dgux ;;
+ freebsd*) template=freebsd ;;
++ dragonfly*) template=dragonfly ;;
+ hpux*) template=hpux ;;
+ irix*) template=irix ;;
+ linux*|gnu*|k*bsd*-gnu)
+@@ -4899,9 +4900,7 @@ echo "${ECHO_T}$perl_useshrplib" >&6
+
+ echo "$as_me:$LINENO: checking for flags to link embedded Perl" >&5
+ echo $ECHO_N "checking for flags to link embedded Perl... $ECHO_C" >&6
+-pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
+-pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
+-perl_embed_ldflags=`echo X"$pgac_tmp1" | sed "s/^X//;s%$pgac_tmp2%%"`
++perl_embed_ldflags=`$PERL -MExtUtils::Embed -e ldopts`
+ echo "$as_me:$LINENO: result: $perl_embed_ldflags" >&5
+ echo "${ECHO_T}$perl_embed_ldflags" >&6
+ fi
diff --git a/databases/postgresql82/patches/patch-ac b/databases/postgresql82/patches/patch-ac
new file mode 100644
index 00000000000..e64abac7451
--- /dev/null
+++ b/databases/postgresql82/patches/patch-ac
@@ -0,0 +1,15 @@
+$NetBSD: patch-ac,v 1.1.1.1 2006/12/09 15:34:13 adam Exp $
+
+--- src/backend/Makefile.orig 2005-10-28 05:45:29.000000000 +0900
++++ src/backend/Makefile
+@@ -13,6 +13,10 @@ subdir = src/backend
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
+
++CFLAGS+= $(DL_CFLAGS)
++LDFLAGS+= $(DL_LDFLAGS)
++LIBS+= $(DL_LIBS)
++
+ DIRS := access bootstrap catalog parser commands executor lib libpq \
+ main nodes optimizer port postmaster regex rewrite \
+ storage tcop utils $(top_builddir)/src/timezone
diff --git a/databases/postgresql82/patches/patch-ad b/databases/postgresql82/patches/patch-ad
new file mode 100644
index 00000000000..f44ecac0695
--- /dev/null
+++ b/databases/postgresql82/patches/patch-ad
@@ -0,0 +1,79 @@
+$NetBSD: patch-ad,v 1.1.1.1 2006/12/09 15:34:13 adam Exp $
+
+--- src/backend/port/dynloader/netbsd.c.orig 2006-03-11 05:38:31.000000000 +0100
++++ src/backend/port/dynloader/netbsd.c
+@@ -46,65 +46,30 @@ static char sccsid[] = "@(#)dl.c 5.4 (Be
+
+ #include "dynloader.h"
+
+-static char error_message[BUFSIZ];
++#ifndef HAVE_DLOPEN
+
+ char *
+-BSD44_derived_dlerror(void)
++pg_dlerror(void)
+ {
+- static char ret[BUFSIZ];
+-
+- strcpy(ret, error_message);
+- error_message[0] = 0;
+- return (ret[0] == 0) ? NULL : ret;
++ return "dynaloader unsupported";
+ }
+
+ void *
+-BSD44_derived_dlopen(const char *file, int num)
++pg_dlopen(const char *file, int num)
+ {
+-#if defined(__mips__)
+- snprintf(error_message, sizeof(error_message),
+- "dlopen (%s) not supported", file);
++ elog(ERROR, "dynamic load not supported");
+ return NULL;
+-#else
+- void *vp;
+-
+- if ((vp = dlopen((char *) file, num)) == NULL)
+- snprintf(error_message, sizeof(error_message),
+- "dlopen (%s) failed: %s", file, dlerror());
+- return vp;
+-#endif
+ }
+
+ void *
+-BSD44_derived_dlsym(void *handle, const char *name)
++pg_dlsym(void *handle, const char *name)
+ {
+-#if defined(__mips__)
+- snprintf(error_message, sizeof(error_message),
+- "dlsym (%s) failed", name);
+ return NULL;
+-#elif defined(__ELF__)
+- return dlsym(handle, name);
+-#else
+- void *vp;
+- char buf[BUFSIZ];
+-
+- if (*name != '_')
+- {
+- snprintf(buf, sizeof(buf), "_%s", name);
+- name = buf;
+- }
+- if ((vp = dlsym(handle, (char *) name)) == NULL)
+- snprintf(error_message, sizeof(error_message),
+- "dlsym (%s) failed", name);
+- return vp;
+-#endif
+ }
+
+ void
+-BSD44_derived_dlclose(void *handle)
++pg_dlclose(void *handle)
+ {
+-#if defined(__mips__)
+-#else
+- dlclose(handle);
+-#endif
+ }
++
++#endif /* ! HAVE_DLOPEN */
diff --git a/databases/postgresql82/patches/patch-ae b/databases/postgresql82/patches/patch-ae
new file mode 100644
index 00000000000..5c0bb2f65d4
--- /dev/null
+++ b/databases/postgresql82/patches/patch-ae
@@ -0,0 +1,45 @@
+$NetBSD: patch-ae,v 1.1.1.1 2006/12/09 15:34:13 adam Exp $
+
+--- src/backend/port/dynloader/netbsd.h.orig 2005-01-01 07:00:32.000000000 +0900
++++ src/backend/port/dynloader/netbsd.h
+@@ -21,19 +21,7 @@
+
+ #include "utils/dynamic_loader.h"
+
+-/*
+- * Dynamic Loader on NetBSD 1.0.
+- *
+- * this dynamic loader uses the system dynamic loading interface for shared
+- * libraries (ie. dlopen/dlsym/dlclose). The user must specify a shared
+- * library as the file to be dynamically loaded.
+- *
+- * agc - I know this is all a bit crufty, but it does work, is fairly
+- * portable, and works (the stipulation that the d.l. function must
+- * begin with an underscore is fairly tricky, and some versions of
+- * NetBSD (like 1.0, and 1.0A pre June 1995) have no dlerror.)
+- */
+-
++#ifdef HAVE_DLOPEN
+ /*
+ * In some older systems, the RTLD_NOW flag isn't defined and the mode
+ * argument to dlopen must always be 1. The RTLD_GLOBAL flag is wanted
+@@ -47,14 +35,11 @@
+ #define RTLD_GLOBAL 0
+ #endif
+
+-#define pg_dlopen(f) BSD44_derived_dlopen((f), RTLD_NOW | RTLD_GLOBAL)
+-#define pg_dlsym BSD44_derived_dlsym
+-#define pg_dlclose BSD44_derived_dlclose
+-#define pg_dlerror BSD44_derived_dlerror
++#define pg_dlopen(f) dlopen((f), RTLD_NOW | RTLD_GLOBAL)
++#define pg_dlsym dlsym
++#define pg_dlclose dlclose
++#define pg_dlerror dlerror
+
+-char *BSD44_derived_dlerror(void);
+-void *BSD44_derived_dlopen(const char *filename, int num);
+-void *BSD44_derived_dlsym(void *handle, const char *name);
+-void BSD44_derived_dlclose(void *handle);
++#endif /* HAVE_DLOPEN */
+
+ #endif /* PORT_PROTOS_H */
diff --git a/databases/postgresql82/patches/patch-af b/databases/postgresql82/patches/patch-af
new file mode 100644
index 00000000000..7a40cc9c0ee
--- /dev/null
+++ b/databases/postgresql82/patches/patch-af
@@ -0,0 +1,30 @@
+$NetBSD: patch-af,v 1.1.1.1 2006/12/09 15:34:13 adam Exp $
+
+--- src/timezone/localtime.c.orig 2005-10-15 11:49:51.000000000 +0900
++++ src/timezone/localtime.c
+@@ -77,18 +77,18 @@ struct rule
+
+ static long detzcode(const char *codep);
+ static const char *getzname(const char *strp);
+-static const char *getnum(const char *strp, int *nump, int min, int max);
++static const char *getnum(const char *strp, int *nump, const int min, const int max);
+ static const char *getsecs(const char *strp, long *secsp);
+ static const char *getoffset(const char *strp, long *offsetp);
+ static const char *getrule(const char *strp, struct rule * rulep);
+ static void gmtload(struct state * sp);
+-static void gmtsub(const pg_time_t *timep, long offset, struct pg_tm * tmp);
+-static void localsub(const pg_time_t *timep, long offset, struct pg_tm * tmp, const pg_tz *tz);
+-static void timesub(const pg_time_t *timep, long offset,
++static void gmtsub(const pg_time_t *timep, const long offset, struct pg_tm * tmp);
++static void localsub(const pg_time_t *timep, const long offset, struct pg_tm * tmp, const pg_tz *tz);
++static void timesub(const pg_time_t *timep, const long offset,
+ const struct state * sp, struct pg_tm * tmp);
+-static pg_time_t transtime(pg_time_t janfirst, int year,
+- const struct rule * rulep, long offset);
+-int tzparse(const char *name, struct state * sp, int lastditch);
++static pg_time_t transtime(const pg_time_t janfirst, const int year,
++ const struct rule * rulep, const long offset);
++int tzparse(const char *name, struct state * sp, const int lastditch);
+
+ /* GMT timezone */
+ static struct state gmtmem;
diff --git a/databases/postgresql82/patches/patch-ag b/databases/postgresql82/patches/patch-ag
new file mode 100644
index 00000000000..f568ecd8a94
--- /dev/null
+++ b/databases/postgresql82/patches/patch-ag
@@ -0,0 +1,15 @@
+$NetBSD: patch-ag,v 1.1.1.1 2006/12/09 15:34:13 adam Exp $
+
+--- src/timezone/private.h.orig 2005-02-23 13:34:21.000000000 +0900
++++ src/timezone/private.h
+@@ -66,8 +66,8 @@ extern int unlink(const char *filename);
+ extern char *icalloc(int nelem, int elsize);
+ extern char *icatalloc(char *old, const char *new);
+ extern char *icpyalloc(const char *string);
+-extern char *imalloc(int n);
+-extern void *irealloc(void *pointer, int size);
++extern char *imalloc(const int n);
++extern void *irealloc(void *pointer, const int size);
+ extern void icfree(char *pointer);
+ extern void ifree(char *pointer);
+ extern char *scheck(const char *string, const char *format);
diff --git a/databases/postgresql82/patches/patch-ah b/databases/postgresql82/patches/patch-ah
new file mode 100644
index 00000000000..1990d32ca32
--- /dev/null
+++ b/databases/postgresql82/patches/patch-ah
@@ -0,0 +1,13 @@
+$NetBSD: patch-ah,v 1.1.1.1 2006/12/09 15:34:13 adam Exp $
+
+--- src/timezone/strftime.c.orig 2006-07-14 16:52:27.000000000 +0200
++++ src/timezone/strftime.c
+@@ -89,7 +89,7 @@ static const struct lc_time_T C_time_loc
+ };
+
+ static char *_add(const char *, char *, const char *);
+-static char *_conv(int, const char *, char *, const char *);
++static char *_conv(const int, const char *, char *, const char *);
+ static char *_fmt(const char *, const struct pg_tm *, char *,
+ const char *, int *);
+
diff --git a/databases/postgresql82/patches/patch-ai b/databases/postgresql82/patches/patch-ai
new file mode 100644
index 00000000000..d7042d1e14d
--- /dev/null
+++ b/databases/postgresql82/patches/patch-ai
@@ -0,0 +1,80 @@
+$NetBSD: patch-ai,v 1.1.1.1 2006/12/09 15:34:13 adam Exp $
+
+--- src/timezone/zic.c.orig 2006-10-24 17:11:03.000000000 +0200
++++ src/timezone/zic.c
+@@ -104,52 +104,52 @@ struct zone
+ };
+
+ extern int link(const char *fromname, const char *toname);
+-static void addtt(pg_time_t starttime, int type);
+-static int addtype(long gmtoff, const char *abbr, int isdst,
+- int ttisstd, int ttisgmt);
+-static void leapadd(pg_time_t t, int positive, int rolling, int count);
++static void addtt(const pg_time_t starttime, int type);
++static int addtype(const long gmtoff, const char *abbr, const int isdst,
++ const int ttisstd, const int ttisgmt);
++static void leapadd(const pg_time_t t, const int positive, const int rolling, int count);
+ static void adjleap(void);
+ static void associate(void);
+ static int ciequal(const char *ap, const char *bp);
+-static void convert(long val, char *buf);
++static void convert(const long val, char *buf);
+ static void dolink(const char *fromfile, const char *tofile);
+ static void doabbr(char *abbr, const char *format,
+- const char *letters, int isdst);
+-static void eat(const char *name, int num);
+-static void eats(const char *name, int num,
+- const char *rname, int rnum);
+-static long eitol(int i);
++ const char *letters, const int isdst);
++static void eat(const char *name, const int num);
++static void eats(const char *name, const int num,
++ const char *rname, const int rnum);
++static long eitol(const int i);
+ static void error(const char *message);
+ static char **getfields(char *buf);
+ static long gethms(const char *string, const char *errstrng,
+- int signable);
++ const int signable);
+ static void infile(const char *filename);
+-static void inleap(char **fields, int nfields);
+-static void inlink(char **fields, int nfields);
+-static void inrule(char **fields, int nfields);
+-static int inzcont(char **fields, int nfields);
+-static int inzone(char **fields, int nfields);
+-static int inzsub(char **fields, int nfields, int iscont);
++static void inleap(char **fields, const int nfields);
++static void inlink(char **fields, const int nfields);
++static void inrule(char **fields, const int nfields);
++static int inzcont(char **fields, const int nfields);
++static int inzone(char **fields, const int nfields);
++static int inzsub(char **fields, const int nfields, const int iscont);
+ static int itsabbr(const char *abbr, const char *word);
+ static int itsdir(const char *name);
+ static int lowerit(int c);
+ static char *memcheck(char *tocheck);
+ static int mkdirs(char *filename);
+ static void newabbr(const char *abbr);
+-static long oadd(long t1, long t2);
+-static void outzone(const struct zone * zp, int ntzones);
+-static void puttzcode(long code, FILE *fp);
++static long oadd(const long t1, const long t2);
++static void outzone(const struct zone * zp, const int ntzones);
++static void puttzcode(const long code, FILE *fp);
+ static int rcomp(const void *leftp, const void *rightp);
+-static pg_time_t rpytime(const struct rule * rp, int wantedy);
++static pg_time_t rpytime(const struct rule * rp, const int wantedy);
+ static void rulesub(struct rule * rp,
+ const char *loyearp, const char *hiyearp,
+ const char *typep, const char *monthp,
+ const char *dayp, const char *timep);
+ static void setboundaries(void);
+-static pg_time_t tadd(pg_time_t t1, long t2);
++static pg_time_t tadd(const pg_time_t t1, const long t2);
+ static void usage(void);
+ static void writezone(const char *name);
+-static int yearistype(int year, const char *type);
++static int yearistype(const int year, const char *type);
+
+ static int charcnt;
+ static int errors;
diff --git a/databases/postgresql82/patches/patch-aj b/databases/postgresql82/patches/patch-aj
new file mode 100644
index 00000000000..b7d83d94ff2
--- /dev/null
+++ b/databases/postgresql82/patches/patch-aj
@@ -0,0 +1,30 @@
+$NetBSD: patch-aj,v 1.1.1.1 2006/12/09 15:34:13 adam Exp $
+
+--- contrib/tsearch2/snowball/Makefile.orig 2006-01-27 17:32:31.000000000 +0100
++++ contrib/tsearch2/snowball/Makefile
+@@ -1,6 +1,6 @@
+ # $PostgreSQL: pgsql/contrib/tsearch2/snowball/Makefile,v 1.9 2006/01/27 16:32:31 teodor Exp $
+
+-SUBOBJS = english_stem.o api.o russian_stem.o russian_stem_UTF8.o utilities.o
++SUBOBJS = english_stem.lo api.lo russian_stem.lo russian_stem_UTF8.lo utilities.lo
+
+ EXTRA_CLEAN = SUBSYS.o $(SUBOBJS)
+
+@@ -14,13 +14,14 @@ subdir = contrib/tsearch2/snowball
+ top_builddir = ../../..
+ include $(top_builddir)/src/Makefile.global
+ include $(top_srcdir)/contrib/contrib-global.mk
++include $(top_srcdir)/src/Makefile.shlib
+ endif
+
+ override CFLAGS += $(CFLAGS_SL)
+
+-all: SUBSYS.o
++all: libSUBSYS.la
+
+-SUBSYS.o: $(SUBOBJS)
+- $(LD) $(LDREL) $(LDOUT) $@ $^
++libSUBSYS.la: $(SUBOBJS)
++ libtool --mode=link ${CC} -o libSUBSYS.la ${SUBOBJS}
+
+
diff --git a/databases/postgresql82/patches/patch-ak b/databases/postgresql82/patches/patch-ak
new file mode 100644
index 00000000000..220f22025d5
--- /dev/null
+++ b/databases/postgresql82/patches/patch-ak
@@ -0,0 +1,30 @@
+$NetBSD: patch-ak,v 1.1.1.1 2006/12/09 15:34:13 adam Exp $
+
+--- contrib/tsearch2/ispell/Makefile.orig 2006-10-25 12:46:42.000000000 +0000
++++ contrib/tsearch2/ispell/Makefile
+@@ -1,6 +1,6 @@
+ # $PostgreSQL: pgsql/contrib/tsearch2/ispell/Makefile,v 1.9 2005/10/18 01:30:48 tgl Exp $
+
+-SUBOBJS = spell.o regis.o
++SUBOBJS = spell.lo regis.lo
+
+ EXTRA_CLEAN = SUBSYS.o $(SUBOBJS)
+
+@@ -14,13 +14,12 @@ subdir = contrib/tsearch2/ispell
+ top_builddir = ../../..
+ include $(top_builddir)/src/Makefile.global
+ include $(top_srcdir)/contrib/contrib-global.mk
++include $(top_srcdir)/src/Makefile.shlib
+ endif
+
+ override CFLAGS += $(CFLAGS_SL)
+
+-all: SUBSYS.o
+-
+-SUBSYS.o: $(SUBOBJS)
+- $(LD) $(LDREL) $(LDOUT) $@ $^
+-
++all: libSUBSYS.la
+
++libSUBSYS.la: $(SUBOBJS)
++ libtool --mode=link ${CC} -o libSUBSYS.la ${SUBOBJS}
diff --git a/databases/postgresql82/patches/patch-al b/databases/postgresql82/patches/patch-al
new file mode 100644
index 00000000000..9598e09ccb3
--- /dev/null
+++ b/databases/postgresql82/patches/patch-al
@@ -0,0 +1,29 @@
+$NetBSD: patch-al,v 1.1.1.1 2006/12/09 15:34:13 adam Exp $
+
+--- contrib/tsearch2/wordparser/Makefile.orig 2005-11-21 13:27:57.000000000 +0100
++++ contrib/tsearch2/wordparser/Makefile
+@@ -1,6 +1,6 @@
+ # $PostgreSQL: pgsql/contrib/tsearch2/wordparser/Makefile,v 1.9 2005/11/21 12:27:57 teodor Exp $
+
+-SUBOBJS = parser.o deflex.o
++SUBOBJS = parser.lo deflex.lo
+
+ EXTRA_CLEAN = SUBSYS.o $(SUBOBJS)
+
+@@ -14,13 +14,14 @@ subdir = contrib/tsearch2/wordparser
+ top_builddir = ../../..
+ include $(top_builddir)/src/Makefile.global
+ include $(top_srcdir)/contrib/contrib-global.mk
++include $(top_srcdir)/src/Makefile.shlib
+ endif
+
+ override CFLAGS += $(CFLAGS_SL)
+
+ all: SUBSYS.o
+
+-SUBSYS.o: $(SUBOBJS)
+- $(LD) $(LDREL) $(LDOUT) $@ $^
++libSUBSYS.la: $(SUBOBJS)
++ libtool --mode=link ${CC} -o libSUBSYS.la ${SUBOBJS}
+
+
diff --git a/databases/postgresql82/patches/patch-am b/databases/postgresql82/patches/patch-am
new file mode 100644
index 00000000000..ede92aa57ef
--- /dev/null
+++ b/databases/postgresql82/patches/patch-am
@@ -0,0 +1,39 @@
+$NetBSD: patch-am,v 1.1.1.1 2006/12/09 15:34:13 adam Exp $
+
+--- contrib/tsearch2/Makefile.orig 2006-09-11 17:14:46.000000000 +0200
++++ contrib/tsearch2/Makefile
+@@ -10,7 +10,7 @@ OBJS = dict_ex.o dict.o snmap.o stopword
+ ts_locale.o ts_lexize.o ginidx.o
+
+ SUBDIRS := snowball ispell wordparser
+-SUBDIROBJS := $(SUBDIRS:%=%/SUBSYS.o)
++SUBDIROBJS := $(SUBDIRS:%=%/libSUBSYS.la)
+
+ OBJS += $(SUBDIROBJS)
+
+@@ -22,7 +22,7 @@ DOCS = README.tsearch2
+ REGRESS = tsearch2
+
+ SHLIB_LINK += $(filter -lm, $(LIBS))
+-
++shmodule=yes
+
+ ifdef USE_PGXS
+ PGXS := $(shell pg_config --pgxs)
+@@ -32,6 +32,7 @@ subdir = contrib/tsearch2
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
+ include $(top_srcdir)/contrib/contrib-global.mk
++include $(top_builddir)/src/Makefile.shlib
+ endif
+
+
+@@ -40,7 +41,7 @@ $(SUBDIROBJS): $(SUBDIRS:%=%-recursive)
+ .PHONY: $(SUBDIRS:%=%-recursive)
+
+ $(SUBDIRS:%=%-recursive):
+- $(MAKE) -C $(subst -recursive,,$@) SUBSYS.o
++ $(MAKE) -C $(subst -recursive,,$@) libSUBSYS.la
+
+ tsearch2.sql: tsearch.sql.in
+ sed -e 's,MODULE_PATHNAME,$$libdir/$(MODULE_big),g' $< >$@
diff --git a/databases/postgresql82/patches/patch-an b/databases/postgresql82/patches/patch-an
new file mode 100644
index 00000000000..dd842510198
--- /dev/null
+++ b/databases/postgresql82/patches/patch-an
@@ -0,0 +1,13 @@
+$NetBSD: patch-an,v 1.1.1.1 2006/12/09 15:34:13 adam Exp $
+
+--- src/interfaces/ecpg/test/Makefile.regress.orig 2006-10-22 22:13:37.000000000 +0200
++++ src/interfaces/ecpg/test/Makefile.regress
+@@ -8,7 +8,7 @@ override LIBS := -lecpg -lpgtypes $(libp
+ ECPG = ../../preproc/ecpg -I$(srcdir)/../../include
+
+ %: %.c
+- $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) $(LIBS) -o $@
++ ${LIBTOOL} --mode=link $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) $(LIBS) -o $@
+
+ %.c: %.pgc ../regression.h
+ $(ECPG) -o $@ -I$(srcdir) $<