2013-06-04 17:06:04 +00:00
|
|
|
class Osm2pgsql < Formula
|
2014-11-01 00:36:42 +00:00
|
|
|
homepage "http://wiki.openstreetmap.org/wiki/Osm2pgsql"
|
2015-02-02 09:32:25 +00:00
|
|
|
url "https://github.com/openstreetmap/osm2pgsql/archive/0.87.0.tar.gz"
|
|
|
|
sha1 "6f302500e52d6e42147cc8dff8f344677e3131f8"
|
2013-06-04 17:06:04 +00:00
|
|
|
|
2014-06-04 13:25:19 +00:00
|
|
|
bottle do
|
2015-02-02 09:44:54 +00:00
|
|
|
sha1 "613f83d5eec75fc35cf39dd74f6c93478f962d21" => :yosemite
|
|
|
|
sha1 "245a3e678eb6ff1f3af53cffb7fd1cd6ef3481a0" => :mavericks
|
|
|
|
sha1 "9c97bc588a3ddeb4c173327249437d485f4192a4" => :mountain_lion
|
2014-06-04 13:25:19 +00:00
|
|
|
end
|
|
|
|
|
2013-06-04 17:06:04 +00:00
|
|
|
depends_on :postgresql
|
2014-06-01 01:39:27 +00:00
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "libtool" => :build
|
2015-02-02 11:20:12 +00:00
|
|
|
depends_on "boost"
|
2013-06-04 17:06:04 +00:00
|
|
|
depends_on "geos"
|
|
|
|
depends_on "proj"
|
|
|
|
depends_on "protobuf-c" => :optional
|
|
|
|
|
2015-02-02 09:32:25 +00:00
|
|
|
# Fixes an upstream issue:
|
|
|
|
# https://github.com/openstreetmap/osm2pgsql/issues/196
|
|
|
|
# Remove the patch when upgrading
|
|
|
|
patch do
|
|
|
|
url "https://github.com/openstreetmap/osm2pgsql/commit/943684a9b86bee46d245970b3e5870f83afc9208.diff"
|
|
|
|
sha1 "01c681513959b285038b3582afc1c1d63e440209"
|
|
|
|
end
|
|
|
|
|
2013-06-04 17:06:04 +00:00
|
|
|
def install
|
2014-06-04 12:44:26 +00:00
|
|
|
args = [
|
2015-02-02 09:32:25 +00:00
|
|
|
"--prefix=#{prefix}",
|
|
|
|
"--disable-dependency-tracking",
|
2014-06-04 12:44:26 +00:00
|
|
|
"--with-proj=#{Formula["proj"].opt_prefix}",
|
2015-02-02 09:32:25 +00:00
|
|
|
"--with-boost=#{Formula["boost"].opt_prefix}",
|
2014-06-04 12:44:26 +00:00
|
|
|
"--with-zlib=/usr",
|
2015-02-02 09:32:25 +00:00
|
|
|
"--with-bzip2=/usr",
|
|
|
|
# Related to the patch, remove this line when upgrading
|
|
|
|
"--without-lockfree",
|
2014-06-04 12:44:26 +00:00
|
|
|
]
|
2015-02-02 09:32:25 +00:00
|
|
|
puts args
|
2013-08-22 03:35:51 +00:00
|
|
|
if build.with? "protobuf-c"
|
2014-02-27 04:29:12 +00:00
|
|
|
args << "--with-protobuf-c=#{Formula["protobuf-c"].opt_prefix}"
|
2013-08-22 03:35:51 +00:00
|
|
|
end
|
2013-06-04 17:06:04 +00:00
|
|
|
system "./autogen.sh"
|
2013-08-22 03:35:51 +00:00
|
|
|
system "./configure", *args
|
2013-06-04 17:06:04 +00:00
|
|
|
system "make"
|
2015-02-02 09:32:25 +00:00
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
assert_match "version #{version}",
|
|
|
|
shell_output("#{bin}/osm2pgsql -h 2>&1", 1)
|
2013-06-04 17:06:04 +00:00
|
|
|
end
|
|
|
|
end
|