[dsc] dsc wishlist for building a Debian package

Marc Haber mh+dsc at zugschlus.de
Tue Oct 19 11:45:06 UTC 2010


On Mon, Oct 04, 2010 at 03:16:40PM +0200, Marc Haber wrote:
> Hardest thing first: the presenter depends on IP::Country, which is
> not yet packaged for Debian. And packaging IP::Country is problematic,
> since it contains a database which is copyrighted by the RIRs and thus
> cannot be part of Debian main. Would it possible to adapt DSC in a way
> that IP::Country would only be optional, with only the geoIP-based
> statistics being unavailable if IP::Country isn't present? As an
> alternative, is it possible to make dsc use Geo::IP, which looks like
> it's significantly better maintained and which is already supported in
> Debian?

Replacing IP::Country with Geo::IP is a rather trivial patch:

--- a/presenter/perllib/DSC/grapher/plot.pm
+++ b/presenter/perllib/DSC/grapher/plot.pm
@@ -246,9 +246,9 @@ my $std_accum_yaxes = {
     names      => [ qw(Unknown IANA LACNIC APNIC RIPE ARIN) ],
     colors     => [ qw(black red purple yellow blue brightgreen) ],
     label_func => sub {
-       use IP::Country;
-       my $l = new IP::Country::Fast;
-       $l->inet_atocc(shift) || '??';
+       use Geo::IP;
+       my $l = Geo::IP->new(GEOIP_MEMORY_CACHE|GEOIP_CHECK_CACHE);
+       $l->country_code_by_addr(shift) || '??';
     },
     color_func => sub {
        use IP::Authority;

Since IP::Country gives somewhat better results than Geo::IP with the
free database, I would like to have dsc try IP::Country first and fall
back to Geo::IP only if IP::Country was not found. However, doing this
is beyond my limited perl capabilities.

Greetings
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things."    Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature |  How to make an American Quilt | Fax: *49 3221 2323190



More information about the dsc mailing list