From c07c02a76869fbfb19e8946e9126d43f4a7f7cf9 Mon Sep 17 00:00:00 2001 From: Nicholas Sivo Date: Sun, 24 Nov 2013 18:02:54 -0800 Subject: geoipupdate: fix data directory, make config useful. geoip and geoipupdate need to share a data directory, which is /usr/local/share/GeoIP by default. This doesn’t work with Homebrew, since it can’t link into both cellar locations. I’ve manually specified a reasonable location as the default. The shipped configuration doesn’t do anything out of the box. Users who pay will need to edit the file anyway to add their license keys, but now it should just work for free users. Signed-off-by: Mike McQuaid --- Library/Formula/geoipupdate.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'Library/Formula') diff --git a/Library/Formula/geoipupdate.rb b/Library/Formula/geoipupdate.rb index 9396f6723..fef7b8341 100644 --- a/Library/Formula/geoipupdate.rb +++ b/Library/Formula/geoipupdate.rb @@ -6,20 +6,33 @@ class Geoipupdate < Formula sha1 'd3c90ad9c9ad5974e8a5a30c504e7827978ddea7' head 'https://github.com/maxmind/geoipupdate.git' + if build.head? + depends_on 'autoconf' => :build + depends_on 'automake' => :build + depends_on 'libtool' => :build + end + option :universal def install ENV.universal_binary if build.universal? + # Download free databases by default + # See https://github.com/maxmind/geoip-api-c#150 + inreplace 'conf/GeoIP.conf.default', 'YOUR_USER_ID_HERE', '999999' + inreplace 'conf/GeoIP.conf.default', 'YOUR_LICENSE_KEY_HERE', '000000000000' + inreplace 'conf/GeoIP.conf.default', /^ProductIds .*$/, 'ProductIds 506 533' + system "./bootstrap" if build.head? system "./configure", "--disable-dependency-tracking", "--disable-silent-rules", + "--datadir=#{var}", "--prefix=#{prefix}" system "make", "install" end test do - system "#{bin}/geoipupdate", "-V" + system "#{bin}/geoipupdate", "-v" end end -- cgit v1.2.3