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>
This commit is contained in:
parent
1d9e8c6d22
commit
3b14badd8a
1 changed files with 14 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue