diff options
| author | Nicholas Sivo | 2013-11-23 16:29:26 -0800 |
|---|---|---|
| committer | Adam Vandenberg | 2013-11-23 17:44:12 -0800 |
| commit | 113e386b47706a3f7e44fe1d0be5c533cb412289 (patch) | |
| tree | b9f5b29c45b1c99e969df5de14e844f0fe9911d3 /Library/Formula | |
| parent | b24db07664b719c59078c3d3a3d1790f712d4a5b (diff) | |
| download | homebrew-113e386b47706a3f7e44fe1d0be5c533cb412289.tar.bz2 | |
geoip 1.6.0 - Update, add head, improve tests.
Closes #24617.
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/geoip.rb | 45 |
1 files changed, 39 insertions, 6 deletions
diff --git a/Library/Formula/geoip.rb b/Library/Formula/geoip.rb index 860637de2..1b62a5596 100644 --- a/Library/Formula/geoip.rb +++ b/Library/Formula/geoip.rb @@ -1,9 +1,10 @@ require 'formula' class Geoip < Formula - homepage 'http://www.maxmind.com/app/c' - url 'http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.5.1.tar.gz' - sha1 '36b211ad1857431772f811b126422aea6b68a122' + homepage 'https://github.com/maxmind/geoip-api-c' + url 'https://github.com/maxmind/geoip-api-c/releases/download/v1.6.0/GeoIP-1.6.0.tar.gz' + sha1 '41ed21fb2d40e54648cae2a1f73e8a5210676def' + head 'https://github.com/maxmind/geoip-api-c.git' # These are needed for the autoreconf it always tries to run. depends_on :autoconf @@ -12,6 +13,12 @@ class Geoip < Formula option :universal + def patches + # Download test data so `make check` works. Fixed in HEAD. + # See https://github.com/maxmind/geoip-api-c/commit/722707cc3a0adc06aec3e98bc36e7262f67ec0da + DATA unless build.head? + end + def install ENV.universal_binary if build.universal? @@ -19,14 +26,40 @@ class Geoip < Formula # 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" + # Also fixes the tests by downloading required data file + system "./bootstrap" system "./configure", "--disable-dependency-tracking", + "--disable-silent-rules", "--prefix=#{prefix}" - system "make install" + system "make", "check" + system "make", "install" end test do - system "#{bin}/geoiplookup", '8.8.8.8' + system "curl", "-O", "http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz" + system "gunzip", "GeoIP.dat.gz" + system "#{bin}/geoiplookup", "-f", "GeoIP.dat", "8.8.8.8" end end + +__END__ +diff --git a/bootstrap b/bootstrap +index 30fc0f9..f20f095 100755 +--- a/bootstrap ++++ b/bootstrap +@@ -1,5 +1,14 @@ + #!/bin/sh + ++# dl the dat file if needed ++DIR="$( cd "$( dirname "$0" )" && pwd )" ++ ++# download geolite database for the tests ++mkdir -p $DIR/data ++if [ ! -f $DIR/data/GeoIP.dat ]; then ++ curl http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz | gzip -d > $DIR/data/GeoIP.dat ++fi ++ + # make sure to use the installed libtool + rm -f ltmain.sh + autoreconf -fiv |
