GeoIP: Update to 1.25
Message ID | cee6d332-3564-591f-cd7e-d88ff69b455c@ipfire.org |
---|---|
State | Superseded |
Headers |
Return-Path: <development-bounces@lists.ipfire.org> Received: from mail01.ipfire.org (unknown [172.28.1.200]) by web02.ipfire.org (Postfix) with ESMTP id C1A956208C for <patchwork@ipfire.org>; Mon, 9 Jan 2017 19:05:47 +0100 (CET) Received: from mail01.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id AF688C2D; Mon, 9 Jan 2017 19:05:46 +0100 (CET) Received: from [192.168.100.1] (p5DD82631.dip0.t-ipconnect.de [93.216.38.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id B7649946; Mon, 9 Jan 2017 19:05:44 +0100 (CET) Subject: Re: [PATCH] GeoIP: Update to 1.25 To: Michael Tremer <michael.tremer@ipfire.org>, development@lists.ipfire.org References: <20170107170327.11832-1-matthias.fischer@ipfire.org> <1483972182.30934.7.camel@ipfire.org> From: Matthias Fischer <matthias.fischer@ipfire.org> Organization: None Message-ID: <cee6d332-3564-591f-cd7e-d88ff69b455c@ipfire.org> Date: Mon, 9 Jan 2017 19:06:09 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <1483972182.30934.7.camel@ipfire.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: IPFire development talk <development.lists.ipfire.org> List-Unsubscribe: <http://lists.ipfire.org/mailman/options/development>, <mailto:development-request@lists.ipfire.org?subject=unsubscribe> List-Archive: <http://lists.ipfire.org/pipermail/development/> List-Post: <mailto:development@lists.ipfire.org> List-Help: <mailto:development-request@lists.ipfire.org?subject=help> List-Subscribe: <http://lists.ipfire.org/mailman/listinfo/development>, <mailto:development-request@lists.ipfire.org?subject=subscribe> Errors-To: development-bounces@lists.ipfire.org Sender: "Development" <development-bounces@lists.ipfire.org> |
Message
Matthias Fischer
Jan. 10, 2017, 5:06 a.m. UTC
On 09.01.2017 15:29, Michael Tremer wrote: > Hi, Hi, > is there any chance that we can move the database from /usr/local to /usr > instead? > ... If I got it right, this would be one line in lfs and perhaps the following patch (geoip_1_25_change_database_path.patch)!? ***SNIP*** make ***SNAP*** I think this is what you mean - would this be sufficient? I could give it a try... Best, Matthias
Comments
Hi, yes this looks alright. We should have only the one database any ways, but generally we should change all paths. The reason why I was asking for this is, that it is probably a very good idea to keep in /usr and leave /usr/local for what it is intended to: Programs compiled by the user of the system. Would you like to send this as a patch that I can merge? Testing shouldn't make any trouble. Best, -Michael On Mon, 2017-01-09 at 19:06 +0100, Matthias Fischer wrote: > On 09.01.2017 15:29, Michael Tremer wrote: > > Hi, > > Hi, > > > is there any chance that we can move the database from /usr/local > > to /usr > > instead? > > ... > > If I got it right, this would be one line in lfs and perhaps the > following patch (geoip_1_25_change_database_path.patch)!? > > ***SNIP*** > --- lib/Geo/IP/PurePerl.pm Tue Mar 30 15:41:34 2010 > +++ lib/Geo/IP/PurePerl.pm Mon Jan 09 18:58:11 2017 > @@ -129,7 +129,7 @@ > > > # --- unfortunately we do not know the path so we assume the > -# default path /usr/local/share/GeoIP > +# default path /usr/share/GeoIP > # if thats not true, you can set $Geo::IP::PurePerl::OPEN_TYPE_PATH > # > sub open_type { > @@ -210,7 +210,7 @@ > # this will be less messy once deprecated new( $path, [$flags] ) > # is no longer supported (that's what open() is for) > > - my $def_db_file = '/usr/local/share/GeoIP/GeoIP.dat'; > + my $def_db_file = '/usr/share/GeoIP/GeoIP.dat'; > if ($^O eq 'NetWare') { > $def_db_file = 'sys:/etc/GeoIP/GeoIP.dat'; > } elsif ($^O eq 'MSWin32') { > @@ -758,7 +758,7 @@ > =item $gi = Geo::IP->new( [$flags] ); > > Constructs a new Geo::IP object with the default database located > inside your system's > -I<datadir>, typically I</usr/local/share/GeoIP/GeoIP.dat>. > +I<datadir>, typically I</usr/share/GeoIP/GeoIP.dat>. > > Flags can be set to either GEOIP_STANDARD, or for faster performance > (at a cost of using more memory), GEOIP_MEMORY_CACHE. > --- t/1_lookup.t Tue Mar 30 15:13:37 2010 > +++ t/1_lookup.t Mon Jan 09 18:58:13 2017 > @@ -2,7 +2,7 @@ > use vars qw($dat); > > BEGIN { > - foreach my $file ("GeoIP.dat",'/usr/local/share/GeoIP/GeoIP.dat') > { > + foreach my $file ("GeoIP.dat",'/usr/share/GeoIP/GeoIP.dat') { > if (-f $file) { > $dat = $file; > last; > --- t/2_namelookup.t Tue Mar 30 15:21:37 2010 > +++ t/2_namelookup.t Mon Jan 09 18:58:21 2017 > @@ -2,7 +2,7 @@ > use vars qw($dat); > > BEGIN { > - foreach my $file ("GeoIP.dat",'/usr/local/share/GeoIP/GeoIP.dat') > { > + foreach my $file ("GeoIP.dat",'/usr/share/GeoIP/GeoIP.dat') { > if (-f $file) { > $dat = $file; > last; > --- Changes Tue Mar 30 15:26:38 2010 > +++ Changes Mon Jan 09 18:57:37 2017 > @@ -35,7 +35,7 @@ > Country, City and Org requests benefit from > GEOIP_MEMORY_CACHE and > GEOIP_MMAP_CACHE > Add GEOIP_MMAP_CACHE support ( Peter Shipley ) > Now works with new format of GeoIP ISP > - Corrected path to /usr/local/share/GeoIP/GeoIP.dat in geoip- > lookup > program. > + Corrected path to /usr/share/GeoIP/GeoIP.dat in geoip-lookup > program. > > 1.18 January 8th 2007 > Replaced CS/Serbia and Montenegro with RS/Serbia, removed > ZR/Zaire, > added ME/Montenegro > --- geoip-lookup Tue Mar 30 15:13:36 2010 > +++ geoip-lookup Mon Jan 09 18:57:44 2017 > @@ -15,7 +15,7 @@ > > The I<geoip-lookup> program will return the country for the IP > address or > hostname given as the first command line argument. > -It queries the GeoIP Country database in > C</usr/local/share/GeoIP/GeoIP.dat>. > +It queries the GeoIP Country database in > C</usr/share/GeoIP/GeoIP.dat>. > > By default it prints the ISO 3166 country code. Use the C<-l> > option > to print the country name. > --- geoip-lookup-city Tue Mar 30 15:13:36 2010 > +++ geoip-lookup-city Mon Jan 09 18:57:48 2017 > @@ -6,7 +6,7 @@ > > my $addr = shift; > > -my $gi = Geo::IP::PurePerl->new( > "/usr/local/share/GeoIP/GeoIPCity.dat", > +my $gi = Geo::IP::PurePerl->new( "/usr/share/GeoIP/GeoIPCity.dat", > GEOIP_STANDARD ); > > if ($addr) { > --- geoip-lookup-isp Tue Mar 30 15:13:36 2010 > +++ geoip-lookup-isp Mon Jan 09 18:57:50 2017 > @@ -7,7 +7,7 @@ > > my $addr = shift; > > -my $gi = > Geo::IP::PurePerl- > >new("/usr/local/share/GeoIP/GeoIPISP.dat",GEOIP_STANDARD); > +my $gi = > Geo::IP::PurePerl- > >new("/usr/share/GeoIP/GeoIPISP.dat",GEOIP_STANDARD); > > my $isp = $gi->org_by_name($addr); > > --- geoip-lookup-netspeed Tue Mar 30 15:13:36 2010 > +++ geoip-lookup-netspeed Mon Jan 09 18:57:53 2017 > @@ -6,7 +6,7 @@ > > my $addr = $ARGV[0]; > > -my $gi = > Geo::IP::PurePerl- > >new("/usr/local/share/GeoIP/GeoIPNetSpeed.dat",GEOIP_STANDARD); > +my $gi = > Geo::IP::PurePerl- > >new("/usr/share/GeoIP/GeoIPNetSpeed.dat",GEOIP_STANDARD); > > my $netspeed = $gi->id_by_addr($addr); > > --- geoip-lookup-org Tue Mar 30 15:13:36 2010 > +++ geoip-lookup-org Mon Jan 09 18:57:59 2017 > @@ -7,7 +7,7 @@ > > my $addr = shift; > > -my $gi = > Geo::IP::PurePerl- > >new("/usr/local/share/GeoIP/GeoIPOrg.dat",GEOIP_STANDARD); > +my $gi = > Geo::IP::PurePerl- > >new("/usr/share/GeoIP/GeoIPOrg.dat",GEOIP_STANDARD); > > my $org = $gi->org_by_name($addr); > > --- geoip-lookup-region Tue Mar 30 15:13:36 2010 > +++ geoip-lookup-region Mon Jan 09 18:58:01 2017 > @@ -10,7 +10,7 @@ > > my $addr = $ARGV[0]; > > -my $gi = > Geo::IP::PurePerl- > >new("/usr/local/share/GeoIP/GeoIPRegion.dat",GEOIP_STANDARD); > +my $gi = > Geo::IP::PurePerl- > >new("/usr/share/GeoIP/GeoIPRegion.dat",GEOIP_STANDARD); > > my ($country,$region) = $gi->region_by_name($addr); > > --- INSTALL Tue Mar 30 15:13:36 2010 > +++ INSTALL Mon Jan 09 18:58:05 2017 > @@ -3,7 +3,7 @@ > # fetch latest GeoIP database, updated monthly > wget > http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/Geo > IP.dat.gz > gunzip GeoIP.dat.gz > -mv GeoIP.dat /usr/local/share/GeoIP/GeoIP.dat > +mv GeoIP.dat /usr/share/GeoIP/GeoIP.dat > > perl Makefile.PL > make > ***SNAP*** > > I think this is what you mean - would this be sufficient? I could > give > it a try... > > Best, > Matthias >