Bug#860142: libgeo-ip-perl: incompatible with geoip-database - cannot load
Jonas Smedegaard
jonas at jones.dk
Wed Apr 12 20:31:52 UTC 2017
Quoting gregor herrmann (2017-04-12 22:18:11)
> On Wed, 12 Apr 2017 14:15:09 +0900, Norbert Preining wrote:
>
> > it seems there is an incompatibility between the geoip-database shipped in
> > Debian and the module Geo::IP.
> >
> > Trying to do (according to the docs):
> > use Geo::IP;
> > my $gi = Geo::IP->new(GEOIP_MEMORY_CACHE);
> > my $record = $gi->record_by_addr($ip);
> > results in:
> > Invalid database type GeoIP Country Edition, expected GeoIP City Edition, Rev 1
> >
> > Same with
> > my $gi = Geo::IP->open( '/usr/share/GeoIP/GeoIP.dat', GEOIP_MEMORY_CACHE );
>
> I haven't tried it yet but my impression is that the record_by_addr()
> method wants a city database:
>
> Code:
> *record_by_addr = \&get_city_record_as_hash;
>
> POD:
>
> use Geo::IP;
> my $gi = Geo::IP->open("/usr/local/share/GeoIP/GeoIPCity.dat", GEOIP_STANDARD);
> my $record = $gi->record_by_addr('24.24.24.24');
>
> i.e. city data (GeoIPCity.dat) while the geoip-database package only
> ships the country database (GeoIP.dat).
>
> This means that all functions that use the country .dat should work,
> and for the city-needing functions one would either need to get the
> file from https://dev.maxmind.com/geoip/legacy/geolite/ or convince
> the geoip-database maintainers to ship it (or them: ipv4 + ipv6) in
> the package a well.
Debian packages geoip-database-extra or geoip-database-contrib (the
latter in contrib) should satisfy the need for city lookups (but I
haven't tried).
- Jonas
--
* Jonas Smedegaard - idealist & Internet-arkitekt
* Tlf.: +45 40843136 Website: http://dr.jones.dk/
[x] quote me freely [ ] ask before reusing [ ] keep private
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20170412/e408ccd5/attachment.sig>
More information about the pkg-perl-maintainers
mailing list