summaryrefslogtreecommitdiff
path: root/databases/postgresql91
diff options
context:
space:
mode:
authoradam <adam@pkgsrc.org>2011-09-15 08:27:38 +0000
committeradam <adam@pkgsrc.org>2011-09-15 08:27:38 +0000
commitbfd12bfb1edc31693ca2b3ac46752e60f3f5f362 (patch)
treee4278cd9abc25bd225f1dd7ef33d4023332332b6 /databases/postgresql91
parentd162e8d1617159d190abd1e6ec4d1fdca0c6bdb2 (diff)
downloadpkgsrc-bfd12bfb1edc31693ca2b3ac46752e60f3f5f362.tar.gz
Version 9.1 delivers several features which users have been requesting for
years, removing roadblocks to deploying new or ported applications on PostgreSQL. These include: * Synchronous Replication: enable high-availability with consistency across multiple servers * Per-Column Collations: support linguistically-correct sorting per database, table or column. * Unlogged Tables: greatly improves performance for ephemeral data Our community of contributors innovates with cutting-edge features. Version 9.1 includes several which are new to the database industry, such as: * K-Nearest-Neighbor Indexing: index on "distance" for faster location and text search queries * Serializable Snapshot Isolation: keeps concurrent transactions consistent without blocking, using "true serializability" * Writeable Common Table Expressions: execute complex multi-stage data updates in a single query * Security-Enhanced Postgres: deploy military-grade security and Mandatory Access Control
Diffstat (limited to 'databases/postgresql91')
-rw-r--r--databases/postgresql91/DESCR9
-rw-r--r--databases/postgresql91/Makefile14
-rw-r--r--databases/postgresql91/Makefile.common113
-rw-r--r--databases/postgresql91/Makefile.mirrors85
-rw-r--r--databases/postgresql91/PLIST2
-rw-r--r--databases/postgresql91/distinfo16
-rw-r--r--databases/postgresql91/files/GNUmakefile.libpq20
-rw-r--r--databases/postgresql91/files/dynloader-ltdl.h17
-rw-r--r--databases/postgresql91/options.mk56
-rw-r--r--databases/postgresql91/patches/patch-config_perl.m415
-rw-r--r--databases/postgresql91/patches/patch-configure23
-rw-r--r--databases/postgresql91/patches/patch-contrib_dblink_Makefile12
-rw-r--r--databases/postgresql91/patches/patch-contrib_dblink_dblink.c13
-rw-r--r--databases/postgresql91/patches/patch-src_Makefile.shlib24
-rw-r--r--databases/postgresql91/patches/patch-src_backend_Makefile15
-rw-r--r--databases/postgresql91/patches/patch-src_pl_plperl_GNUmakefile21
-rw-r--r--databases/postgresql91/patches/patch-src_timezone_localtime.c31
-rw-r--r--databases/postgresql91/patches/patch-src_timezone_private.h15
-rw-r--r--databases/postgresql91/patches/patch-src_timezone_strftime.c13
-rw-r--r--databases/postgresql91/patches/patch-src_timezone_zic.c78
20 files changed, 592 insertions, 0 deletions
diff --git a/databases/postgresql91/DESCR b/databases/postgresql91/DESCR
new file mode 100644
index 00000000000..9f6b5b5b0f9
--- /dev/null
+++ b/databases/postgresql91/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/postgresql91/Makefile b/databases/postgresql91/Makefile
new file mode 100644
index 00000000000..adc898207ac
--- /dev/null
+++ b/databases/postgresql91/Makefile
@@ -0,0 +1,14 @@
+# $NetBSD: Makefile,v 1.1.1.1 2011/09/15 08:27:38 adam Exp $
+
+PKGNAME= ${DISTNAME:C/-/91-/}
+COMMENT= Robust, next generation, object-relational DBMS
+
+DEPENDS+= postgresql91-client>=${PKGVERSION_NOREV}:../../databases/postgresql91-client
+DEPENDS+= postgresql91-docs>=${PKGVERSION_NOREV}:../../databases/postgresql91-docs
+DEPENDS+= postgresql91-server>=${PKGVERSION_NOREV}:../../databases/postgresql91-server
+
+META_PACKAGE= yes
+
+.include "Makefile.common"
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/databases/postgresql91/Makefile.common b/databases/postgresql91/Makefile.common
new file mode 100644
index 00000000000..e23afc24353
--- /dev/null
+++ b/databases/postgresql91/Makefile.common
@@ -0,0 +1,113 @@
+# $NetBSD: Makefile.common,v 1.1.1.1 2011/09/15 08:27:38 adam Exp $
+#
+# used by databases/postgresql91-adminpack/Makefile
+# used by databases/postgresql91-client/Makefile
+# used by databases/postgresql91-datatypes/Makefile
+# used by databases/postgresql91-dblink/Makefile
+# used by databases/postgresql91-docs/Makefile
+# used by databases/postgresql91-fuzzystrmatch/Makefile
+# used by databases/postgresql91-pgcrypto/Makefile
+# used by databases/postgresql91-plperl/Makefile
+# used by databases/postgresql91-plpython/Makefile
+# used by databases/postgresql91-pltcl/Makefile
+# used by databases/postgresql91-server/Makefile
+# used by databases/postgresql91-upgrade/Makefile
+#
+# 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/postgresql91/Makefile.mirrors"
+
+DISTNAME= postgresql-9.1.0
+CATEGORIES= databases
+MASTER_SITES= ${PGSQL_MIRRORS:=source/v${PKGVERSION_NOREV}/}
+EXTRACT_SUFX= .tar.bz2
+
+MAINTAINER?= adam@NetBSD.org
+HOMEPAGE= http://www.postgresql.org/
+LICENSE= postgresql-license
+
+CONFLICTS+= postgresql-[0-9]*
+CONFLICTS+= postgresql[0-8][0-9]-*
+
+DISTINFO_FILE?= ${.CURDIR}/../../databases/postgresql91/distinfo
+COMMON_FILESDIR?= ${.CURDIR}/../../databases/postgresql91/files
+PATCHDIR?= ${.CURDIR}/../../databases/postgresql91/patches
+
+USE_PKGLOCALEDIR= yes
+USE_TOOLS+= bison gmake lex msgfmt
+PKG_SYSCONFSUBDIR= postgresql
+
+.include "../../mk/bsd.prefs.mk"
+
+PG_TEMPLATE.SunOS= solaris
+PG_TEMPLATE.IRIX= irix5
+.if !defined(PG_TEMPLATE.${OPSYS})
+PG_TEMPLATE.${OPSYS}= ${LOWER_OPSYS}
+.endif
+
+PG_DATA_DIR= ${PREFIX}/share/postgresql
+PG_DOC_DIR= ${PREFIX}/share/doc/postgresql
+PG_LOCALE_DIR= ${PREFIX}/${PKGLOCALEDIR}/locale
+PG_ETC_DIR= ${PKG_SYSCONFDIR}
+
+GNU_CONFIGURE= yes
+CONFIGURE_ARGS+= --sysconfdir=${PG_ETC_DIR}
+CONFIGURE_ARGS+= --datadir=${PG_DATA_DIR}
+CONFIGURE_ARGS+= --localedir=${PG_LOCALE_DIR}
+CONFIGURE_ARGS+= --with-docdir=${PG_DOC_DIR}
+CONFIGURE_ARGS+= --with-template=${PG_TEMPLATE.${OPSYS}}
+
+CONFIGURE_ARGS+= --enable-nls
+CONFIGURE_ARGS+= --without-perl
+CONFIGURE_ARGS+= --without-python
+CONFIGURE_ARGS+= --without-readline
+CONFIGURE_ARGS+= --without-tcl
+CONFIGURE_ARGS+= --without-zlib
+
+# 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. Please don't change
+# this value unless you know what you are doing.
+BUILD_DEFS+= PGSQL_BLCKSZ
+.if defined(PGSQL_BLCKSZ)
+CONFIGURE_ARGS+= --with-blocksize=${PGSQL_BLCKSZ}
+.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
+
+.include "../../devel/gettext-lib/buildlink3.mk"
+
+.if !defined(META_PACKAGE)
+post-extract:
+. if !empty(USE_LIBLTDL:M[yY][eE][sS])
+ cp -f ${COMMON_FILESDIR}/dynloader-ltdl.h \
+ ${WRKSRC}/src/backend/port/dynloader/${PG_TEMPLATE.${OPSYS}:Q}.h
+ ${ECHO} "static int dummy = 0;" \
+ > ${WRKSRC}/src/backend/port/dynloader/${PG_TEMPLATE.${OPSYS}:Q}.c
+. endif
+ touch ${WRKSRC}/src/template/dragonfly
+ 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
+ cp ${WRKSRC}/src/include/port/freebsd.h \
+ ${WRKSRC}/src/include/port/dragonfly.h
+ cp ${WRKSRC}/src/makefiles/Makefile.freebsd \
+ ${WRKSRC}/src/makefiles/Makefile.dragonfly
+.endif
+
+.include "../../databases/postgresql91/options.mk"
diff --git a/databases/postgresql91/Makefile.mirrors b/databases/postgresql91/Makefile.mirrors
new file mode 100644
index 00000000000..19e0e7972fc
--- /dev/null
+++ b/databases/postgresql91/Makefile.mirrors
@@ -0,0 +1,85 @@
+# $NetBSD: Makefile.mirrors,v 1.1.1.1 2011/09/15 08:27:38 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 20100328.
+###
+PGSQL_MIRRORS= \
+ ftp://ftp5.ca.postgresql.org/mirrors/postgresql/ \
+ http://ftp2.cz.postgresql.org/pub/postgresql/ \
+ ftp://ftp2.cz.postgresql.org/pub/postgresql/ \
+ http://ftp.dk.postgresql.org/postgresql/ \
+ ftp://ftp.dk.postgresql.org/postgresql/ \
+ http://ftp.ee.postgresql.org/pub/postgresql/ \
+ ftp://ftp.fi.postgresql.org/pub/postgresql/ \
+ http://ftp4.fr.postgresql.org/pub/mirrors/postgresql/ \
+ ftp://ftp4.fr.postgresql.org/pub/mirrors/postgresql/ \
+ http://ftp3.de.postgresql.org/pub/Mirrors/ftp.postgresql.org/ \
+ ftp://ftp3.de.postgresql.org/pub/Mirrors/ftp.postgresql.org/ \
+ http://ftp8.de.postgresql.org/pub/misc/pgsql/ \
+ ftp://ftp8.de.postgresql.org/pub/misc/pgsql/ \
+ ftp://ftp7.de.postgresql.org/pub/ftp.postgresql.org/ \
+ ftp://ftp9.de.postgresql.org/unix/databases/postgresql/ \
+ ftp://ftp10.de.postgresql.org/pub/mirror/postgresql/ \
+ http://ftp.gr.postgresql.org/pub/databases/postgresql/ \
+ ftp://ftp.gr.postgresql.org/pub/databases/postgresql/ \
+ http://ftp3.gr.postgresql.org/ \
+ ftp://ftp3.gr.postgresql.org/mirrors/postgresql/ \
+ http://ftp.ie.postgresql.org/mirrors/ftp.postgresql.org/pub/ \
+ ftp://ftp.ie.postgresql.org/mirrors/ftp.postgresql.org/pub/ \
+ http://ftp2.ie.postgresql.org/mirrors/ftp.postgresql.org/ \
+ ftp://ftp2.ie.postgresql.org/mirrors/ftp.postgresql.org/ \
+ http://ftp2.it.postgresql.org/mirrors/postgres/ \
+ ftp://ftp2.it.postgresql.org/mirrors/postgres/ \
+ ftp://ftp3.jp.postgresql.org/pub/db/postgresql/ \
+ ftp://ftp2.kr.postgresql.org/pub/postgresql/ \
+ ftp://ftp.lv.postgresql.org/mirrors/ftp.postgresql.org/ \
+ http://ftp2.nl.postgresql.org/ \
+ ftp://ftp2.nl.postgresql.org/mirror/postgresql/ \
+ ftp://ftp.nl.postgresql.org:21/pub/mirror/postgresql/ \
+ ftp://ftp.nz.postgresql.org/postgresql/ \
+ http://ftp6.pl.postgresql.org/pub/postgresql/ \
+ ftp://ftp6.pl.postgresql.org/pub/postgresql/ \
+ http://ftp8.pl.postgresql.org/pub/postgresql/ \
+ ftp://ftp8.pl.postgresql.org/pub/postgresql/ \
+ http://ftp9.pl.postgresql.org/pub/mirrors/ftp.postgresql.org/ \
+ ftp://ftp9.pl.postgresql.org/pub/mirrors/ftp.postgresql.org/ \
+ ftp://ftp7.pl.postgresql.org/pub/mirror/ftp.postgresql.org/ \
+ http://ftp.pt.postgresql.org/pub/postgresql/ \
+ ftp://ftp.pt.postgresql.org/pub/postgresql/ \
+ ftp://ftp6.ro.postgresql.org/pub/mirrors/ftp.postgresql.org/ \
+ ftp://ftp2.ru.postgresql.org/pub/databases/postgresql/ \
+ ftp://ftp3.ru.postgresql.org/pub/mirror/postgresql/pub/ \
+ ftp://ftp.si.postgresql.org/pub/mirrors/postgresql/ \
+ ftp://ftp.za.postgresql.org/mirror/ftp.postgresql.org/ \
+ http://ftp.se.postgresql.org/pub/databases/relational/postgresql/ \
+ ftp://ftp.se.postgresql.org/pub/databases/relational/postgresql/ \
+ http://ftp2.ch.postgresql.org/pub/mirrors/postgresql/ \
+ ftp://ftp2.ch.postgresql.org/pub/mirrors/postgresql/ \
+ ftp://ftp.ch.postgresql.org/mirror/postgresql/ \
+ http://ftp3.tw.postgresql.org/postgresql/ \
+ ftp://ftp3.tw.postgresql.org/postgresql/ \
+ http://ftp9.us.postgresql.org/pub/mirrors/postgresql/ \
+ ftp://ftp9.us.postgresql.org/pub/mirrors/postgresql/ \
+ ftp://ftp5.us.postgresql.org/pub/PostgreSQL/ \
+ ftp://ftp10.us.postgresql.org/pub/postgresql/ \
+ ftp://ftp3.ua.postgresql.org/pub/mirrors/postgresql/ \
+ http://ftp2.uk.postgresql.org/sites/ftp.postgresql.org/ \
+ ftp://ftp2.uk.postgresql.org/sites/ftp.postgresql.org/
+
+# Default to fetching from a .us mirror for the sake of the main NetBSD
+# ftp server.
+#
+PGSQL_MIRRORS_SORT?= .de
+
+# 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/postgresql91/PLIST b/databases/postgresql91/PLIST
new file mode 100644
index 00000000000..6e3b260bf00
--- /dev/null
+++ b/databases/postgresql91/PLIST
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2011/09/15 08:27:39 adam Exp $
+@comment this plist intentionally left empty
diff --git a/databases/postgresql91/distinfo b/databases/postgresql91/distinfo
new file mode 100644
index 00000000000..c685fffe6c9
--- /dev/null
+++ b/databases/postgresql91/distinfo
@@ -0,0 +1,16 @@
+$NetBSD: distinfo,v 1.1.1.1 2011/09/15 08:27:38 adam Exp $
+
+SHA1 (postgresql-9.1.0.tar.bz2) = 25d4999b587fb4e85ed4b541967c5c2d52354ba1
+RMD160 (postgresql-9.1.0.tar.bz2) = c943430b98b5dac8296fa5b937ef85e03dee08c5
+Size (postgresql-9.1.0.tar.bz2) = 14788869 bytes
+SHA1 (patch-config_perl.m4) = c7e5aaff1c47d2e33df7692a412ef984c77ffcc0
+SHA1 (patch-configure) = dab79533dac06a79a5aa8439d6b15830d8d2fba7
+SHA1 (patch-contrib_dblink_Makefile) = 4960ad57d42465fae203870548e4c53f8a32ce04
+SHA1 (patch-contrib_dblink_dblink.c) = 4d7c40d107d4c13c63ef2908d9a02be319863657
+SHA1 (patch-src_Makefile.shlib) = 39c9d8fa983658fd609a7879cbe46c95aabb8011
+SHA1 (patch-src_backend_Makefile) = 76ddd3015d93b19cdd6000eaffc4f53cbd4965b5
+SHA1 (patch-src_pl_plperl_GNUmakefile) = 6f8b7842f9e3016932f47b90ba6011a2015b8a05
+SHA1 (patch-src_timezone_localtime.c) = a73769cf05223d2ee06249c9e69c85038c2cd936
+SHA1 (patch-src_timezone_private.h) = 85dac95e40efc16270885087f868aeb76e1b9214
+SHA1 (patch-src_timezone_strftime.c) = 25102dce1b9b22385353af23500636fb18e3bf64
+SHA1 (patch-src_timezone_zic.c) = 0d6f536f7593e362ec216eafa73c718ad6bed8fc
diff --git a/databases/postgresql91/files/GNUmakefile.libpq b/databases/postgresql91/files/GNUmakefile.libpq
new file mode 100644
index 00000000000..be6504adaf4
--- /dev/null
+++ b/databases/postgresql91/files/GNUmakefile.libpq
@@ -0,0 +1,20 @@
+# $NetBSD: GNUmakefile.libpq,v 1.1.1.1 2011/09/15 08:27:39 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/postgresql91/files/dynloader-ltdl.h b/databases/postgresql91/files/dynloader-ltdl.h
new file mode 100644
index 00000000000..8a0ea5002df
--- /dev/null
+++ b/databases/postgresql91/files/dynloader-ltdl.h
@@ -0,0 +1,17 @@
+/* $NetBSD: dynloader-ltdl.h,v 1.1.1.1 2011/09/15 08:27:39 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/postgresql91/options.mk b/databases/postgresql91/options.mk
new file mode 100644
index 00000000000..d06b7cfb1cc
--- /dev/null
+++ b/databases/postgresql91/options.mk
@@ -0,0 +1,56 @@
+# $NetBSD: options.mk,v 1.1.1.1 2011/09/15 08:27:39 adam Exp $
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.postgresql91
+PKG_SUPPORTED_OPTIONS= bonjour gssapi kerberos ldap pam xml
+
+.include "../../mk/bsd.options.mk"
+
+###
+### Bonjour support.
+###
+.if !empty(PKG_OPTIONS:Mbonjour)
+CONFIGURE_ARGS+= --with-bonjour
+. if ${OPSYS} != "Darwin"
+LIBS+= -ldns_sd
+. endif
+. include "../../net/mDNSResponder/buildlink3.mk"
+.endif
+
+###
+### GSSAPI authentication for the PostgreSQL backend.
+###
+.if !empty(PKG_OPTIONS:Mgssapi)
+CONFIGURE_ARGS+= --with-gssapi
+.endif
+
+###
+### Kerberos5 authentication for the PostgreSQL backend.
+###
+.if !empty(PKG_OPTIONS:Mkerberos)
+. include "../../mk/krb5.buildlink3.mk"
+CONFIGURE_ARGS+= --with-krb5
+.endif
+
+###
+### LDAP authentication for the PostgreSQL backend.
+###
+.if !empty(PKG_OPTIONS:Mldap)
+. include "../../databases/openldap-client/buildlink3.mk"
+CONFIGURE_ARGS+= --with-ldap
+.endif
+
+###
+### PAM authentication for the PostgreSQL backend.
+###
+.if !empty(PKG_OPTIONS:Mpam)
+. include "../../mk/pam.buildlink3.mk"
+CONFIGURE_ARGS+= --with-pam
+.endif
+
+###
+### XML support for the PostgreSQL backend.
+###
+.if !empty(PKG_OPTIONS:Mxml)
+. include "../../textproc/libxml2/buildlink3.mk"
+CONFIGURE_ARGS+= --with-libxml
+.endif
diff --git a/databases/postgresql91/patches/patch-config_perl.m4 b/databases/postgresql91/patches/patch-config_perl.m4
new file mode 100644
index 00000000000..08b82f94132
--- /dev/null
+++ b/databases/postgresql91/patches/patch-config_perl.m4
@@ -0,0 +1,15 @@
+$NetBSD: patch-config_perl.m4,v 1.1.1.1 2011/09/15 08:27:39 adam Exp $
+
+--- config/perl.m4.orig 2010-02-23 18:35:06.000000000 +0000
++++ config/perl.m4
+@@ -57,9 +57,7 @@ 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 -e "s/^X//" -e "s%$pgac_tmp2%%" -e ["s/ -arch [-a-zA-Z0-9_]*//g"]`
++perl_embed_ldflags=`$PERL -MExtUtils::Embed -e ldopts`
+ AC_SUBST(perl_embed_ldflags)dnl
+ if test -z "$perl_embed_ldflags" ; then
+ AC_MSG_RESULT(no)
diff --git a/databases/postgresql91/patches/patch-configure b/databases/postgresql91/patches/patch-configure
new file mode 100644
index 00000000000..6041d94d29a
--- /dev/null
+++ b/databases/postgresql91/patches/patch-configure
@@ -0,0 +1,23 @@
+$NetBSD: patch-configure,v 1.1.1.1 2011/09/15 08:27:39 adam Exp $
+
+--- configure.orig 2011-06-09 23:40:42.000000000 +0000
++++ configure
+@@ -2196,6 +2196,7 @@ case $host_os in
+ dragonfly*) template=netbsd ;;
+ dgux*) template=dgux ;;
+ freebsd*) template=freebsd ;;
++ dragonfly*) template=dragonfly ;;
+ hpux*) template=hpux ;;
+ irix*) template=irix ;;
+ linux*|gnu*|k*bsd*-gnu)
+@@ -7157,9 +7158,7 @@ $as_echo "$perl_useshrplib" >&6; }
+
+ { $as_echo "$as_me:$LINENO: checking for flags to link embedded Perl" >&5
+ $as_echo_n "checking for flags to link embedded Perl... " >&6; }
+-pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
+-pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
+-perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e "s/ -arch [-a-zA-Z0-9_]*//g"`
++perl_embed_ldflags=`$PERL -MExtUtils::Embed -e ldopts`
+ if test -z "$perl_embed_ldflags" ; then
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+ $as_echo "no" >&6; }
diff --git a/databases/postgresql91/patches/patch-contrib_dblink_Makefile b/databases/postgresql91/patches/patch-contrib_dblink_Makefile
new file mode 100644
index 00000000000..b20d4c0dc9b
--- /dev/null
+++ b/databases/postgresql91/patches/patch-contrib_dblink_Makefile
@@ -0,0 +1,12 @@
+$NetBSD: patch-contrib_dblink_Makefile,v 1.1.1.1 2011/09/15 08:27:39 adam Exp $
+
+--- contrib/dblink/Makefile.orig 2011-09-15 06:35:28.000000000 +0000
++++ contrib/dblink/Makefile
+@@ -4,7 +4,6 @@ MODULE_big = dblink
+ OBJS = dblink.o
+ PG_CPPFLAGS = -I$(libpq_srcdir)
+ SHLIB_LINK = $(libpq)
+-SHLIB_PREREQS = submake-libpq
+
+ EXTENSION = dblink
+ DATA = dblink--1.0.sql dblink--unpackaged--1.0.sql
diff --git a/databases/postgresql91/patches/patch-contrib_dblink_dblink.c b/databases/postgresql91/patches/patch-contrib_dblink_dblink.c
new file mode 100644
index 00000000000..778be34520c
--- /dev/null
+++ b/databases/postgresql91/patches/patch-contrib_dblink_dblink.c
@@ -0,0 +1,13 @@
+$NetBSD: patch-contrib_dblink_dblink.c,v 1.1.1.1 2011/09/15 08:27:39 adam Exp $
+
+--- contrib/dblink/dblink.c.orig 2010-07-06 19:18:54.000000000 +0000
++++ contrib/dblink/dblink.c
+@@ -59,7 +59,7 @@
+ #include "utils/array.h"
+ #include "utils/builtins.h"
+ #include "utils/dynahash.h"
+-#include "utils/fmgroids.h"
++#include "postgresql/server/utils/fmgroids.h"
+ #include "utils/hsearch.h"
+ #include "utils/lsyscache.h"
+ #include "utils/memutils.h"
diff --git a/databases/postgresql91/patches/patch-src_Makefile.shlib b/databases/postgresql91/patches/patch-src_Makefile.shlib
new file mode 100644
index 00000000000..832399e0aeb
--- /dev/null
+++ b/databases/postgresql91/patches/patch-src_Makefile.shlib
@@ -0,0 +1,24 @@
+$NetBSD: patch-src_Makefile.shlib,v 1.1.1.1 2011/09/15 08:27:39 adam Exp $
+
+Properly define the linker on DragonFly BSD.
+
+--- src/Makefile.shlib.orig 2011-01-28 02:21:31 +0000
++++ src/Makefile.shlib
+@@ -198,6 +198,17 @@ ifeq ($(PORTNAME), netbsd)
+ endif
+ endif
+
++ifeq ($(PORTNAME), dragonfly)
++ ifdef ELF_SYSTEM
++ LINK.shared = $(COMPILER) -shared
++ ifdef soname
++ LINK.shared += -Wl,-x,-soname,$(soname)
++ endif
++ else
++ LINK.shared = $(LD) -x -Bshareable -Bforcearchive
++ endif
++endif
++
+ ifeq ($(PORTNAME), hpux)
+ ifdef SO_MAJOR_VERSION
+ shlib = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
diff --git a/databases/postgresql91/patches/patch-src_backend_Makefile b/databases/postgresql91/patches/patch-src_backend_Makefile
new file mode 100644
index 00000000000..6aa393d9baa
--- /dev/null
+++ b/databases/postgresql91/patches/patch-src_backend_Makefile
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_backend_Makefile,v 1.1.1.1 2011/09/15 08:27:39 adam Exp $
+
+--- src/backend/Makefile.orig 2010-07-05 18:54:37.000000000 +0000
++++ src/backend/Makefile
+@@ -17,6 +17,10 @@ subdir = src/backend
+ top_builddir = ../..
+ include $(top_builddir)/src/Makefile.global
+
++CFLAGS+= $(DL_CFLAGS)
++LDFLAGS+= $(DL_LDFLAGS)
++LIBS+= $(DL_LIBS)
++
+ SUBDIRS = access bootstrap catalog parser commands executor foreign lib libpq \
+ main nodes optimizer port postmaster regex replication rewrite \
+ storage tcop tsearch utils $(top_builddir)/src/timezone
diff --git a/databases/postgresql91/patches/patch-src_pl_plperl_GNUmakefile b/databases/postgresql91/patches/patch-src_pl_plperl_GNUmakefile
new file mode 100644
index 00000000000..f3c618b496a
--- /dev/null
+++ b/databases/postgresql91/patches/patch-src_pl_plperl_GNUmakefile
@@ -0,0 +1,21 @@
+$NetBSD: patch-src_pl_plperl_GNUmakefile,v 1.1.1.1 2011/09/15 08:27:39 adam Exp $
+
+--- src/pl/plperl/GNUmakefile.orig 2011-09-08 21:13:27.000000000 +0000
++++ src/pl/plperl/GNUmakefile
+@@ -57,7 +57,6 @@ PSQLDIR = $(bindir)
+
+ include $(top_srcdir)/src/Makefile.shlib
+
+-plperl.o: perlchunks.h plperl_opmask.h
+
+ plperl_opmask.h: plperl_opmask.pl
+ @if [ x"$(perl_privlibexp)" = x"" ]; then echo "configure switch --with-perl was not specified."; exit 1; fi
+@@ -67,7 +66,7 @@ perlchunks.h: $(PERLCHUNKS)
+ @if [ x"$(perl_privlibexp)" = x"" ]; then echo "configure switch --with-perl was not specified."; exit 1; fi
+ $(PERL) $(srcdir)/text2macro.pl --strip='^(\#.*|\s*)$$' $^ > $@
+
+-all: all-lib
++all: perlchunks.h plperl_opmask.h all-lib
+
+ SPI.c: SPI.xs
+ @if [ x"$(perl_privlibexp)" = x"" ]; then echo "configure switch --with-perl was not specified."; exit 1; fi
diff --git a/databases/postgresql91/patches/patch-src_timezone_localtime.c b/databases/postgresql91/patches/patch-src_timezone_localtime.c
new file mode 100644
index 00000000000..eea6dc38c3b
--- /dev/null
+++ b/databases/postgresql91/patches/patch-src_timezone_localtime.c
@@ -0,0 +1,31 @@
+$NetBSD: patch-src_timezone_localtime.c,v 1.1.1.1 2011/09/15 08:27:39 adam Exp $
+
+--- src/timezone/localtime.c.orig 2009-06-11 16:49:15.000000000 +0200
++++ src/timezone/localtime.c
+@@ -80,20 +80,20 @@ static pg_time_t detzcode64(const char *
+ static int differ_by_repeat(pg_time_t t1, pg_time_t t0);
+ static const char *getzname(const char *strp);
+ static const char *getqzname(const char *strp, int delim);
+-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 struct pg_tm *gmtsub(const pg_time_t *timep, long offset,
++static struct pg_tm *gmtsub(const pg_time_t *timep, const long offset,
+ struct pg_tm * tmp);
+-static struct pg_tm *localsub(const pg_time_t *timep, long offset,
++static struct pg_tm *localsub(const pg_time_t *timep, const long offset,
+ struct pg_tm * tmp, const pg_tz *tz);
+ static int increment_overflow(int *number, int delta);
+-static pg_time_t transtime(pg_time_t janfirst, int year,
+- const struct rule * rulep, long offset);
++static pg_time_t transtime(pg_time_t janfirst, const int year,
++ const struct rule * rulep, const long offset);
+ static int typesequiv(const struct state * sp, int a, int b);
+-static struct pg_tm *timesub(const pg_time_t *timep, long offset,
++static struct pg_tm *timesub(const pg_time_t *timep, const long offset,
+ const struct state * sp, struct pg_tm * tmp);
+
+ /* GMT timezone */
diff --git a/databases/postgresql91/patches/patch-src_timezone_private.h b/databases/postgresql91/patches/patch-src_timezone_private.h
new file mode 100644
index 00000000000..45f458b5afb
--- /dev/null
+++ b/databases/postgresql91/patches/patch-src_timezone_private.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_timezone_private.h,v 1.1.1.1 2011/09/15 08:27:39 adam Exp $
+
+--- src/timezone/private.h.orig 2009-06-11 16:49:15.000000000 +0200
++++ src/timezone/private.h
+@@ -51,8 +51,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 const char *scheck(const char *string, const char *format);
diff --git a/databases/postgresql91/patches/patch-src_timezone_strftime.c b/databases/postgresql91/patches/patch-src_timezone_strftime.c
new file mode 100644
index 00000000000..11cbbca0070
--- /dev/null
+++ b/databases/postgresql91/patches/patch-src_timezone_strftime.c
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_timezone_strftime.c,v 1.1.1.1 2011/09/15 08:27:39 adam Exp $
+
+--- src/timezone/strftime.c.orig 2009-06-11 16:49:15.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 *);
+ static char *_yconv(const int, const int, const int, const int,
diff --git a/databases/postgresql91/patches/patch-src_timezone_zic.c b/databases/postgresql91/patches/patch-src_timezone_zic.c
new file mode 100644
index 00000000000..5a5286d1397
--- /dev/null
+++ b/databases/postgresql91/patches/patch-src_timezone_zic.c
@@ -0,0 +1,78 @@
+$NetBSD: patch-src_timezone_zic.c,v 1.1.1.1 2011/09/15 08:27:39 adam Exp $
+
+--- src/timezone/zic.c.orig 2010-03-16 07:17:04.000000000 +0000
++++ src/timezone/zic.c
+@@ -120,51 +120,51 @@ struct zone
+
+ extern int link(const char *fromname, const char *toname);
+ static void addtt(const pg_time_t starttime, int type);
+-static int addtype(long gmtoff, const char *abbr, int isdst,
+- int ttisstd, int ttisgmt);
+-static void leapadd(const pg_time_t t, int positive, int rolling, int count);
++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, int doquotes);
+-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, int doquotes);
++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(const pg_time_t t1, long t2);
++static pg_time_t tadd(const pg_time_t t1, const long t2);
+ static void usage(FILE *stream, int status);
+ static void writezone(const char *name, const char *string);
+-static int yearistype(int year, const char *type);
++static int yearistype(const int year, const char *type);
+
+ static int charcnt;
+ static int errors;