On Fri, Nov 16, 2012 at 04:01:58PM -0600, Amit Kulkarni wrote: > this moves the currently broken postgis to operational status. > > this diff is originally by eric@, i just updated to 2.0.1 > > added a BUILD_DEPENDS on textproc/libxslt because in the fake stage it is > being used to convert the .xml into .sql > > sorted the order of LIB_DEPENDS
Here is a diff that has actually been really tested - i'm pretty sure you didnt even run it, nor tried to run the regress tests. Making a port build is one thing, checking that it does what it's supposed to is another. > +BUILD_DEPENDS= textproc/libxslt Missing build depends on docbook-xsl and ImageMagick > +LIB_DEPENDS= databases/postgresql \ > + devel/json-c \ > + devel/proj \ > + geo/gdal \ > + geo/geos \ > + graphics/jasper What's the point of all those when json-c and gdal are enough ? And it's also quite nice to have the html doc generated; and the manpages installed. Added a README explaining how to LD_PRELOAD libpthread.so since it's required by postgis, and also provide a working do-regress target that doesnt need manual intervention by the user. Taking maintainership from eric@ since he doesn't use it anymore. Landry
? patches/patches Index: Makefile =================================================================== RCS file: /cvs/ports/geo/postgis/Makefile,v retrieving revision 1.12 diff -u -r1.12 Makefile --- Makefile 24 Sep 2012 19:54:54 -0000 1.12 +++ Makefile 22 Nov 2012 18:38:59 -0000 @@ -3,14 +3,12 @@ SHARED_ONLY= Yes COMMENT= geographic objects support for PostgreSQL -DISTNAME= postgis-1.5.3 +DISTNAME= postgis-2.0.1 CATEGORIES= geo databases HOMEPAGE= http://www.postgis.org/ -MAINTAINER= Eric Faurot <e...@openbsd.org> - -BROKEN= Doesn't build with PostgreSQL 9.2 +MAINTAINER= Landry Breuil <lan...@openbsd.org> # GPLv2 PERMIT_PACKAGE_CDROM= Yes @@ -21,39 +19,42 @@ MASTER_SITES= ${HOMEPAGE}download/ WANTLIB= c geos_c m pq>=5.3 proj xml2 z +WANTLIB += com_err crypto curl expat gdal geos geotiff gif idn +WANTLIB += jasper jpeg json png pthread ssl stdc++ tiff -MODULES= converters/libiconv +MODULES = devel/gettext -LIB_DEPENDS= devel/proj \ - databases/postgresql \ - geo/geos +LIB_DEPENDS= geo/gdal \ + devel/json-c RUN_DEPENDS= databases/postgresql,-server -BUILD_DEPENDS= ${RUN_DEPENDS} +BUILD_DEPENDS= ${RUN_DEPENDS} \ + textproc/libxslt \ + textproc/docbook-xsl \ + graphics/ImageMagick USE_GMAKE= Yes -CONFIGURE_ENV= PGXS=1 \ - LDFLAGS='-L${LOCALBASE}/lib -pthread' \ +#for iconv.h +CONFIGURE_ENV= LDFLAGS=-L${LOCALBASE}/lib \ CFLAGS=-I${LOCALBASE}/include CONFIGURE_STYLE=gnu -CONFIGURE_ARGS= --datadir=${PREFIX}/share/postgresql/contrib \ +CONFIGURE_ARGS= --with-xsldir=${PREFIX}/share/xsl/docbook/ \ --libdir=${PREFIX}/lib/postgresql -USE_GROFF = Yes - -post-install: - ${INSTALL_SCRIPT_DIR} ${PREFIX}/libexec/postgis/utils - ${INSTALL_SCRIPT} ${WRKSRC}/utils/*.pl ${PREFIX}/libexec/postgis/utils - ${INSTALL_DATA} ${WRKSRC}/utils/README ${PREFIX}/libexec/postgis/utils - cd ${WRKSRC}/doc && WRKINST=${WRKINST} ${MAKE_PROGRAM} install - -# Note on running regress -# -# - make sure you do not have a postgresql server currently running -# - as user _postgresql, in another terminal, run: -# $ mkdir /tmp/pg && initdb -D /tmp/pg -U postgres && postgres -D /tmp/pg -# - run make regress +USE_LIBTOOL = Yes -do-regress: install - cd ${WRKSRC}/regress && PGUSER=postgres ${MAKE_PROGRAM} +DOCDIR = ${PREFIX}/share/doc/postgresql/postgis/ +post-install: + cd ${WRKSRC}/doc && WRKINST=${WRKINST} ${MAKE_PROGRAM} docs-install man-install + ${INSTALL_DATA_DIR} ${DOCDIR}/images/ + $(INSTALL_DATA) ${WRKSRC}/doc/html/style.css ${DOCDIR}/ + $(INSTALL_DATA) ${WRKSRC}/doc/html/images/* ${DOCDIR}/images/ + +# the garden regress suite needs postgis installed +do-regress: + regdir=$$(mktemp -t -d postgis-regress.XXXX) && \ + LC_CTYPE=C initdb -D $${regdir} && \ + LD_PRELOAD=libpthread.so pg_ctl -D $${regdir} -o '-p 12341' -l $${regdir}/log start && \ + cd ${WRKSRC}/regress && PGPORT=12341 ${MAKE_PROGRAM} check || \ + pg_ctl -D $${regdir} -o '-p 12341' stop -m fast .include <bsd.port.mk> Index: distinfo =================================================================== RCS file: /cvs/ports/geo/postgis/distinfo,v retrieving revision 1.5 diff -u -r1.5 distinfo --- distinfo 21 Sep 2011 14:13:32 -0000 1.5 +++ distinfo 22 Nov 2012 18:38:59 -0000 @@ -1,5 +1,2 @@ -MD5 (postgis-1.5.3.tar.gz) = BaYd9eG3i/UcnOmL6lUm/A== -RMD160 (postgis-1.5.3.tar.gz) = 4wJ1iQsXXL4dcNWJnL5F7DTduvs= -SHA1 (postgis-1.5.3.tar.gz) = 6MVy4CWLp2Cme39xe9yDIbn2zVg= -SHA256 (postgis-1.5.3.tar.gz) = ojNPiyKURsBJfUikMKQBUqO3Gl2gL0FKA0CgoCXUFs8= -SIZE (postgis-1.5.3.tar.gz) = 3779956 +SHA256 (postgis-2.0.1.tar.gz) = MtGBu/DmSP4xyVs90j9+TkkJTZPLQnj99xyP7tTpWTw= +SIZE (postgis-2.0.1.tar.gz) = 5373194 Index: patches/patch-doc_Makefile_in =================================================================== RCS file: patches/patch-doc_Makefile_in diff -N patches/patch-doc_Makefile_in --- patches/patch-doc_Makefile_in 4 Nov 2010 13:45:54 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,48 +0,0 @@ -$OpenBSD: patch-doc_Makefile_in,v 1.2 2010/11/04 13:45:54 eric Exp $ ---- doc/Makefile.in.orig Sun Sep 19 14:21:28 2010 -+++ doc/Makefile.in Tue Nov 2 17:59:04 2010 -@@ -41,25 +41,14 @@ DBLATEX=@DBLATEX@ - IMAGEMAGICK=@IMAGEMAGICK@ - - # Directories for postgresql subdirectories --PGSQL_DOCDIR=@PGSQL_DOCDIR@ --PGSQL_MANDIR=@PGSQL_MANDIR@ -+PGSQL_DOCDIR=${WRKINST}@PGSQL_DOCDIR@ -+PGSQL_MANDIR=${WRKINST}@PGSQL_MANDIR@ - PGSQL_SHAREDIR=@PGSQL_SHAREDIR@ - -+ - # If XSLTPROC or XSLBASE were not found during configure, we cannot - # build the documentation --ifeq ($(XSLTPROC),) --all: requirements_not_met_xsltproc --else --ifeq ($(XSLBASE),) --all: requirements_not_met_xslbase --else --ifeq ($(IMAGEMAGICK),) --all: requirements_not_met_imagemagick --else --all: images html/postgis.html postgis_comments.sql --endif --endif --endif -+all: - - postgis_aggs_mm.xml: ./xsl/postgis_aggs_mm.xml.xsl postgis.xml - $(XSLTPROC) ./xsl/postgis_aggs_mm.xml.xsl postgis.xml > $@ -@@ -130,10 +119,13 @@ comments-install: comments - comments-uninstall: - make -f Makefile.comments uninstall - --install: html/postgis.html man/shp2pgsql.1 man/pgsql2shp.1 -+install: - @mkdir -p $(PGSQL_DOCDIR)/postgis -+ @mkdir -p $(PGSQL_DOCDIR)/postgis/images - @mkdir -p $(PGSQL_MANDIR)/man1 -+ cp html/images/* $(PGSQL_DOCDIR)/postgis/images/ - cp html/postgis.html $(PGSQL_DOCDIR)/postgis/postgis.html -+ cp html/style.css $(PGSQL_DOCDIR)/postgis/style.css - cp ../README.postgis $(PGSQL_DOCDIR)/postgis/README.postgis - cp man/pgsql2shp.1 $(PGSQL_MANDIR)/man1/pgsql2shp.1 - cp man/shp2pgsql.1 $(PGSQL_MANDIR)/man1/shp2pgsql.1 Index: patches/patch-loader_Makefile_in =================================================================== RCS file: patches/patch-loader_Makefile_in diff -N patches/patch-loader_Makefile_in --- patches/patch-loader_Makefile_in 4 Nov 2010 13:45:54 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -$OpenBSD: patch-loader_Makefile_in,v 1.2 2010/11/04 13:45:54 eric Exp $ ---- loader/Makefile.in.orig Fri Oct 8 16:08:26 2010 -+++ loader/Makefile.in Fri Oct 8 16:08:13 2010 -@@ -35,7 +35,7 @@ PGSQL_FE_CPPFLAGS=@PGSQL_FE_CPPFLAGS@ - PGSQL_FE_LDFLAGS=@PGSQL_FE_LDFLAGS@ - - # iconv flags --ICONV_LDFLAGS=@ICONV_LDFLAGS@ -+ICONV_LDFLAGS=-L${LOCALBASE}/lib @ICONV_LDFLAGS@ - ICONV_CFLAGS=@ICONV_CFLAGS@ - - # liblwgeom Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/geo/postgis/pkg/PLIST,v retrieving revision 1.5 diff -u -r1.5 PLIST --- pkg/PLIST 21 Sep 2011 14:13:32 -0000 1.5 +++ pkg/PLIST 22 Nov 2012 18:38:59 -0000 @@ -1,27 +1,23 @@ @comment $OpenBSD: PLIST,v 1.5 2011/09/21 14:13:32 pea Exp $ @bin bin/pgsql2shp +@bin bin/raster2pgsql @bin bin/shp2pgsql -lib/postgresql/postgis-1.5.so -libexec/postgis/ -libexec/postgis/utils/ -libexec/postgis/utils/README -libexec/postgis/utils/create_undef.pl -libexec/postgis/utils/new_postgis_restore.pl -libexec/postgis/utils/postgis_proc_upgrade.pl -libexec/postgis/utils/postgis_restore.pl -libexec/postgis/utils/profile_intersects.pl -libexec/postgis/utils/read_scripts_version.pl -libexec/postgis/utils/test_estimation.pl -libexec/postgis/utils/test_geography_estimation.pl -libexec/postgis/utils/test_geography_joinestimation.pl -libexec/postgis/utils/test_joinestimation.pl +include/liblwgeom.h +lib/postgresql/liblwgeom-2.0.1.so +@comment lib/postgresql/liblwgeom.a +@comment lib/postgresql/liblwgeom.la +lib/postgresql/liblwgeom.so +lib/postgresql/postgis-2.0.so +lib/postgresql/rtpostgis-2.0.so @man man/man1/pgsql2shp.1 @man man/man1/shp2pgsql.1 share/doc/postgresql/ share/doc/postgresql/postgis/ share/doc/postgresql/postgis/README.postgis share/doc/postgresql/postgis/images/ +share/doc/postgresql/postgis/images/PostGIS_logo.png share/doc/postgresql/postgis/images/caution.png +share/doc/postgresql/postgis/images/ccbysa.png share/doc/postgresql/postgis/images/check.png share/doc/postgresql/postgis/images/de9im01.png share/doc/postgresql/postgis/images/de9im02.png @@ -41,6 +37,18 @@ share/doc/postgresql/postgis/images/matrix_checkmark.png share/doc/postgresql/postgis/images/matrix_transform.png share/doc/postgresql/postgis/images/note.png +share/doc/postgresql/postgis/images/osgeo_logo.png +share/doc/postgresql/postgis/images/raster_xscale_yscale_xskew_yskew.png +share/doc/postgresql/postgis/images/rt_st_transform01.png +share/doc/postgresql/postgis/images/rt_st_transform02.png +share/doc/postgresql/postgis/images/rt_st_transform03.png +share/doc/postgresql/postgis/images/st_asraster01.png +share/doc/postgresql/postgis/images/st_asraster02.png +share/doc/postgresql/postgis/images/st_azimuth01.png +share/doc/postgresql/postgis/images/st_azimuth02.png +share/doc/postgresql/postgis/images/st_band01.png +share/doc/postgresql/postgis/images/st_band02.png +share/doc/postgresql/postgis/images/st_band03.png share/doc/postgresql/postgis/images/st_buffer01.png share/doc/postgresql/postgis/images/st_buffer02.png share/doc/postgresql/postgis/images/st_buffer03.png @@ -55,8 +63,21 @@ share/doc/postgresql/postgis/images/st_centroid02.png share/doc/postgresql/postgis/images/st_centroid03.png share/doc/postgresql/postgis/images/st_centroid04.png +share/doc/postgresql/postgis/images/st_clip01.png +share/doc/postgresql/postgis/images/st_clip02.png +share/doc/postgresql/postgis/images/st_clip03.png +share/doc/postgresql/postgis/images/st_clip04.png +share/doc/postgresql/postgis/images/st_clip05.png share/doc/postgresql/postgis/images/st_closestpoint01.png share/doc/postgresql/postgis/images/st_closestpoint02.png +share/doc/postgresql/postgis/images/st_concavehull01.png +share/doc/postgresql/postgis/images/st_concavehull02.png +share/doc/postgresql/postgis/images/st_concavehull03.png +share/doc/postgresql/postgis/images/st_concavehull04.png +share/doc/postgresql/postgis/images/st_concavehull05.png +share/doc/postgresql/postgis/images/st_concavehull06.png +share/doc/postgresql/postgis/images/st_concavehull07.png +share/doc/postgresql/postgis/images/st_concavehull08.png share/doc/postgresql/postgis/images/st_contains01.png share/doc/postgresql/postgis/images/st_contains02.png share/doc/postgresql/postgis/images/st_contains03.png @@ -86,6 +107,7 @@ share/doc/postgresql/postgis/images/st_isvalid06.png share/doc/postgresql/postgis/images/st_isvalid07.png share/doc/postgresql/postgis/images/st_isvalid08.png +share/doc/postgresql/postgis/images/st_isvalid09.png share/doc/postgresql/postgis/images/st_line_interpolate_point01.png share/doc/postgresql/postgis/images/st_line_substring01.png share/doc/postgresql/postgis/images/st_linecrossingdirection01.png @@ -95,9 +117,46 @@ share/doc/postgresql/postgis/images/st_longestline01.png share/doc/postgresql/postgis/images/st_longestline02.png share/doc/postgresql/postgis/images/st_longestline03.png +share/doc/postgresql/postgis/images/st_mapalgebraexpr01.png +share/doc/postgresql/postgis/images/st_mapalgebraexpr02.png +share/doc/postgresql/postgis/images/st_mapalgebraexpr2_01.png +share/doc/postgresql/postgis/images/st_mapalgebraexpr2_02.png +share/doc/postgresql/postgis/images/st_mapalgebraexpr2_04.png +share/doc/postgresql/postgis/images/st_mapalgebraexpr2_05.png +share/doc/postgresql/postgis/images/st_mapalgebraexpr2_06.png +share/doc/postgresql/postgis/images/st_mapalgebraexpr2_07.png +share/doc/postgresql/postgis/images/st_mapalgebraexpr2_08.png +share/doc/postgresql/postgis/images/st_mapalgebrafct2_01.png +share/doc/postgresql/postgis/images/st_mapalgebrafct2_02.png +share/doc/postgresql/postgis/images/st_mapalgebrafctngb01.png +share/doc/postgresql/postgis/images/st_mapalgebrafctngb02.png share/doc/postgresql/postgis/images/st_minimumboundingcircle01.png +share/doc/postgresql/postgis/images/st_offsetcurve01.png +share/doc/postgresql/postgis/images/st_offsetcurve02.png +share/doc/postgresql/postgis/images/st_offsetcurve03.png +share/doc/postgresql/postgis/images/st_offsetcurve04.png +share/doc/postgresql/postgis/images/st_offsetcurve05.png +share/doc/postgresql/postgis/images/st_offsetcurve06.png +share/doc/postgresql/postgis/images/st_overlaps01.png +share/doc/postgresql/postgis/images/st_overlaps02.png +share/doc/postgresql/postgis/images/st_overlaps03.png +share/doc/postgresql/postgis/images/st_resample01.png +share/doc/postgresql/postgis/images/st_resample02.png +share/doc/postgresql/postgis/images/st_rescale01.png +share/doc/postgresql/postgis/images/st_rescale02.png +share/doc/postgresql/postgis/images/st_sharedpaths01.png +share/doc/postgresql/postgis/images/st_sharedpaths02.png share/doc/postgresql/postgis/images/st_shortestline01.png share/doc/postgresql/postgis/images/st_shortestline02.png +share/doc/postgresql/postgis/images/st_snap01.png +share/doc/postgresql/postgis/images/st_snap02.png +share/doc/postgresql/postgis/images/st_snap03.png +share/doc/postgresql/postgis/images/st_snap04.png +share/doc/postgresql/postgis/images/st_snap05.png +share/doc/postgresql/postgis/images/st_split01.png +share/doc/postgresql/postgis/images/st_split02.png +share/doc/postgresql/postgis/images/st_split03.png +share/doc/postgresql/postgis/images/st_split04.png share/doc/postgresql/postgis/images/st_symdifference01.png share/doc/postgresql/postgis/images/st_symdifference02.png share/doc/postgresql/postgis/images/st_touches-math.gif @@ -113,10 +172,54 @@ share/doc/postgresql/postgis/postgis.html share/doc/postgresql/postgis/style.css share/postgresql/contrib/ -share/postgresql/contrib/postgis-1.5/ -share/postgresql/contrib/postgis-1.5/postgis.sql -share/postgresql/contrib/postgis-1.5/postgis_upgrade_13_to_15.sql -share/postgresql/contrib/postgis-1.5/postgis_upgrade_14_to_15.sql -share/postgresql/contrib/postgis-1.5/postgis_upgrade_15_minor.sql -share/postgresql/contrib/postgis-1.5/spatial_ref_sys.sql -share/postgresql/contrib/postgis-1.5/uninstall_postgis.sql +share/postgresql/contrib/postgis-2.0/ +share/postgresql/contrib/postgis-2.0/legacy.sql +share/postgresql/contrib/postgis-2.0/legacy_minimal.sql +share/postgresql/contrib/postgis-2.0/postgis.sql +share/postgresql/contrib/postgis-2.0/postgis_comments.sql +share/postgresql/contrib/postgis-2.0/postgis_restore.pl +share/postgresql/contrib/postgis-2.0/postgis_upgrade_20_minor.sql +share/postgresql/contrib/postgis-2.0/raster_comments.sql +share/postgresql/contrib/postgis-2.0/rtpostgis.sql +share/postgresql/contrib/postgis-2.0/rtpostgis_legacy.sql +share/postgresql/contrib/postgis-2.0/rtpostgis_upgrade_20_minor.sql +share/postgresql/contrib/postgis-2.0/spatial_ref_sys.sql +share/postgresql/contrib/postgis-2.0/topology.sql +share/postgresql/contrib/postgis-2.0/topology_comments.sql +share/postgresql/contrib/postgis-2.0/topology_upgrade_20_minor.sql +share/postgresql/contrib/postgis-2.0/uninstall_legacy.sql +share/postgresql/contrib/postgis-2.0/uninstall_postgis.sql +share/postgresql/contrib/postgis-2.0/uninstall_rtpostgis.sql +share/postgresql/contrib/postgis-2.0/uninstall_topology.sql +share/postgresql/extension/postgis--2.0.0--2.0.1.sql +share/postgresql/extension/postgis--2.0.0alpha1--2.0.1.sql +share/postgresql/extension/postgis--2.0.0alpha2--2.0.1.sql +share/postgresql/extension/postgis--2.0.0alpha3--2.0.1.sql +share/postgresql/extension/postgis--2.0.0alpha4--2.0.1.sql +share/postgresql/extension/postgis--2.0.0alpha5--2.0.1.sql +share/postgresql/extension/postgis--2.0.0alpha6--2.0.1.sql +share/postgresql/extension/postgis--2.0.0beta1--2.0.1.sql +share/postgresql/extension/postgis--2.0.0beta2--2.0.1.sql +share/postgresql/extension/postgis--2.0.0beta3--2.0.1.sql +share/postgresql/extension/postgis--2.0.0beta4--2.0.1.sql +share/postgresql/extension/postgis--2.0.0rc1--2.0.1.sql +share/postgresql/extension/postgis--2.0.0rc2--2.0.1.sql +share/postgresql/extension/postgis--2.0.1.sql +share/postgresql/extension/postgis--unpackaged--2.0.1.sql +share/postgresql/extension/postgis.control +share/postgresql/extension/postgis_topology--2.0.0--2.0.1.sql +share/postgresql/extension/postgis_topology--2.0.0alpha1--2.0.1.sql +share/postgresql/extension/postgis_topology--2.0.0alpha2--2.0.1.sql +share/postgresql/extension/postgis_topology--2.0.0alpha3--2.0.1.sql +share/postgresql/extension/postgis_topology--2.0.0alpha4--2.0.1.sql +share/postgresql/extension/postgis_topology--2.0.0alpha5--2.0.1.sql +share/postgresql/extension/postgis_topology--2.0.0alpha6--2.0.1.sql +share/postgresql/extension/postgis_topology--2.0.0beta1--2.0.1.sql +share/postgresql/extension/postgis_topology--2.0.0beta2--2.0.1.sql +share/postgresql/extension/postgis_topology--2.0.0beta3--2.0.1.sql +share/postgresql/extension/postgis_topology--2.0.0beta4--2.0.1.sql +share/postgresql/extension/postgis_topology--2.0.0rc1--2.0.1.sql +share/postgresql/extension/postgis_topology--2.0.0rc2--2.0.1.sql +share/postgresql/extension/postgis_topology--2.0.1.sql +share/postgresql/extension/postgis_topology--unpackaged--2.0.1.sql +share/postgresql/extension/postgis_topology.control Index: pkg/README =================================================================== RCS file: pkg/README diff -N pkg/README --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pkg/README 22 Nov 2012 18:38:59 -0000 @@ -0,0 +1,13 @@ +Postgis requires pthreads in order to work. OpenBSD does not allow +shared objects that link to pthreads to be opened via dlopen if the +executable program does not link to pthreads. So to use postgis, you +must ensure that libpthread is loaded before PostgreSQL. +The easiest way to do this is adding the following login class +to login.conf: + +postgresql:\ + :setenv=LD_PRELOAD=libpthread.so:\ + :tc=daemon: + +the PostgreSQL rc.d(8) script will take care of launching the daemon +with that login class.