homebrew-core/Formula/libmaxminddb.rb
Nicholas Sivo ba9aea4931 libmaxminddb: add deps, geoipupdate option.
Most users will want the database auto-update tool, which until
recently came bundled with geoip, the old format library.

Closes Homebrew/homebrew#24637.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2013-11-28 10:13:33 +00:00

37 lines
1.1 KiB
Ruby

require 'formula'
class Libmaxminddb < Formula
homepage 'https://github.com/maxmind/libmaxminddb'
url 'https://github.com/maxmind/libmaxminddb/releases/download/0.5.2/libmaxminddb-0.5.2.tar.gz'
sha1 'db7618a97c222cab0a0ba2fb8439abcd1465f10c'
head 'https://github.com/maxmind/libmaxminddb.git'
if build.head?
depends_on 'autoconf' => :build
depends_on 'automake' => :build
depends_on 'libtool' => :build
end
depends_on 'geoipupdate' => :optional
option :universal
def install
ENV.universal_binary if build.universal?
system "./bootstrap" if build.head?
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