2013-11-23 22:56:38 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Libmaxminddb < Formula
|
|
|
|
homepage 'https://github.com/maxmind/libmaxminddb'
|
2014-01-30 05:25:00 +00:00
|
|
|
url 'https://github.com/maxmind/libmaxminddb/releases/download/0.5.3/libmaxminddb-0.5.3.tar.gz'
|
|
|
|
sha1 'ce6dd4fecb1a4c97cfede70e6fc6af863ffeddab'
|
2013-11-23 22:56:38 +00:00
|
|
|
|
2013-12-09 18:19:35 +00:00
|
|
|
head do
|
|
|
|
url 'https://github.com/maxmind/libmaxminddb.git'
|
|
|
|
|
2013-11-25 02:04:53 +00:00
|
|
|
depends_on 'autoconf' => :build
|
|
|
|
depends_on 'automake' => :build
|
|
|
|
depends_on 'libtool' => :build
|
|
|
|
end
|
2013-12-09 18:19:35 +00:00
|
|
|
|
2013-11-25 02:04:53 +00:00
|
|
|
depends_on 'geoipupdate' => :optional
|
|
|
|
|
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
|