[Midnightbsd-cvs] mports [17360] trunk/databases/postgresql92-server: postgresql 9.2.9

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Wed Sep 17 08:10:28 EDT 2014


Revision: 17360
          http://svnweb.midnightbsd.org/mports/?rev=17360
Author:   laffer1
Date:     2014-09-17 08:10:27 -0400 (Wed, 17 Sep 2014)
Log Message:
-----------
postgresql 9.2.9

Modified Paths:
--------------
    trunk/databases/postgresql92-server/Makefile
    trunk/databases/postgresql92-server/distinfo
    trunk/databases/postgresql92-server/pkg-plist-contrib
    trunk/databases/postgresql92-server/pkg-plist-server

Added Paths:
-----------
    trunk/databases/postgresql92-server/files/patch-contrib-uuid

Removed Paths:
-------------
    trunk/databases/postgresql92-server/files/patch-plpython-Makefile

Modified: trunk/databases/postgresql92-server/Makefile
===================================================================
--- trunk/databases/postgresql92-server/Makefile	2014-09-16 23:14:28 UTC (rev 17359)
+++ trunk/databases/postgresql92-server/Makefile	2014-09-17 12:10:27 UTC (rev 17360)
@@ -1,7 +1,7 @@
 # $MidnightBSD$
 
 PORTNAME?=	postgresql
-DISTVERSION?=	9.2.7
+DISTVERSION?=	9.2.9
 PORTREVISION?=	0
 CATEGORIES?=	databases
 MASTER_SITES=	PGSQL
@@ -21,7 +21,7 @@
 WRKSRC=		${WRKDIR}/postgresql-${DISTVERSION}
 DIST_SUBDIR=	postgresql
 
