NetBSD Problem Report #48505

From khorben@defora.org  Tue Jan  7 18:45:35 2014
Return-Path: <khorben@defora.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "Postmaster NetBSD.org" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id C9643A6472
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  7 Jan 2014 18:45:35 +0000 (UTC)
Message-Id: <20140107184339.35EB019A36@sleak.defora.rom>
Date: Tue,  7 Jan 2014 19:43:39 +0100 (CET)
From: Pierre Pronchery <khorben@defora.org>
To: gnats-bugs@gnats.NetBSD.org
Subject: PostgreSQL's contrib additions are not packaged
X-Send-Pr-Version: 3.95

>Number:         48505
>Category:       pkg
>Synopsis:       The server packages for PostgreSQL in pkgsrc do not install contrib code
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    adam
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 07 18:50:00 +0000 2014
>Closed-Date:    Thu Jun 01 02:43:09 +0000 2017
>Last-Modified:  Thu Jun 01 02:43:09 +0000 2017
>Originator:     Pierre Pronchery
>Release:        NetBSD 6.1_STABLE/pkgsrc 2013Q1 (from EdgeBSD)
>Organization:
>Environment:
System: NetBSD 6.1_STABLE NetBSD 6.1_STABLE/pkgsrc 2013Q1 (from EdgeBSD)
Architecture: x86_64
Machine: amd64
>Description:
PostgreSQL proposes a number of non-essential extensions and additions within
the "contrib" folder of its redistributable source archive. While not absolutely
necessary, they can be welcome additions in a number of cases, but they are not
packaged as part of pkgsrc. Using the pg_trgm extension from this directory
myself, I think it would be great to have a way to package them.

I can imagine at least three ways to implement it:

1. Simply build and install all of the contrib/ directory inconditionally;
2. Add a "contrib" option to the packages (and then handle PLIST etc)
3. Add a databases/postgresqlXY-contrib package for each version

I believe #3 is the most elegant, and it seems that packages from Joyent doing
exactly this are available already, see:
https://github.com/joyent/pkgsrc-joyent/tree/master/postgresql91-contrib

>How-To-Repeat:
# createdb -U pgsql pgsql
# psql -U pgsql pgsql
pgsql=# CREATE EXTENSION pg_trgm;
ERROR:  could not open extension control file "/usr/pkg/share/postgresql/extension/pg_trgm.control": No such file or directory
>Fix:
A quick and dirty work-around for pg_trgm:

diff --git a/databases/postgresql91-server/Makefile b/databases/postgresql91-server/Makefile
index fb8ca0e..8b02e18 100644
--- a/databases/postgresql91-server/Makefile
+++ b/databases/postgresql91-server/Makefile
@@ -16,6 +16,7 @@ INSTALL_DIRS+=	src/backend/utils/mb/conversion_procs
 INSTALL_DIRS+=	src/backend/snowball
 INSTALL_DIRS+=	src/timezone
 INSTALL_DIRS+=	src/pl
+INSTALL_DIRS+=	contrib/pg_trgm
 BUILD_DIRS=	src/port
 BUILD_DIRS+=	${INSTALL_DIRS}

diff --git a/databases/postgresql91-server/PLIST b/databases/postgresql91-server/PLIST
index 1237920..04dfa41 100644
--- a/databases/postgresql91-server/PLIST
+++ b/databases/postgresql91-server/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.6.2.1 2013/04/09 10:33:32 tron Exp $
+@comment $NetBSD$
 bin/postgres
 bin/postmaster
 lib/postgresql/ascii_and_mic.so
@@ -12,6 +12,7 @@ lib/postgresql/euc_tw_and_big5.so
 lib/postgresql/latin2_and_win1250.so
 lib/postgresql/latin_and_mic.so
 lib/postgresql/libpqwalreceiver.so
+lib/postgresql/pg_trgm.so
 lib/postgresql/plpgsql.so
 lib/postgresql/utf8_and_ascii.so
 lib/postgresql/utf8_and_big5.so
@@ -56,6 +57,9 @@ share/locale/zh_CN/LC_MESSAGES/postgres-9.1.mo
 share/locale/zh_TW/LC_MESSAGES/plpgsql-9.1.mo
 share/locale/zh_TW/LC_MESSAGES/postgres-9.1.mo
 share/postgresql/conversion_create.sql
+share/postgresql/extension/pg_trgm--1.0.sql
+share/postgresql/extension/pg_trgm--unpackaged--1.0.sql
+share/postgresql/extension/pg_trgm.control
 share/postgresql/extension/plpgsql--1.0.sql
 share/postgresql/extension/plpgsql--unpackaged--1.0.sql
 share/postgresql/extension/plpgsql.control

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->adam
Responsible-Changed-By: obache@NetBSD.org
Responsible-Changed-When: Wed, 08 Jan 2014 03:07:04 +0000
Responsible-Changed-Why:
Over to maintainer.


State-Changed-From-To: open->closed
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Thu, 01 Jun 2017 02:43:09 +0000
State-Changed-Why:
databases/postgresql*-contrib provides this as of June 2016


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.