2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-10-03 13:19:16 +00:00
|
|
|
|
2012-03-11 18:16:17 +00:00
|
|
|
class PostgresqlInstalled < Requirement
|
|
|
|
def message; <<-EOS.undent
|
2012-10-07 01:02:43 +00:00
|
|
|
PostgreSQL is required to install.
|
2012-03-11 18:16:17 +00:00
|
|
|
|
|
|
|
You can install this with:
|
|
|
|
brew install postgresql
|
|
|
|
|
|
|
|
Or you can use an official installer from:
|
|
|
|
http://www.postgresql.org/
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
def satisfied?
|
|
|
|
which 'pg_config'
|
|
|
|
end
|
|
|
|
def fatal?
|
|
|
|
true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Osm2pgsql < Formula
|
2009-10-03 13:19:16 +00:00
|
|
|
homepage 'http://wiki.openstreetmap.org/wiki/Osm2pgsql'
|
2012-05-10 14:10:12 +00:00
|
|
|
head 'http://svn.openstreetmap.org/applications/utils/export/osm2pgsql/'
|
2009-10-03 13:19:16 +00:00
|
|
|
|
2012-03-11 18:16:17 +00:00
|
|
|
depends_on PostgresqlInstalled.new
|
2012-07-07 18:08:22 +00:00
|
|
|
|
|
|
|
depends_on :automake
|
|
|
|
depends_on :libtool
|
|
|
|
|
2012-02-28 15:39:22 +00:00
|
|
|
depends_on "geos"
|
|
|
|
depends_on "proj"
|
2012-03-11 18:16:17 +00:00
|
|
|
depends_on "protobuf-c" => :optional
|
2012-02-28 15:39:22 +00:00
|
|
|
|
2009-10-03 13:19:16 +00:00
|
|
|
def install
|
2010-06-01 23:24:57 +00:00
|
|
|
system "./autogen.sh"
|
|
|
|
system "./configure"
|
2009-10-03 13:19:16 +00:00
|
|
|
system "make"
|
|
|
|
bin.install "osm2pgsql"
|
2011-05-26 13:23:12 +00:00
|
|
|
(share+'osm2pgsql').install 'default.style'
|
2009-10-03 13:19:16 +00:00
|
|
|
end
|
|
|
|
end
|