aboutsummaryrefslogtreecommitdiffstats
path: root/databases
diff options
context:
space:
mode:
authoredwin <edwin@FreeBSD.org>2005-01-14 06:53:39 +0800
committeredwin <edwin@FreeBSD.org>2005-01-14 06:53:39 +0800
commit260238acb10a2971b72173373fe3fcefa007ba53 (patch)
tree3a6f481d3946a83c0c4e44a6ef571058ce09ae07 /databases
parent9909bd8852934f1b26944ddfbb719d96bed371a2 (diff)
downloadfreebsd-ports-gnome-260238acb10a2971b72173373fe3fcefa007ba53.tar.gz
freebsd-ports-gnome-260238acb10a2971b72173373fe3fcefa007ba53.tar.zst
freebsd-ports-gnome-260238acb10a2971b72173373fe3fcefa007ba53.zip
Postgis upgrade from 0.9.0 to 0.9.1
Postgis upgrade from 0.9.0 to 0.9.1 Other changes: - Adds support to PostgreSQL 8 - Includes Postgis HTML documentation PR: ports/76214 Submitted by: Anderson S. Ferreira <anderson@cnpm.embrapa.br>
Diffstat (limited to 'databases')
-rw-r--r--databases/postgis/Makefile71
-rw-r--r--databases/postgis/distinfo4
-rw-r--r--databases/postgis/files/UPDATE14
-rw-r--r--databases/postgis/files/patch-a45
-rw-r--r--databases/postgis/files/patch-b13
-rw-r--r--databases/postgis/files/patch-c64
-rw-r--r--databases/postgis/files/updatedb.default5
-rw-r--r--databases/postgis/pkg-deinstall11
-rw-r--r--databases/postgis/pkg-install52
-rw-r--r--databases/postgis/pkg-message16
-rw-r--r--databases/postgis/pkg-plist19
11 files changed, 288 insertions, 26 deletions
diff --git a/databases/postgis/Makefile b/databases/postgis/Makefile
index 3b51b28f0fe9..1293fcd0f10e 100644
--- a/databases/postgis/Makefile
+++ b/databases/postgis/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= postgis
-PORTVERSION= 0.9.0
+PORTVERSION= 0.9.1
PORTREVISION= 1
CATEGORIES= databases
MASTER_SITES= http://postgis.refractions.net/
@@ -15,30 +15,69 @@ DISTNAME= postgis-${PORTVERSION}
MAINTAINER= anderson@cnpm.embrapa.br
COMMENT= Adds support for geographic objects to PostgreSQL databases
-BUILD_DEPENDS= ${PGSQL_SRC}/src/Makefile.global:${PORTSDIR}/databases/postgresql7:configure
-LIB_DEPENDS= proj.5:${PORTSDIR}/graphics/proj \
- pq:${PORTSDIR}/databases/postgresql7
+LIB_DEPENDS= proj.5:${PORTSDIR}/graphics/proj
USE_GMAKE= yes
USE_PERL5_BUILD= yes
-MAKE_ARGS= PGSQL_SRC=${PGSQL_SRC}
-OPTIONS= GEOS "Include GEOS - the OpenGIS 'Simple Features for SQL'" off
-
-PGSQL_PORTDIR= ${WRKDIR}/../../../databases/postgresql7
+PKGMESSAGE= pkg-message
WRKSRC= ${WRKDIR}/postgis-${PORTVERSION}
-PGSQL_SRC= ${PGSQL_PORTDIR}/work/postgresql-7.4.6
+PGSQL_SRC= ${WRKDIR}/pgsql/postgresql
+
INSTALL_TARGET= install
+INSTALLS_SHLIB= no
+
+OPTIONS= PGSQL8 "Use PostgreSQL 8 instead of PostgreSQL 7.4" off \
+ GEOS "Include GEOS - the OpenGIS 'Simple Features for SQL'" off \
+
+.include <bsd.port.pre.mk>
+
+MAKE_ARGS= PGSQL_SRC="${PGSQL_SRC}" \
+ DATADIR="${PREFIX}/share/postgis" \
+ BINDIR="${PREFIX}/bin" \
+ LIBDIR="${PREFIX}/lib"
+
+.if defined(WITH_PGSQL8)
+PGSQL_PORTDIR= ${PORTSDIR}/databases/postgresql-devel
+.else
+PGSQL_PORTDIR= ${PORTSDIR}/databases/postgresql7
+.endif
+
+LIB_DEPENDS+= pq.3:${PGSQL_PORTDIR}
+
+.if !defined(NOPORTDOCS)
+BUILD_DEPENDS+= xsltproc:${PORTSDIR}/textproc/libxslt \
+ ${LOCALBASE}/share/xsl/docbook/html/chunk.xsl:${PORTSDIR}/textproc/docbook-xsl
+MAKE_ARGS+= WITH-DOC=yes \
+ DOCSDIR="${DOCSDIR}"
+PORTDOCS= *
+.endif
.if defined(WITH_GEOS)
LIB_DEPENDS+= geos.2:${PORTSDIR}/graphics/geos
+MAKE_ARGS+= USE_GEOS=1
+.else
+MAKE_ARGS+= USE_GEOS=0
.endif
-post-extract:
-.if ! defined(WITH_GEOS)
- @ ${CP} ${WRKSRC}/Makefile ${WRKSRC}/Makefile.orig ; \
- ${CAT} ${WRKSRC}/Makefile.orig | \
- ${SED} "s|USE_GEOS=1|USE_GEOS=0|g" > ${WRKSRC}/Makefile
-.endif
+pre-everything::
+ @${SH} ${PKGINSTALL} ${PORTNAME} MESSAGE
+
+pre-configure:
+ @([ -d ${WRKDIR}/pgsql ] || ${MKDIR} ${WRKDIR}/pgsql) && \
+ cd ${PGSQL_PORTDIR} && \
+ ${MAKE} WRKDIR=${WRKDIR}/pgsql configure && \
+ ${MV} ${WRKDIR}/pgsql/postgresql* ${PGSQL_SRC} \
+
+post-install:
+ @ ${INSTALL_SCRIPT} ${FILESDIR}/updatedb.default ${PREFIX}/share/postgis
+ @ ${INSTALL_SCRIPT} ${FILESDIR}/UPDATE ${PREFIX}/share/postgis
+ @ ${SETENV} PKG_PREFIX=${PREFIX} \
+ ${SH} ${PKGINSTALL} ${PORTNAME} POST-INSTALL
+ @ ${CAT} ${PKGMESSAGE}
+
+post-deinstall:
+ @ ${SETENV} PKG_PREFIX=${PREFIX} \
+ ${SH} ${PKGDEINSTALL} ${PORTNAME} POST-DEINSTALL
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/databases/postgis/distinfo b/databases/postgis/distinfo
index 4bc6c5cdc191..5156e62cbb15 100644
--- a/databases/postgis/distinfo
+++ b/databases/postgis/distinfo
@@ -1,2 +1,2 @@
-MD5 (postgis-0.9.0.tar.gz) = 66fbdf0f2d30fb5a243be78f370f47d2
-SIZE (postgis-0.9.0.tar.gz) = 1265333
+MD5 (postgis-0.9.1.tar.gz) = 43264e90d013aea9ce8f3f0c3540ac32
+SIZE (postgis-0.9.1.tar.gz) = 491789
diff --git a/databases/postgis/files/UPDATE b/databases/postgis/files/UPDATE
new file mode 100644
index 000000000000..1478cf65c0f1
--- /dev/null
+++ b/databases/postgis/files/UPDATE
@@ -0,0 +1,14 @@
+Updating databases from old versions of Postgis
+
+Due the libpostgis.so.0 path modification, databases created with older
+versions of postgis won't work properly.
+To solve this problem, please, make a dump (on text format) of your database
+and use the PREFIX/share/updatedb script.
+
+ sh PREFIX/share/updatedb dump.sql
+
+A new file with '.updated' extension will be created with libpostgis
+references updated.
+After that you can restore your database using updated file.
+
+ psql -f dump.sql.updated database
diff --git a/databases/postgis/files/patch-a b/databases/postgis/files/patch-a
new file mode 100644
index 000000000000..a4b087664a67
--- /dev/null
+++ b/databases/postgis/files/patch-a
@@ -0,0 +1,45 @@
+--- doc/Makefile Thu Sep 9 17:51:32 2004
++++ doc/Makefile.new Wed Dec 29 09:49:05 2004
+@@ -5,14 +5,16 @@
+ postgis-out.xml: postgis.xml
+ cat $< | sed "s/@@LAST_RELEASE_VERSION@@/$(LAST_RELEASE_VERSION)/g" > $@
+
++# html/ch01.html html/ch02.html html/ch03.html html/ch04.html html/ch05.html html/index.html
++
+ chunked-html: postgis-out.xml
+- xsltproc \
+- --param shade.verbatim 1 \
++ xsltproc --param shade.verbatim 1 \
+ --param chunk.section.depth 0 \
++ --output html/ \
+ --stringparam html.stylesheet style.css \
+ --stringparam saxon.character.representation decimal \
+- /usr/share/sgml/docbook/xsl-stylesheets/html/chunk.xsl \
+- $<
++ /usr/local/share/xsl/docbook/html/chunk.xsl \
++ $< && touch chunked-html
+
+ html: postgis-out.xml
+ xsltproc \
+@@ -20,11 +22,20 @@
+ --param shade.verbatim 1 \
+ --param chunk.section.depth 0 \
+ --stringparam html.stylesheet style.css \
+- /usr/share/sgml/docbook/xsl-stylesheets/html/docbook.xsl \
++ /usr/local/share/xsl/docbook/html/docbook.xsl \
+ $<
+
+ jw: postgis-out.xml
+ jw $(COMMONOPTS) -o html/ postgis-out.xml
+
+ clean:
++ rm -f postgis-out.xml chunked-html html/*.html
++
++install: chunked-html
++ $(INSTALL_DATA) html/ch01.html $(DOCSDIR)/ch01.html
++ $(INSTALL_DATA) html/ch02.html $(DOCSDIR)/ch02.html
++ $(INSTALL_DATA) html/ch03.html $(DOCSDIR)/ch03.html
++ $(INSTALL_DATA) html/ch04.html $(DOCSDIR)/ch04.html
++ $(INSTALL_DATA) html/ch05.html $(DOCSDIR)/ch05.html
++ $(INSTALL_DATA) html/index.html $(DOCSDIR)/index.html
+
diff --git a/databases/postgis/files/patch-b b/databases/postgis/files/patch-b
new file mode 100644
index 000000000000..35124669b8fb
--- /dev/null
+++ b/databases/postgis/files/patch-b
@@ -0,0 +1,13 @@
+--- loader/Makefile Wed Dec 29 16:31:54 2004
++++ loader/Makefile.new Wed Dec 29 16:32:25 2004
+@@ -50,8 +50,8 @@
+ $(CC) $(CFLAGS) $(OBJS) shp2pgsql.o $(LDFLAGS) -o $@
+
+ install: all
+- $(INSTALL_PROGRAM) pgsql2shp$(EXE) $(DESTDIR)$(bindir)/pgsql2shp$(EXE)
+- $(INSTALL_PROGRAM) shp2pgsql$(EXE) $(DESTDIR)$(bindir)/shp2pgsql$(EXE)
++ $(INSTALL_PROGRAM) pgsql2shp$(EXE) $(DESTDIR)$(BINDIR)/pgsql2shp$(EXE)
++ $(INSTALL_PROGRAM) shp2pgsql$(EXE) $(DESTDIR)$(BINDIR)/shp2pgsql$(EXE)
+
+ clean:
+ @rm -f $(OBJS) shp2pgsql.o pgsql2shp.o shp2pgsql$(EXE) pgsql2shp$(EXE)
diff --git a/databases/postgis/files/patch-c b/databases/postgis/files/patch-c
new file mode 100644
index 000000000000..4e473d10e814
--- /dev/null
+++ b/databases/postgis/files/patch-c
@@ -0,0 +1,64 @@
+--- Makefile Wed Dec 29 09:44:01 2004
++++ Makefile.new Wed Dec 29 09:56:30 2004
+@@ -28,7 +28,7 @@
+ #
+ # Download from: http://geos.refractions.net
+ #
+-USE_GEOS=1
++#USE_GEOS=1
+ ifeq (${GEOS_DIR},)
+ GEOS_DIR=/usr/local
+ endif
+@@ -105,10 +105,10 @@
+ SCRIPTS_VERSION=0.0.1
+ ifeq (${USE_VERSION}, 71)
+ MODULE_FILENAME = $(LPATH)/$(shlib)
+- MODULE_INSTALLDIR = $(libdir)
++ MODULE_INSTALLDIR = $(LIBDIR)
+ else
+ MODULE_FILENAME = $(LPATH)/$(shlib)
+- MODULE_INSTALLDIR = $(pkglibdir)
++ MODULE_INSTALLDIR = $(LIBDIR)
+ endif
+
+ #---------------------------------------------------------------
+@@ -191,6 +191,10 @@
+ postgis_geos_wrapper.o: postgis_geos_wrapper.cpp
+
+ all: $(GEOS_RULES) all-lib postgis.sql postgis_undef.sql loaderdumper
++ifneq ($(WITH-DOC),)
++ $(MAKE) -C doc chunked-html
++endif
++
+
+ loaderdumper:
+ $(MAKE) -C loader
+@@ -207,11 +211,15 @@
+ perl create_undef.pl $< $(USE_VERSION) > $@
+
+ install: all installdirs install-postgis-lib
+- $(INSTALL_DATA) postgis.sql $(DESTDIR)$(datadir)
+- $(INSTALL_DATA) postgis_undef.sql $(DESTDIR)$(datadir)
+- $(INSTALL_DATA) spatial_ref_sys.sql $(DESTDIR)$(datadir)
+- $(INSTALL_DATA) README.postgis $(DESTDIR)$(datadir)
++ $(INSTALL_DATA) postgis.sql $(DESTDIR)$(DATADIR)/postgis.sql.default
++ $(INSTALL_DATA) postgis_undef.sql $(DESTDIR)$(DATADIR)
++ $(INSTALL_DATA) spatial_ref_sys.sql $(DESTDIR)$(DATADIR)
++ $(INSTALL_DATA) README.postgis $(DESTDIR)$(DATADIR)
+ $(MAKE) DESTDIR=$(DESTDIR) -C loader install
++ifneq ($(WITH-DOC),)
++ $(MAKE) INSTALL_DATA="$(INSTALL_DATA)" DOCSDIR=$(DOCSDIR) -C doc install
++endif
++
+
+ #- This has been copied from postgresql and adapted
+ install-postgis-lib: $(shlib)
+@@ -235,7 +243,7 @@
+ ./geos_version.sh $(GEOS_DIR) > postgis_geos_version.h
+
+ installdirs:
+- $(mkinstalldirs) $(docdir)/contrib $(datadir)/contrib $(libdir)
++ $(mkinstalldirs) $(DATADIR) $(libdir)
+
+ uninstall: uninstall-lib
+ @rm -f $(docdir)/contrib/README.postgis $(datadir)/contrib/postgis.sql
diff --git a/databases/postgis/files/updatedb.default b/databases/postgis/files/updatedb.default
new file mode 100644
index 000000000000..2af237355add
--- /dev/null
+++ b/databases/postgis/files/updatedb.default
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+LIBDIR=%%LIBDIR%%
+
+sed "s|'.*/libpostgis.so.0'|'${LIBDIR}/libpostgis.so.0'|g" $1 > $1.updated
diff --git a/databases/postgis/pkg-deinstall b/databases/postgis/pkg-deinstall
new file mode 100644
index 000000000000..c2dbee5ad606
--- /dev/null
+++ b/databases/postgis/pkg-deinstall
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+
+case "$2" in
+ "POST-DEINSTALL")
+ PREF=${PREFIX:-$PKG_PREFIX}
+ SHAREDIR=${PREF}/share/postgis
+ rm -f ${SHAREDIR}/postgis.sql ${SHAREDIR}/updatedb
+ rmdir ${SHAREDIR}
+ ;;
+esac
diff --git a/databases/postgis/pkg-install b/databases/postgis/pkg-install
new file mode 100644
index 000000000000..05579c05d8b8
--- /dev/null
+++ b/databases/postgis/pkg-install
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+msg(){
+ echo "
+ ================== ** Postgis Upgrade Notice ** ===================
+
+ The Postgis 0.9.1 port has changed the location of some files,
+ including libpostgis.so.0 library. If you are a user from a old
+ version of Postgis (0.9.0 or older), make a backup from your
+ databases before continue !
+
+ If you need to backup your data, press CTRL-C now !
+
+ ======================= GEOS Support Notice =======================
+ In order to use the GEOS support, you may need to specially compile
+ your version of PostgreSQL to link the C++ runtime library.
+ To do this, invoke the PostgreSQL Makefile script this way:
+
+ on csh shell:
+
+ setenv LDFLAGS -lstdc++
+ make
+
+ on sh or bash shell:
+
+ export LDFLAGS=-lstdc++
+ make
+
+ The initial LDFLAGS variable is passed through to the Makefile and
+ adds the C++ library to the linking stage.
+
+ ===================================================================
+"
+sleep 10
+
+}
+
+case "$2" in
+ "PRE-INSTALL")
+ msg
+ ;;
+ "POST-INSTALL")
+ PREF=${PREFIX:-$PKG_PREFIX}
+ SHAREDIR=${PREF}/share/postgis
+ LIBDIR=${PREF}/lib
+ sed -e "s|\$libdir|${LIBDIR}|g" ${SHAREDIR}/postgis.sql.default > ${SHAREDIR}/postgis.sql
+ sed -e "s|%%LIBDIR%%|${LIBDIR}|g" ${SHAREDIR}/updatedb.default > ${SHAREDIR}/updatedb
+ ;;
+ "MESSAGE")
+ msg
+ ;;
+esac
diff --git a/databases/postgis/pkg-message b/databases/postgis/pkg-message
new file mode 100644
index 000000000000..df96a4e09d01
--- /dev/null
+++ b/databases/postgis/pkg-message
@@ -0,0 +1,16 @@
+=============================================================
+
+Postgis Installation notes
+
+* The Postgis SQL files had its locations changed.
+ Now they can be found at PREFIX/share/postgis
+
+* HTML Documentation was added to this port and can be found
+ at PREFIX/share/doc/postgis
+
+* libpostgis.so and libpostgis.so.1 were moved from
+ PREFIX/lib/postgresql to PREFIX/lib.
+ Users from older versions (0.9.0 or older), *must* read
+ PREFIX/share/postgis/UPDATE for instructions.
+
+=============================================================
diff --git a/databases/postgis/pkg-plist b/databases/postgis/pkg-plist
index 0f2a8669c8b4..d1fcd46ad054 100644
--- a/databases/postgis/pkg-plist
+++ b/databases/postgis/pkg-plist
@@ -1,10 +1,13 @@
bin/pgsql2shp
bin/shp2pgsql
-lib/postgresql/libpostgis.so
-lib/postgresql/libpostgis.so.0
-share/postgresql/README.postgis
-share/postgresql/postgis.sql
-share/postgresql/postgis_undef.sql
-share/postgresql/spatial_ref_sys.sql
-@unexec rmdir %D/lib/postgresql 2>/dev/null || true
-@unexec rmdir %D/share/postgresql 2>/dev/null || true
+lib/libpostgis.so
+lib/libpostgis.so.0
+%%DATADIR%%/README.postgis
+%%DATADIR%%/UPDATE
+%%DATADIR%%/postgis.sql.default
+%%DATADIR%%/updatedb.default
+%%DATADIR%%/postgis_undef.sql
+%%DATADIR%%/spatial_ref_sys.sql
+%%PORTDOCS%%@unexec rmdir %D/%%DOCSDIR%% 2>/dev/null || true
+@unexec rmdir %D/%%DATADIR%% 2>/dev/null || true
+@unexec rmdir %D/lib 2>/dev/null || true