Skip to content
Browse files

postgis: Update to 2.0.1

Also, make PostGIS friendly to `--ignore-dependencies` as it is common to
want a PostGIS upgrade without upgrading Postgres.
  • Loading branch information...
1 parent b9d3700 commit d075914435ef035a495603b98e7f0b760e8a93cf @Sharpie Sharpie committed Jun 25, 2012
Showing with 15 additions and 12 deletions.
  1. +15 −12 Library/Formula/postgis.rb
View
27 Library/Formula/postgis.rb
@@ -6,8 +6,8 @@ def build_gui?
class Postgis < Formula
homepage 'http://postgis.refractions.net'
- url 'http://postgis.org/download/postgis-2.0.0.tar.gz'
- md5 '639d2b5d6a7dc94ea2e60d6942a615bc'
+ url 'http://postgis.org/download/postgis-2.0.1.tar.gz'
+ sha1 '31db797a835f14470f9e1183fe8fd2ba7b99aadf'
head 'http://svn.osgeo.org/postgis/trunk/'
@@ -36,21 +36,26 @@ def options
# them---these are callbacks for liblwgeom.
skip_clean :all
+ def postgresql
+ # Follow the PostgreSQL linked keg back to the active Postgres installation
+ # as it is common for people to avoid upgrading Postgres.
+ Formula.factory('postgresql').linked_keg.realpath
+ end
+
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 2.0.
"--with-projdir=#{HOMEBREW_PREFIX}",
- "--with-jsondir=#{jsonc.prefix}",
+ "--with-jsondir=#{jsonc.linked_keg.realpath}",
# 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",
+ "--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
@@ -75,11 +80,11 @@ def install
# Install PostGIS plugin libraries into the Postgres keg so that they can
# be loaded and so PostGIS databases will continue to function even if
# PostGIS is removed.
- postgresql.lib.install Dir['stage/**/*.so']
+ (postgresql/'lib').install Dir['stage/**/*.so']
# Install extension scripts to the Postgres keg.
# `CREATE EXTENSION postgis;` won't work if these are located elsewhere.
- (postgresql.share + 'postgresql' + 'extension').install Dir['stage/**/extension/*']
+ (postgresql/'share/postgresql/extension').install Dir['stage/**/extension/*']
bin.install Dir['stage/**/bin/*']
lib.install Dir['stage/**/lib/*']
@@ -104,8 +109,6 @@ def install
end
def caveats;
- postgresql = Formula.factory 'postgresql'
-
<<-EOS.undent
To create a spatially-enabled database, see the documentation:
http://postgis.refractions.net/documentation/manual-2.0/postgis_installation.html#create_new_db_extensions
@@ -115,9 +118,9 @@ def caveats;
PostGIS SQL scripts installed to:
#{HOMEBREW_PREFIX}/share/postgis
PostGIS plugin libraries installed to:
- #{postgresql.lib}
+ #{postgresql}/lib
PostGIS extension modules installed to:
- #{postgresql.share}/postgresql/extension
- EOS
+ #{postgresql}/share/postgresql/extension
+ EOS
end
end

0 comments on commit d075914

Please sign in to comment.
Something went wrong with that request. Please try again.