Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Sep 2013 15:34:35 GMT
From:      Dennis <dennis.noordsij@helsinki.fi>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/182190: postgresql93-client not installing library needed for extensions
Message-ID:  <201309171534.r8HFYZbh059244@oldred.freebsd.org>
Resent-Message-ID: <201309171540.r8HFe01s015578@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         182190
>Category:       ports
>Synopsis:       postgresql93-client not installing library needed for extensions
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 17 15:40:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Dennis
>Release:        9.2-RC3
>Organization:
>Environment:
FreeBSD [redacted] 9.2-RC3-p1 FreeBSD 9.2-RC3-p1 #0: Mon Sep  9 19:37:31 UTC 2013     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
Postgresql 9.3.0 installs a library /usr/local/lib/libpgcommon.a, however this library is not installed by the relevant FreeBSD port.

This library is needed and expected when building extensions which are not built as part of the core, ie using pg_config. 

FreeBSD ports split postgresql into 3 ports (server, client, contrib), each building and installing a subset of postgresql.

libpgcommon.a should be installed in the system by either the -server or -client port.

(I don't think -contrib is the right dependency for building external modules. Based on the naming conventions of other installed pgsql libraries, my preference is for postgresql93-client)
>How-To-Repeat:
Install postgresql93-server, postgresql93-client, and postgresql93-server, and gmake.

Create a Makefile:
-----------
PGFILEDESC = "test"

PROGRAM = test
OBJS    = test.o

PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
-----------

"touch test.c"

run "gmake". 

result:
/usr/bin/ld: cannot find -lpgcommon


(Expected is of course: rt1.c:(.text+0x9d): undefined reference to `main', which is what you would get if libpgcommon.a existed)

(This is the boilerplate for a postgresql extension)

>Fix:
To add to postgresql93-client:

1)
Add "src/common" to the BUILD_DIRS in postgresql93-client/Makefile

2)
Add "lib/libpgcommon.a" to postgresql93-server/pkg-plist-client






To add to postgresql93-server:

1)
Add "src/common" to the BUILD_DIRS. Note that postgresql93-server/Makefile simply includes this from postgresql92-server/Makefile (I don't know if 9.2  also has the src/common folder, so it might need to be added explicitly)

2)
Add "lib/libpgcommon.a" to postgresql93-server/pkg-plist-server



>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309171534.r8HFYZbh059244>