diff options
| author | Charlie Sharpsteen | 2012-04-03 16:35:42 -0700 |
|---|---|---|
| committer | Charlie Sharpsteen | 2012-04-03 16:37:49 -0700 |
| commit | a49f6883bd2095c81bf6a7c72e88eb9c5f90469a (patch) | |
| tree | 793408bd291a9f767082b2358ba406c10f54bab9 /Library/Formula | |
| parent | 1724683db8cd73164b7a9772953259ed1d88cc1f (diff) | |
| download | homebrew-a49f6883bd2095c81bf6a7c72e88eb9c5f90469a.tar.bz2 | |
PostGIS: Update to 2.0
The `--devel` version has been dropped.
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/postgis.rb | 147 |
1 files changed, 57 insertions, 90 deletions
diff --git a/Library/Formula/postgis.rb b/Library/Formula/postgis.rb index 2b9c099ab..b2e6adbf3 100644 --- a/Library/Formula/postgis.rb +++ b/Library/Formula/postgis.rb @@ -5,18 +5,12 @@ def build_gui? end class Postgis < Formula - url 'http://postgis.refractions.net/download/postgis-1.5.3.tar.gz' - homepage 'http://postgis.refractions.net/' - md5 '05a61df5e1b78bf51c9ce98bea5526fc' + homepage 'http://postgis.refractions.net' + url 'http://postgis.org/download/postgis-2.0.0.tar.gz' + md5 '639d2b5d6a7dc94ea2e60d6942a615bc' head 'http://svn.osgeo.org/postgis/trunk/', :using => :svn - devel do - url 'http://postgis.org/download/postgis-2.0.0rc2.tar.gz' - md5 '2337db7420746aeaeb631c950bbaeb82' - version '2.0.0rc2' - end - depends_on 'postgresql' depends_on 'proj' depends_on 'geos' @@ -24,10 +18,8 @@ class Postgis < Formula depends_on 'gtk+' if build_gui? # For GeoJSON and raster handling - if ARGV.build_head? or ARGV.build_devel? - depends_on 'gdal' - depends_on 'json-c' - end + depends_on 'json-c' + depends_on 'gdal' if ARGV.build_head? and MacOS.xcode_version >= "4.3" depends_on "automake" => :build @@ -36,7 +28,6 @@ class Postgis < Formula def options [ - ['--devel', 'Build unstable snapshots of PostGIS 2.0'], ['--with-gui', 'Build shp2pgsql-gui in addition to command line tools'] ] end @@ -48,28 +39,26 @@ class Postgis < Formula def install ENV.deparallelize postgresql = Formula.factory 'postgresql' + jsonc = Formula.factory 'json-c' args = [ "--disable-dependency-tracking", # Can't use --prefix, PostGIS disrespects it and flat-out refuses to - # accept it with the 2.0 beta. + # accept it with 2.0. "--with-projdir=#{HOMEBREW_PREFIX}", + "--with-jsondir=#{jsonc.prefix}", # This is against Homebrew guidelines, but we have to do it as the # PostGIS plugin libraries can only be properly inserted into Homebrew's # Postgresql keg. - "--with-pgconfig=#{postgresql.bin}/pg_config" - ] - args << '--with-gui' if build_gui? - - if ARGV.build_head? or ARGV.build_devel? - jsonc = Formula.factory 'json-c' - args << "--with-jsondir=#{jsonc.prefix}" + "--with-pgconfig=#{postgresql.bin}/pg_config", # Unfortunately, NLS support causes all kinds of headaches because # PostGIS gets all of it's compiler flags from the PGXS makefiles. This # makes it nigh impossible to tell the buildsystem where our keg-only # gettext installations are. - args << '--disable-nls' - end + "--disable-nls" + ] + args << '--with-gui' if build_gui? + system './autogen.sh' if ARGV.build_head? system './configure', *args @@ -94,62 +83,47 @@ class Postgis < Formula # Install version-specific SQL scripts and tools first. Some of the # installation routines require command line tools to still be present # inside the build prefix. - if ARGV.build_head? or ARGV.build_devel? - # Install the liblwgeom library - lib.install Dir['liblwgeom/.libs/*.dylib', 'liblwgeom/.libs/*.a'] - include.install 'liblwgeom/liblwgeom.h' - - # Install raster plugin to Postgres keg - postgresql.lib.install Dir['raster/rt_pg/rtpostgis*.so'] - - # Install extension scripts to the Postgres keg. - # `CREATE EXTENSION postgis;` won't work if these are located elsewhere. - system 'make install -C extensions' - - bin.install %w[ - loader/.libs/pgsql2shp - loader/.libs/shp2pgsql - raster/loader/.libs/raster2pgsql - ] - bin.install 'loader/.libs/shp2pgsql-gui' if build_gui? - - # Install PostGIS 2.0 SQL scripts - postgis_sql.install %w[ - postgis/legacy.sql - postgis/legacy_minimal.sql - postgis/uninstall_legacy.sql - postgis/postgis_upgrade_20_minor.sql - ] - - postgis_sql.install %w[ - raster/rt_pg/rtpostgis.sql - raster/rt_pg/rtpostgis_drop.sql - raster/rt_pg/rtpostgis_upgrade_20_minor.sql - raster/rt_pg/rtpostgis_upgrade.sql - raster/rt_pg/rtpostgis_upgrade_cleanup.sql - raster/rt_pg/uninstall_rtpostgis.sql - ] - - postgis_sql.install %w[ - topology/topology.sql - topology/topology_upgrade_20_minor.sql - topology/uninstall_topology.sql - ] - else - bin.install %w[ - loader/pgsql2shp - loader/shp2pgsql - utils/new_postgis_restore.pl - ] - bin.install 'loader/shp2pgsql-gui' if build_gui? - - # Install PostGIS 1.x upgrade scripts - postgis_sql.install %w[ - postgis/postgis_upgrade_13_to_15.sql - postgis/postgis_upgrade_14_to_15.sql - postgis/postgis_upgrade_15_minor.sql - ] - end + + # Install the liblwgeom library + lib.install Dir['liblwgeom/.libs/*.dylib', 'liblwgeom/.libs/*.a'] + include.install 'liblwgeom/liblwgeom.h' + + # Install raster plugin to Postgres keg + postgresql.lib.install Dir['raster/rt_pg/rtpostgis*.so'] + + # Install extension scripts to the Postgres keg. + # `CREATE EXTENSION postgis;` won't work if these are located elsewhere. + system 'make install -C extensions' + + bin.install %w[ + loader/.libs/pgsql2shp + loader/.libs/shp2pgsql + raster/loader/.libs/raster2pgsql + ] + bin.install 'loader/.libs/shp2pgsql-gui' if build_gui? + + # Install PostGIS 2.0 SQL scripts + postgis_sql.install %w[ + postgis/legacy.sql + postgis/legacy_minimal.sql + postgis/uninstall_legacy.sql + postgis/postgis_upgrade_20_minor.sql + ] + + postgis_sql.install %w[ + raster/rt_pg/rtpostgis.sql + raster/rt_pg/rtpostgis_drop.sql + raster/rt_pg/rtpostgis_upgrade_20_minor.sql + raster/rt_pg/rtpostgis_upgrade.sql + raster/rt_pg/rtpostgis_upgrade_cleanup.sql + raster/rt_pg/uninstall_rtpostgis.sql + ] + + postgis_sql.install %w[ + topology/topology.sql + topology/topology_upgrade_20_minor.sql + topology/uninstall_topology.sql + ] # Common tools bin.install %w[ @@ -174,7 +148,7 @@ class Postgis < Formula def caveats; postgresql = Formula.factory 'postgresql' - s = <<-EOS.undent + <<-EOS.undent To create a spatially-enabled database, see the documentation: http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392 and to upgrade your existing spatial databases, see here: @@ -184,15 +158,8 @@ class Postgis < Formula #{HOMEBREW_PREFIX}/share/postgis PostGIS plugin libraries installed to: #{postgresql.lib} + PostGIS extension modules installed to: + #{postgresql.share}/postgres/extension EOS - - if ARGV.build_head? or ARGV.build_devel? - s += <<-EOS.undent - PostGIS extension modules installed to: - #{postgresql.share}/postgres/extension - EOS - end - - return s end end |
