Bug 213038 - Uses/postgis.mk: new framework for databases/postgis*
Summary: Uses/postgis.mk: new framework for databases/postgis*
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports mailing list
URL: https://trac.osgeo.org/postgis/wiki/U...
Keywords: feature, needs-qa
Depends on: 222339
  Show dependency treegraph
Reported: 2016-09-28 04:28 UTC by Loïc Bartoletti
Modified: 2019-01-15 21:51 UTC (History)
8 users (show)

See Also:
koobs: maintainer-feedback? (lbartoletti)

new framework: postgis.mk (8.57 KB, patch)
2016-09-28 04:28 UTC, Loïc Bartoletti
no flags Details | Diff
new framework: postgis.mk (11.83 KB, patch)
2016-11-16 22:18 UTC, Loïc Bartoletti
no flags Details | Diff
postgis.mk (4.92 KB, text/x-makefile)
2017-11-04 18:26 UTC, Loïc Bartoletti
lbartoletti: maintainer-approval+
PostGreSQL option to install a version between an interval (728 bytes, text/x-makefile)
2017-11-04 18:27 UTC, Loïc Bartoletti
lbartoletti: maintainer-approval+
Add postgis into bsd.default-versions (513 bytes, text/x-makefile)
2017-11-04 18:28 UTC, Loïc Bartoletti
lbartoletti: maintainer-approval+

Note You need to log in before you can comment on or make changes to this bug.
Description Loïc Bartoletti freebsd_committer 2016-09-28 04:28:39 UTC
Created attachment 175219 [details]
new framework: postgis.mk