-ICU_PATCHFILE?=	pg-923-icu-2014-02-10.diff.gz
+ICU_PATCHFILE?=	pg-928-icu-2014-06-09.diff.gz
 
 .if !defined(SLAVE_ONLY)
 UNIQUENAME?=	${PORTNAME}${DISTVERSION:R:S/.//}

Modified: trunk/databases/postgresql92-server/distinfo
===================================================================
--- trunk/databases/postgresql92-server/distinfo	2014-09-16 23:14:28 UTC (rev 17359)
+++ trunk/databases/postgresql92-server/distinfo	2014-09-17 12:10:27 UTC (rev 17360)
@@ -1,4 +1,4 @@
-SHA256 (postgresql/postgresql-9.2.7.tar.bz2) = 83c042c3f61c69b176d3e4344e59104f844bc8b8628dad2bb9022a64cf5afe86
-SIZE (postgresql/postgresql-9.2.7.tar.bz2) = 16248445
-SHA256 (postgresql/pg-923-icu-2014-02-10.diff.gz) = c7ca70433c819cea5fef0a9448da236b175d910177b18a8cb2ed9012a949aeb1
-SIZE (postgresql/pg-923-icu-2014-02-10.diff.gz) = 4440
+SHA256 (postgresql/postgresql-9.2.9.tar.bz2) = 94ec6d330f125b6fc725741293073b07d7d20cc3e7b8ed127bc3d14ad2370197
+SIZE (postgresql/postgresql-9.2.9.tar.bz2) = 16269349
+SHA256 (postgresql/pg-928-icu-2014-06-09.diff.gz) = 6f856ee0fd27118650f806fb674220d9851a0183ffa125e6fbe5468dfabeea5c
+SIZE (postgresql/pg-928-icu-2014-06-09.diff.gz) = 4449

Added: trunk/databases/postgresql92-server/files/patch-contrib-uuid
===================================================================
--- trunk/databases/postgresql92-server/files/patch-contrib-uuid	                        (rev 0)
+++ trunk/databases/postgresql92-server/files/patch-contrib-uuid	2014-09-17 12:10:27 UTC (rev 17360)
@@ -0,0 +1,392 @@
+--- contrib/Makefile.orig	2014-07-21 20:12:31.000000000 +0100
++++ contrib/Makefile	2014-07-30 18:15:30.332934684 +0100
+@@ -50,6 +50,7 @@
+ 		test_parser	\
+ 		tsearch2	\
+ 		unaccent	\
++		uuid-ossp	\
+ 		vacuumlo
+ 
+ ifeq ($(with_openssl),yes)
+--- contrib/uuid-ossp/Makefile.orig	2014-07-21 20:12:31.000000000 +0100
++++ contrib/uuid-ossp/Makefile	2014-07-30 18:15:36.370934674 +0100
+@@ -1,12 +1,14 @@
+ # contrib/uuid-ossp/Makefile
++# modified using http://pgfoundry.org/projects/uuid-freebsd/
++# to actually not use ossp, since uuid methods are all
++# built in into libc in FreeBSD /girgen@
+ 
+ MODULE_big = uuid-ossp
+ OBJS = uuid-ossp.o
+ 
+ EXTENSION = uuid-ossp
+ DATA = uuid-ossp--1.0.sql uuid-ossp--unpackaged--1.0.sql
+-
+-SHLIB_LINK += $(OSSP_UUID_LIBS)
++SHLIB_LINK = -lmd
+ 
+ ifdef USE_PGXS
+ PG_CONFIG = pg_config
+--- contrib/uuid-ossp/uuid-ossp.c.orig	2014-07-21 20:12:31.000000000 +0100
++++ contrib/uuid-ossp/uuid-ossp.c	2014-07-30 18:15:44.843935308 +0100
+@@ -6,6 +6,10 @@
+  *
+  * contrib/uuid-ossp/uuid-ossp.c
+  *
++ * Modified to use FreeBSD's built in uuid instead of ossp:
++ * Copyright (c) 2009 Andrew Gierth
++ *
++ * URL: http://pgfoundry.org/projects/uuid-freebsd
+  *-------------------------------------------------------------------------
+  */
+ 
+@@ -14,27 +18,14 @@
+ #include "utils/builtins.h"
+ #include "utils/uuid.h"
+ 
+-/*
+- * There's some confusion over the location of the uuid.h header file.
+- * On Debian, it's installed as ossp/uuid.h, while on Fedora, or if you
+- * install ossp-uuid from a tarball, it's installed as uuid.h. Don't know
+- * what other systems do.
+- */
+-#ifdef HAVE_OSSP_UUID_H
+-#include <ossp/uuid.h>
+-#else
+-#ifdef HAVE_UUID_H
+-#include <uuid.h>
+-#else
+-#error OSSP uuid.h not found
+-#endif
+-#endif
+-
+-/* better both be 16 */
+-#if (UUID_LEN != UUID_LEN_BIN)
+-#error UUID length mismatch
+-#endif
++/* OS has a uuid_hash that conflicts with ours; kill it*/
++/* explicit path since we do _not_ want to get any other version */
++#define uuid_hash freebsd_uuid_hash
++#include "/usr/include/uuid.h"
++#undef uuid_hash
+ 
++#include <md5.h>
++#include <sha.h>
+ 
+ PG_MODULE_MAGIC;
+ 
+@@ -64,177 +55,175 @@
+ PG_FUNCTION_INFO_V1(uuid_generate_v4);
+ PG_FUNCTION_INFO_V1(uuid_generate_v5);
+ 
+-static void
+-pguuid_complain(uuid_rc_t rc)
+-{
+-	char	   *err = uuid_error(rc);
+-
+-	if (err != NULL)
+-		ereport(ERROR,
+-				(errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION),
+-				 errmsg("OSSP uuid library failure: %s", err)));
+-	else
+-		ereport(ERROR,
+-				(errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION),
+-				 errmsg("OSSP uuid library failure: error code %d", rc)));
+-}
++/* we assume that the string representation is portable and that the
++ * native binary representation might not be. But for *ns, we assume
++ * that pg's internal storage of uuids is the simple byte-oriented
++ * binary format. */
+ 
+-/*
+- * We create a uuid_t object just once per session and re-use it for all
+- * operations in this module.  OSSP UUID caches the system MAC address and
+- * other state in this object.  Reusing the object has a number of benefits:
+- * saving the cycles needed to fetch the system MAC address over and over,
+- * reducing the amount of entropy we draw from /dev/urandom, and providing a
+- * positive guarantee that successive generated V1-style UUIDs don't collide.
+- * (On a machine fast enough to generate multiple UUIDs per microsecond,
+- * or whatever the system's wall-clock resolution is, we'd otherwise risk
+- * collisions whenever random initialization of the uuid_t's clock sequence
+- * value chanced to produce duplicates.)
+- *
+- * However: when we're doing V3 or V5 UUID creation, uuid_make needs two
+- * uuid_t objects, one holding the namespace UUID and one for the result.
+- * It's unspecified whether it's safe to use the same uuid_t for both cases,
+- * so let's cache a second uuid_t for use as the namespace holder object.
+- */
+-static uuid_t *
+-get_cached_uuid_t(int which)
++static Datum
++internal_uuid_create(int v, unsigned char *ns, char *ptr, int len)
+ {
+-	static uuid_t *cached_uuid[2] = {NULL, NULL};
++	char strbuf[40];
+ 
+-	if (cached_uuid[which] == NULL)
++	switch (v)
+ 	{
+-		uuid_rc_t	rc;
++	case 0:	 /* constant-value uuids: nil, or namespace uuids */
++		strlcpy(strbuf, ptr, 37);
++		break;
+ 
+-		rc = uuid_create(&cached_uuid[which]);
+-		if (rc != UUID_RC_OK)
+-		{
+-			cached_uuid[which] = NULL;
+-			pguuid_complain(rc);
+-		}
++	case 4: default:   /* random uuid */
++	{
++		sprintf(strbuf, "%08lx-%04x-%04x-%04x-%04x%08lx",
++			(unsigned long) arc4random(),
++			(unsigned) (arc4random() & 0xffff),
++			(unsigned) ((arc4random() & 0xfff) | 0x4000),
++			(unsigned) ((arc4random() & 0x3fff) | 0x8000),
++			(unsigned) (arc4random() & 0xffff),
++			(unsigned long) arc4random());
++		break;
+ 	}
+-	return cached_uuid[which];
+-}
++		
++	case 1:	 /* time/node-based uuids */
++	{
++		uuid_t uu;
++		uint32_t status = uuid_s_ok;
++		char *str = NULL;
+ 
+-static char *
+-uuid_to_string(const uuid_t *uuid)
+-{
+-	char	   *buf = palloc(UUID_LEN_STR + 1);
+-	void	   *ptr = buf;
+-	size_t		len = UUID_LEN_STR + 1;
+-	uuid_rc_t	rc;
++		uuid_create(&uu, &status);
+ 
+-	rc = uuid_export(uuid, UUID_FMT_STR, &ptr, &len);
+-	if (rc != UUID_RC_OK)
+-		pguuid_complain(rc);
++		if (status == uuid_s_ok)
++		{
++		uuid_to_string(&uu, &str, &status);
++		if (status == uuid_s_ok)
++		{
++			strlcpy(strbuf, str, 37);
+ 
+-	return buf;
+-}
++			/* PTR, if set, replaces the trailing characters of the uuid;
++			 * this is to support v1mc, where a random multicast MAC is
++			 * used instead of the physical one
++			 */
++			
++			if (ptr && len <= 36)
++			strcpy(strbuf + (36 - len), ptr);
++		}
++		if (str)
++			free(str);
++		}
+ 
++		if (status != uuid_s_ok)
++		{
++		ereport(ERROR,
++			(errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION),
++			 errmsg("FreeBSD uuid library failure: %d", (int) status)));
++		}
++		
++		break;
++	}
+ 
+-static void
+-string_to_uuid(const char *str, uuid_t *uuid)
+-{
+-	uuid_rc_t	rc;
++	case 3:	 /* namespace-based MD5 uuids */
++	{
++		/* we could use pg's md5(), but we're already pulling in libmd */
++		MD5_CTX ctx;
++		unsigned char buf[16];
++
++		MD5Init(&ctx);
++		MD5Update(&ctx, ns, 16);
++		MD5Update(&ctx, (unsigned char *)ptr, len);
++		MD5Final(buf, &ctx);
++
++		sprintf(strbuf,
++			"%02x%02x%02x%02x-"
++			"%02x%02x-%02x%02x-%02x%02x-"
++			"%02x%02x%02x%02x%02x%02x",
++			buf[0], buf[1], buf[2], buf[3],
++			buf[4], buf[5], ((buf[6] & 0xf) | 0x30), buf[7],
++			((buf[8] & 0x3F) | 0x80), buf[9], buf[10], buf[11],
++			buf[12], buf[13], buf[14], buf[15]);
+ 
+-	rc = uuid_import(uuid, UUID_FMT_STR, str, UUID_LEN_STR + 1);
+-	if (rc != UUID_RC_OK)
+-		pguuid_complain(rc);
+-}
++		break;
++	}
++
++	case 5:	 /* namespace-based SHA1 uuids */
++	{
++		SHA_CTX ctx;
++		unsigned char buf[20];
+ 
++		SHA1_Init(&ctx);
++		SHA1_Update(&ctx, ns, 16);
++		SHA1_Update(&ctx, (unsigned char *)ptr, len);
++		SHA1_Final(buf, &ctx);
++
++		sprintf(strbuf,
++			"%02x%02x%02x%02x-"
++			"%02x%02x-%02x%02x-%02x%02x-"
++			"%02x%02x%02x%02x%02x%02x",
++			buf[0], buf[1], buf[2], buf[3],
++			buf[4], buf[5], ((buf[6] & 0xf) | 0x30), buf[7],
++			((buf[8] & 0x3F) | 0x80), buf[9], buf[10], buf[11],
++			buf[12], buf[13], buf[14], buf[15]);
+ 
+-static Datum
+-special_uuid_value(const char *name)
+-{
+-	uuid_t	   *uuid = get_cached_uuid_t(0);
+-	char	   *str;
+-	uuid_rc_t	rc;
+-
+-	rc = uuid_load(uuid, name);
+-	if (rc != UUID_RC_OK)
+-		pguuid_complain(rc);
+-	str = uuid_to_string(uuid);
++			break;
++		}
++	}
+ 
+-	return DirectFunctionCall1(uuid_in, CStringGetDatum(str));
++	return DirectFunctionCall1(uuid_in, CStringGetDatum(strbuf));
+ }
+ 
+ 
+ Datum
+ uuid_nil(PG_FUNCTION_ARGS)
+ {
+-	return special_uuid_value("nil");
++	return internal_uuid_create(0, NULL, "00000000-0000-0000-0000-000000000000", 36);
+ }
+ 
+ 
+ Datum
+ uuid_ns_dns(PG_FUNCTION_ARGS)
+ {
+-	return special_uuid_value("ns:DNS");
++	return internal_uuid_create(0, NULL, "6ba7b810-9dad-11d1-80b4-00c04fd430c8", 36);
+ }
+ 
+ 
+ Datum
+ uuid_ns_url(PG_FUNCTION_ARGS)
+ {
+-	return special_uuid_value("ns:URL");
++	return internal_uuid_create(0, NULL, "6ba7b811-9dad-11d1-80b4-00c04fd430c8", 36);
+ }
+ 
+ 
+ Datum
+ uuid_ns_oid(PG_FUNCTION_ARGS)
+ {
+-	return special_uuid_value("ns:OID");
++	return internal_uuid_create(0, NULL, "6ba7b812-9dad-11d1-80b4-00c04fd430c8", 36);
+ }
+ 
+ 
+ Datum
+ uuid_ns_x500(PG_FUNCTION_ARGS)
+ {
+-	return special_uuid_value("ns:X500");
+-}
+-
+-
+-static Datum
+-uuid_generate_internal(int mode, const uuid_t *ns, const char *name)
+-{
+-	uuid_t	   *uuid = get_cached_uuid_t(0);
+-	char	   *str;
+-	uuid_rc_t	rc;
+-
+-	rc = uuid_make(uuid, mode, ns, name);
+-	if (rc != UUID_RC_OK)
+-		pguuid_complain(rc);
+-	str = uuid_to_string(uuid);
+-
+-	return DirectFunctionCall1(uuid_in, CStringGetDatum(str));
++	return internal_uuid_create(0, NULL, "6ba7b814-9dad-11d1-80b4-00c04fd430c8", 36);
+ }
+ 
+ 
+ Datum
+ uuid_generate_v1(PG_FUNCTION_ARGS)
+ {
+-	return uuid_generate_internal(UUID_MAKE_V1, NULL, NULL);
++	return internal_uuid_create(1, NULL, NULL, 0);
+ }
+ 
+ 
+ Datum
+ uuid_generate_v1mc(PG_FUNCTION_ARGS)
+ {
+-	return uuid_generate_internal(UUID_MAKE_V1 | UUID_MAKE_MC, NULL, NULL);
+-}
+-
+-
+-static Datum
+-uuid_generate_v35_internal(int mode, pg_uuid_t *ns, text *name)
+-{
+-	uuid_t	   *ns_uuid = get_cached_uuid_t(1);
+-
+-	string_to_uuid(DatumGetCString(DirectFunctionCall1(uuid_out,
+-													   UUIDPGetDatum(ns))),
+-				   ns_uuid);
++	char buf[20];
+ 
+-	return uuid_generate_internal(mode,
+-								  ns_uuid,
+-								  text_to_cstring(name));
++	sprintf(buf, "-%04x-%04x%08lx",
++		(unsigned)((arc4random() & 0x3FFF) | 0x8000),
++		/* set IEEE802 multicast and local-admin bits */
++		(unsigned)((arc4random() & 0xffff) | 0x0300),
++		(unsigned long) arc4random());
++		
++	return internal_uuid_create(1, NULL, buf, 18);
+ }
+ 
+ 
+@@ -244,14 +233,15 @@
+ 	pg_uuid_t  *ns = PG_GETARG_UUID_P(0);
+ 	text	   *name = PG_GETARG_TEXT_P(1);
+ 
+-	return uuid_generate_v35_internal(UUID_MAKE_V3, ns, name);
++	return internal_uuid_create(3, (unsigned char *)ns,
++				VARDATA(name), VARSIZE(name) - VARHDRSZ);
+ }
+ 
+ 
+ Datum
+ uuid_generate_v4(PG_FUNCTION_ARGS)
+ {
+-	return uuid_generate_internal(UUID_MAKE_V4, NULL, NULL);
++	return internal_uuid_create(4, NULL, NULL, 0);
+ }
+ 
+ 
+@@ -261,5 +251,6 @@
+ 	pg_uuid_t  *ns = PG_GETARG_UUID_P(0);
+ 	text	   *name = PG_GETARG_TEXT_P(1);
+ 
+-	return uuid_generate_v35_internal(UUID_MAKE_V5, ns, name);
++	return internal_uuid_create(5, (unsigned char *)ns,
++				VARDATA(name), VARSIZE(name) - VARHDRSZ);
+ }

