Bug 189384

Summary: databases/postgis21 doesn't compile, and doesn't function when compiled without RASTER
Product: Ports & Packages Reporter: David King <dking>
Component: Individual Port(s)Assignee: Rodrigo Osorio <rodrigo>
Status: Closed FIXED    
Severity: Affects Only Me CC: andy, harrison.grundy, rodrigo, trevor
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description David King 2014-05-05 23:30:00 UTC
databases/postgis21 doesn't compile without the patch in PR-186563 (which works but hasn't been committed). But even after fixing that, postgis still doesn't work:

# sudo -u pgsql psql -d "my_db" -c "create extension postgis"
ERROR:  could not open extension control file "/usr/local/share/postgresql/extension/postgis.control": No such file or directory

And indeed, that file doesn't exist:

# find /usr/local -name postgis.control | wc -l
       0

Why? Because the pkg-plist for postgis21 lists half of its fundamental requirements as required by the RASTER option. An except of files that require RASTER that actually are required by *any* install of postgis:

%%RASTER%%share/postgresql/extension/postgis--2.1.0rc1--%%PORTVERSION%%.sql
%%RASTER%%share/postgresql/extension/postgis--2.1.0rc2--%%PORTVERSION%%.sql
%%RASTER%%share/postgresql/extension/postgis--2.1.0rc3--%%PORTVERSION%%.sql
%%RASTER%%share/postgresql/extension/postgis--unpackaged--%%PORTVERSION%%.sql
%%RASTER%%share/postgresql/extension/postgis.control

In the Makefile, %%RASTER%% is changed to comment out the plist line when RASTER isn't built:

.if ${PORT_OPTIONS:MRASTER}
.if ${OSVERSION} < 900033
BROKEN=                 Raster suppport is broken on FreeBSD < 9.x
.endif
LIB_DEPENDS+=           libgdal.so:${PORTSDIR}/graphics/gdal
CONFIGURE_ARGS+=        --with-raster --with-gdalconfig=${LOCALBASE}/bin/gdal-config
PLIST_SUB+=             RASTER=""
.else
CONFIGURE_ARGS+=        --without-raster
PLIST_SUB+=             RASTER="@comment "
.endif

RASTER is a very large requirement that pulls in gdal which pulls in image processing dependencies (which as you can imagine usually means pulling in X11). It's not a requirement of postgis in general

Fix: 

I imagine that the fix is to go through pkg-plist and remove %%RASTER%% where it doesn't make sense. I don't know postgis well enough to tell these apart myself
How-To-Repeat: Install databases/postgis21 (this may mean applying the long-outstanding patch from PR-186563 to resolve the compile error on iconv). Then try to use it with a command like:

# sudo -u pgsql psql -d "my_db" -c "create extension postgis;"
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-05-05 23:30:04 UTC
Maintainer of databases/postgis21,

Please note that PR ports/189384 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/189384

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2014-05-05 23:30:05 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 David King 2014-05-06 01:10:12 UTC
I stand corrected on the claim that extension support doesn't require RASTER: <http://postgis.net/docs/postgis_installation.html>

> The raster support is currently optional, but installed by default. For enabling using the PostgreSQL 9.1+ extensions model raster is required. Using the extension enable process is preferred and more user-friendly.
Comment 4 andy 2014-06-20 21:53:41 UTC
(In reply to dking from comment #3)
> > The raster support is currently optional, but installed by default. For enabling using the PostgreSQL 9.1+ extensions model raster is required. Using the extension enable process is preferred and more user-friendly.

In that case, RASTER should be enabled by default.
Comment 5 John Marino freebsd_committer freebsd_triage 2014-07-29 19:17:25 UTC
Adding maintainer back to discussion (lost in bugzilla conversion?)

anyway, what does trevor say about all this?
Comment 6 Rodrigo Osorio freebsd_committer freebsd_triage 2014-12-11 09:59:16 UTC
committed
Comment 7 Rodrigo Osorio freebsd_committer freebsd_triage 2014-12-11 10:01:25 UTC
wrong state, backup
Comment 8 Rodrigo Osorio freebsd_committer freebsd_triage 2015-04-25 17:53:28 UTC
Tested today, postgis21 compiles fine even with raster disabled.
If you have no objection, we can close this PR.
Comment 9 andy 2015-04-27 14:31:54 UTC
I haven't tested it myself, but I'll trust you that it works now. Go ahead and close it.
Comment 10 Harrison Grundy 2015-05-01 02:33:39 UTC
Testing here indicates that this no longer applies. Same from submitter.