As exposed on some databases/postgis* bugs (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206049#c5 and https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209478#c3). I propose an infrastructure framework for this ports.

PostGis is not compatible with all versions of PostGreSQL (https://trac.osgeo.org/postgis/wiki/UsersWikiPostgreSQLPostGIS). So postgis.mk can check if a version of postgis is already installed and compatible, and check if postgresql is compatible too.

What I've done:
- Create the  Uses file (Mk/Uses/postgis.mk)
- Add a default version of postgis (Mk/bsd.default-versions.mk)
- Modify all postgis Makefile. There may a problem with postgis21 which require a PGSQL version between 9.1 and 9.4 (Uses= pgsql:9.1+ pgsql:9.4- is it correct? Can we have bounded versions?)
- Modify all dependent ports (Qgis, Pgrouting)

It seems to works for me tested with some pgsql and postgis versions.
But I prefer request some help from mentors, so can you check this framework and help me to test it?

Thank you in advance.

Comment 1 Mathieu Arnold freebsd_committer 2016-09-28 07:49:15 UTC
Can more than one version of postgis be installed ? If not, can you add a POSTGIS_DEFAULT to bsd.default-versions.mk ?
Comment 2 Loïc Bartoletti freebsd_committer 2016-09-28 15:46:24 UTC
No, only one version can be installed.

Unless I am mistaken, there is a POSTGIS_DEFAULT into my patch

+# PostGis default must be compatible with PGSQL_DEFAULT
+POSTGIS_DEFAULT?=       2.2
Comment 3 Mathieu Arnold freebsd_committer 2016-09-28 15:50:48 UTC
Oh, yes, sorry, I missed it :-D
Comment 4 Mathieu Arnold freebsd_committer 2016-09-28 15:52:29 UTC
Add the exp-run flag.
Comment 5 Antoine Brodin freebsd_committer 2016-09-28 22:01:55 UTC
I don't believe the 
+.include "${PORTSDIR}/Mk/bsd.default-versions.mk"
is necessary, bsd.port.mk does it already

${PORTSDIR}/Mk/Uses/ should be spelled ${USESDIR}/

USES=... pgsql:9.1+ pgsql:9.4-

The 2nd pgsql:9.4- doesn't do anything
Comment 6 Mathieu Arnold freebsd_committer 2016-09-29 13:57:58 UTC
Yes, don't include bsd.default-versions.mk, it is already done for you.
Comment 7 Loïc Bartoletti freebsd_committer 2016-10-20 05:02:24 UTC
(In reply to Antoine Brodin from comment #5)
OK I'll make the changes for include and USEDIR.

For USES=... pgsql:9.1+ pgsql:9.4-
In fact, perhaps I can suggest a change in the search for the version of pgsql (Uses/pgsql.mk). As you can see, postgis need bounded versions (9.1->9.4 for this example). I have not been able to find an equivalent in other ports. Any suggestions?
Comment 8 Mathieu Arnold freebsd_committer 2016-10-20 07:39:42 UTC
You can't use the same USES more than once one, so if you need something like pgsql:9.1-9.4, pgsql.mk needs to grow the functionnality.
Comment 9 Loïc Bartoletti freebsd_committer 2016-11-16 22:18:36 UTC
Created attachment 177091 [details]
new framework: postgis.mk

New proposition of patch.
- Some fix to postgis.mk
- Feature for pgsql.mk. Now you can determine min and max versions like this: USES= pgsql:9.1-9.4
- Change postgis' ports or dependent of one version of postgis

I have tested to install each version with each version of postgresql, seems ok.
Comment 10 Loïc Bartoletti freebsd_committer 2017-01-04 19:17:42 UTC
Since some ports depending of postgis are update (especially QGis). Would you like separate patches? One for postgresql.mk, one for postgis.mk and one for each port?
Comment 11 Loïc Bartoletti freebsd_committer 2017-02-11 06:52:05 UTC
Any news or suggestions?
Comment 12 Rainer Hurling 2017-02-11 07:01:50 UTC
(In reply to lbartoletti from comment #11)

I can only speak for databases/postgis22 and graphics/qgis. Both where updated in the meantime.

The dependency for graphics/qgis is databases/postgis22 now (instead of postgis21).

I really like the idea of your patches and am looking forward to it :)
Comment 13 Chris Hutchinson 2017-10-27 01:25:30 UTC
Just wanted to take the time to throw in a +1 on all the
time, and work you put into this, @lbartoletti.
Thank you, and looking forward to seeing it incorporated soon! :)

Comment 14 Mathieu Arnold freebsd_committer 2017-10-27 12:01:26 UTC
While including pgsql.mk from postgis.mk is ok, you should probably not remove all the USES=pgsql from the ports.
Comment 15 Loïc Bartoletti freebsd_committer 2017-10-30 05:22:21 UTC
OK. I will update the patch.

Mathieu isn't there a risk that this could result in conflicts?

Imagine something like this:
USES= postgis:2.0 pgsql:9.3+

Which isn't possible.
Comment 16 Mathieu Arnold freebsd_committer 2017-10-30 08:53:46 UTC
Well, sure, conflicts could arise, it should just error out, saying "you asked for pg version xx and postgis yy needs zz"
Comment 17 Loïc Bartoletti freebsd_committer 2017-11-04 18:26:22 UTC
Created attachment 187734 [details]

Remove old patch including postgis24 #222703
Comment 18 Loïc Bartoletti freebsd_committer 2017-11-04 18:27:30 UTC
Created attachment 187735 [details]
PostGreSQL option to install a version between an interval
Comment 19 Loïc Bartoletti freebsd_committer 2017-11-04 18:28:26 UTC
Created attachment 187736 [details]
Add postgis into bsd.default-versions

Depends on postgis24 #222703
Comment 20 Loïc Bartoletti freebsd_committer 2017-11-04 18:35:53 UTC
I will update ports depending of postgis later.
Also pgsql.mk don't include my previous patch for plpython #222094
Comment 21 Rodrigo Osorio freebsd_committer 2017-12-19 13:15:28 UTC
mat@, does the exp-run has been performed ?
Comment 22 Loïc Bartoletti freebsd_committer 2018-02-03 07:43:27 UTC
Hi, any news?

Comment 23 Loïc Bartoletti freebsd_committer 2018-11-03 08:03:41 UTC
I think we can close this ticket when https://reviews.freebsd.org/D17320 will be merged.
Comment 24 Kubilay Kocak freebsd_committer freebsd_triage 2018-11-03 08:09:30 UTC
It appears this issue is for a new postgis framework, but the changes in the review mentioned in comment 23 do not include framework additions/changes.

If that's the case, I would recommend:

- Updating the title here to match the review
- Obsoleting all the patches here
- Adding the review URL to this issues URL field
Comment 25 Loïc Bartoletti freebsd_committer 2018-11-10 08:27:10 UTC
In fact, my patch in the review makes this ticket obsolete since only one version of postgis will be maintained.
Comment 26 commit-hook freebsd_committer 2019-01-15 21:51:30 UTC
A commit references this bug:

Author: crees
Date: Tue Jan 15 21:50:55 UTC 2019
New revision: 490431
URL: https://svnweb.freebsd.org/changeset/ports/490431

  Add facility to give a range of allowable versions for postgresql

  PR:		ports/213038
  PR:		ports/234813
  Submitted by:	lbartoletti@tuxfamily.org
  Differential Revision:	https://reviews.freebsd.org/D18818