2014-07-24 23:18:47 +00:00
|
|
|
require "formula"
|
2013-11-24 00:54:51 +00:00
|
|
|
|
|
|
|
class Geoipupdate < Formula
|
2014-07-24 23:18:47 +00:00
|
|
|
homepage "https://github.com/maxmind/geoipupdate"
|
|
|
|
url "https://github.com/maxmind/geoipupdate/releases/download/v2.0.2/geoipupdate-2.0.2.tar.gz"
|
|
|
|
sha1 "14274698cacb5468475a008b8db61e162ff1ce73"
|
|
|
|
|
2014-07-25 01:25:32 +00:00
|
|
|
bottle do
|
|
|
|
sha1 "583c8a6af265daf2ff07abeb0e2d77ac028814e8" => :mavericks
|
|
|
|
sha1 "67dee561ce6c78297fe1206e67fe661c8b61a213" => :mountain_lion
|
|
|
|
sha1 "b653b2c88c8a4316de87b66147c00180a4b7a6f4" => :lion
|
|
|
|
end
|
|
|
|
|
2014-07-24 23:18:47 +00:00
|
|
|
head do
|
|
|
|
url "https://github.com/maxmind/geoipupdate.git"
|
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "libtool" => :build
|
2013-11-25 02:02:54 +00:00
|
|
|
end
|
|
|
|
|
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
|
2014-07-24 23:18:47 +00:00
|
|
|
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"
|
2013-11-25 02:02:54 +00:00
|
|
|
|
2014-07-24 23:18:47 +00:00
|
|
|
system "./bootstrap" if build.head?
|
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
|