Deleted: trunk/databases/postgresql92-server/files/patch-plpython-Makefile
===================================================================
--- trunk/databases/postgresql92-server/files/patch-plpython-Makefile	2014-09-16 23:14:28 UTC (rev 17359)
+++ trunk/databases/postgresql92-server/files/patch-plpython-Makefile	2014-09-17 12:10:27 UTC (rev 17360)
@@ -1,11 +0,0 @@
---- src/pl/plpython/Makefile.orig	Fri Nov 19 20:23:01 2004
-+++ src/pl/plpython/Makefile	Tue Dec 28 23:32:16 2004
-@@ -9,7 +9,7 @@
- # shared library.  Since there is no official way to determine this
- # (at least not in pre-2.3 Python), we see if there is a file that is
- # named like a shared library.
--ifneq (,$(wildcard $(python_libdir)/libpython*$(DLSUFFIX)*))
-+ifneq (,$(wildcard $(python_libdir)/../../libpython*$(DLSUFFIX)*))
- shared_libpython = yes
- endif
- 

Modified: trunk/databases/postgresql92-server/pkg-plist-contrib
===================================================================
--- trunk/databases/postgresql92-server/pkg-plist-contrib	2014-09-16 23:14:28 UTC (rev 17359)
+++ trunk/databases/postgresql92-server/pkg-plist-contrib	2014-09-17 12:10:27 UTC (rev 17360)
@@ -45,7 +45,7 @@
 lib/postgresql/timetravel.so
 lib/postgresql/tsearch2.so
 lib/postgresql/unaccent.so
