Skip to content

Instantly share code, notes, and snippets.

@ericboehs
Forked from jgeo/postgis.rb
Last active August 29, 2015 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericboehs/99e36a0b982214ee3db0 to your computer and use it in GitHub Desktop.
Save ericboehs/99e36a0b982214ee3db0 to your computer and use it in GitHub Desktop.
postgis 1.5.3
require 'formula'
class Postgis < Formula
url 'http://postgis.refractions.net/download/postgis-1.5.3.tar.gz'
homepage 'http://postgis.refractions.net/'
sha256 'a2334f8b229446c0497d48a430a40152a3b71a5da02f414a0340a0a025d416cf'
head 'http://svn.osgeo.org/postgis/trunk/', :using => :svn
depends_on 'postgresql91'
depends_on 'proj'
depends_on 'geos'
# For libintl
depends_on 'gettext' if ARGV.build_head?
def options
[]
end
def install
ENV.deparallelize
args = [
"--disable-dependency-tracking",
"--prefix=#{prefix}",
"--with-projdir=#{HOMEBREW_PREFIX}"
]
if ARGV.build_head?
system "./autogen.sh"
gettext = Formula.factory('gettext')
args << "--with-gettext=#{gettext.prefix}"
end
system "./configure", *args
system "make install"
# Copy some of the generated files to the share folder
(share+'postgis').install %w(
spatial_ref_sys.sql postgis/postgis.sql
postgis/postgis_upgrade_13_to_15.sql
postgis/postgis_upgrade_14_to_15.sql
postgis/postgis_upgrade_15_minor.sql postgis/uninstall_postgis.sql
)
# Copy loader and utils binaries to bin folder
bin.install %w(
loader/pgsql2shp loader/shp2pgsql utils/create_undef.pl
utils/new_postgis_restore.pl utils/postgis_proc_upgrade.pl
utils/postgis_restore.pl utils/profile_intersects.pl
)
end
def caveats; <<-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:
http://postgis.refractions.net/documentation/manual-1.5/ch02.html#upgrading
EOS
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment