Files
tigerbrew/Library/Formula/geoipupdate.rb
T
Nicholas Sivo c07c02a768 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 <mike@mikemcquaid.com>
2013-11-28 10:13:12 +00:00

39 lines
1.2 KiB
Ruby

require 'formula'
class Geoipupdate < Formula
homepage 'https://github.com/maxmind/geoipupdate'
url 'https://github.com/maxmind/geoipupdate/releases/download/v2.0.0/geoipupdate-2.0.0.tar.gz'
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"
end
end