-%%OSSP%%lib/postgresql/uuid-ossp.so
+lib/postgresql/uuid-ossp.so
 %%DOCSDIR%%/README-contrib
 %%DOCSDIR%%/extension/README
 bin/pg_test_fsync
@@ -170,9 +170,9 @@
 share/postgresql/extension/unaccent--1.0.sql
 share/postgresql/extension/unaccent--unpackaged--1.0.sql
 share/postgresql/extension/unaccent.control
-%%OSSP%%share/postgresql/extension/uuid-ossp--1.0.sql
-%%OSSP%%share/postgresql/extension/uuid-ossp--unpackaged--1.0.sql
-%%OSSP%%share/postgresql/extension/uuid-ossp.control
+share/postgresql/extension/uuid-ossp--1.0.sql
+share/postgresql/extension/uuid-ossp--unpackaged--1.0.sql
+share/postgresql/extension/uuid-ossp.control
 share/postgresql/extension/xml2--1.0.sql
 share/postgresql/extension/xml2--unpackaged--1.0.sql
 share/postgresql/extension/xml2.control

Modified: trunk/databases/postgresql92-server/pkg-plist-server
===================================================================
--- trunk/databases/postgresql92-server/pkg-plist-server	2014-09-16 23:14:28 UTC (rev 17359)
+++ trunk/databases/postgresql92-server/pkg-plist-server	2014-09-17 12:10:27 UTC (rev 17360)
@@ -369,6 +369,7 @@
 %%TZDATA%%share/postgresql/timezone/Antarctica/Rothera
 %%TZDATA%%share/postgresql/timezone/Antarctica/South_Pole
 %%TZDATA%%share/postgresql/timezone/Antarctica/Syowa
+%%TZDATA%%share/postgresql/timezone/Antarctica/Troll
 %%TZDATA%%share/postgresql/timezone/Antarctica/Vostok
 %%TZDATA%%share/postgresql/timezone/Arctic/Longyearbyen
 %%TZDATA%%share/postgresql/timezone/Asia/Aden



More information about the Midnightbsd-cvs mailing list