2013-11-23 22:56:38 +00:00
|
|
|
class Libmaxminddb < Formula
|
2014-12-27 16:20:33 +00:00
|
|
|
homepage "https://github.com/maxmind/libmaxminddb"
|
2015-03-22 17:00:02 +00:00
|
|
|
url "https://github.com/maxmind/libmaxminddb/releases/download/1.0.4/libmaxminddb-1.0.4.tar.gz"
|
|
|
|
sha1 "57548d426d43b9b43c77786b08594d48d0c88c62"
|
2013-11-23 22:56:38 +00:00
|
|
|
|
2014-07-03 19:34:34 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2015-03-22 17:10:25 +00:00
|
|
|
sha256 "f923147f3aacda41439e72737c22899356b11d61f2c9628839bac361d365a57e" => :yosemite
|
|
|
|
sha256 "ffc9884a7818e4b31b0a4d7e7a2d9edb10de783039b3ee4a20084a91373447ea" => :mavericks
|
|
|
|
sha256 "1c3da6449a58c7f2840b51dd0de405b1d27a6d3c8ae211d0a6f38a21a17f780a" => :mountain_lion
|
2014-07-03 19:34:34 +00:00
|
|
|
end
|
|
|
|
|
2013-12-09 18:19:35 +00:00
|
|
|
head do
|
2014-12-27 16:20:33 +00:00
|
|
|
url "https://github.com/maxmind/libmaxminddb.git"
|
2013-12-09 18:19:35 +00:00
|
|
|
|
2014-12-27 16:20:33 +00:00
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "libtool" => :build
|
2013-11-25 02:04:53 +00:00
|
|
|
end
|
2013-12-09 18:19:35 +00:00
|
|
|
|
2014-12-27 16:20:33 +00:00
|
|
|
depends_on "geoipupdate" => :optional
|
2013-11-25 02:04:53 +00:00
|
|
|
|
2015-03-22 17:00:02 +00:00
|
|
|
# This patch is from an upstream post-1.0.4 commit and fixes a test failure
|
|
|
|
# on OS X. See https://github.com/maxmind/libmaxminddb/commit/424953
|
|
|
|
patch do
|
|
|
|
url "https://github.com/maxmind/libmaxminddb/commit/424953.diff"
|
|
|
|
sha1 "362cf3254145188dc9959651ba7ee876007998c9"
|
|
|
|
end
|
|
|
|
|
2013-11-23 22:56:38 +00:00
|
|
|
option :universal
|
|
|
|
|
|
|
|
def install
|
|
|
|
ENV.universal_binary if build.universal?
|
|
|
|
|
2013-11-24 00:44:27 +00:00
|
|
|
system "./bootstrap" if build.head?
|
|
|
|
|
2013-11-23 22:56:38 +00:00
|
|
|
system "./configure", "--disable-debug",
|
|
|
|
"--disable-dependency-tracking",
|
|
|
|
"--disable-silent-rules",
|
|
|
|
"--prefix=#{prefix}"
|
|
|
|
system "make", "check"
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
system "curl", "-O", "http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz"
|
|
|
|
system "gunzip", "GeoLite2-Country.mmdb.gz"
|
|
|
|
system "#{bin}/mmdblookup", "-f", "GeoLite2-Country.mmdb",
|
|
|
|
"-i", "8.8.8.8"
|
|
|
|
end
|
|
|
|
end
|