2013-11-24 00:54:51 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Geoipupdate < Formula
|
|
|
|
homepage 'https://github.com/maxmind/geoipupdate'
|
|
|
|
|
2014-03-17 00:35:07 +00:00
|
|
|
stable do
|
|
|
|
url "https://github.com/maxmind/geoipupdate/releases/download/v2.0.0/geoipupdate-2.0.0.tar.gz"
|
|
|
|
sha1 "d3c90ad9c9ad5974e8a5a30c504e7827978ddea7"
|
|
|
|
|
|
|
|
# Fixes use of getline on pre-Lion; will be in next release
|
|
|
|
patch do
|
2014-04-11 23:07:51 +00:00
|
|
|
url "https://github.com/maxmind/geoipupdate/commit/bdf11969f4c7c6b173466092287a2fdbd485b248.diff"
|
|
|
|
sha1 "80a8dd08ccbcd1c1d73c1bff6b5ce62adc254b96"
|
2014-03-17 00:35:07 +00:00
|
|
|
end
|
2013-11-25 02:02:54 +00:00
|
|
|
end
|
|
|
|
|
2014-03-17 00:35:07 +00:00
|
|
|
head 'https://github.com/maxmind/geoipupdate.git'
|
|
|
|
|
2014-02-11 17:39:40 +00:00
|
|
|
# Because the patch requires regenerating the configure script;
|
|
|
|
# move these back to the head spec on next release
|
|
|
|
depends_on 'autoconf' => :build
|
|
|
|
depends_on 'automake' => :build
|
|
|
|
depends_on 'libtool' => :build
|
|
|
|
|
2013-11-24 00:54:51 +00:00
|
|
|
option :universal
|
|
|
|
|
|
|
|
def install
|
|
|
|
ENV.universal_binary if build.universal?
|
|
|
|
|
2013-11-25 02:02:54 +00:00
|
|
|
# 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'
|
|
|
|
|
2014-02-11 17:39:40 +00:00
|
|
|
system "./bootstrap"
|
2013-11-24 00:54:51 +00:00
|
|
|
|
|
|
|
system "./configure", "--disable-dependency-tracking",
|
|
|
|
"--disable-silent-rules",
|
2013-11-25 02:02:54 +00:00
|
|
|
"--datadir=#{var}",
|
2013-11-24 00:54:51 +00:00
|
|
|
"--prefix=#{prefix}"
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
2014-03-17 01:19:27 +00:00
|
|
|
def post_install
|
|
|
|
(var/"GeoIP").mkpath
|
|
|
|
end
|
|
|
|
|
2013-11-24 00:54:51 +00:00
|
|
|
test do
|
2013-11-25 02:02:54 +00:00
|
|
|
system "#{bin}/geoipupdate", "-v"
|
2013-11-24 00:54:51 +00:00
|
|
|
end
|
|
|
|
end
|