2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-10-03 02:09:26 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Geoip < Formula
|
2009-10-03 02:09:26 +00:00
|
|
|
homepage 'http://www.maxmind.com/app/c'
|
2013-06-26 08:38:32 +00:00
|
|
|
url 'http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.5.1.tar.gz'
|
|
|
|
sha1 '36b211ad1857431772f811b126422aea6b68a122'
|
2009-10-03 02:09:26 +00:00
|
|
|
|
2012-04-03 01:55:58 +00:00
|
|
|
# These are needed for the autoreconf it always tries to run.
|
2012-07-07 18:08:22 +00:00
|
|
|
depends_on :automake
|
|
|
|
depends_on :libtool
|
2012-04-03 01:55:58 +00:00
|
|
|
|
2012-08-10 04:47:59 +00:00
|
|
|
option :universal
|
2010-10-17 15:52:14 +00:00
|
|
|
|
2009-10-03 02:09:26 +00:00
|
|
|
def install
|
2012-08-10 04:47:59 +00:00
|
|
|
ENV.universal_binary if build.universal?
|
2012-04-03 01:55:58 +00:00
|
|
|
|
|
|
|
# Fixes a build error on Lion when configure does a variant of autoreconf
|
|
|
|
# that results in a botched Makefile, causing this error:
|
|
|
|
# No rule to make target '../libGeoIP/libGeoIP.la', needed by 'geoiplookup'
|
|
|
|
# This works on Snow Leopard also when it tries but fails to run autoreconf.
|
|
|
|
system "autoreconf", "-ivf"
|
|
|
|
|
2012-08-10 04:47:59 +00:00
|
|
|
system "./configure", "--disable-dependency-tracking",
|
|
|
|
"--prefix=#{prefix}"
|
2009-10-03 02:09:26 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
2013-01-27 22:37:52 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
system "#{bin}/geoiplookup", '8.8.8.8'
|
|
|
|
end
|
2009-10-03 02:09:26 +00:00
|
|
|
end
|