The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
.project 018
Changes 17
MANIFEST 11
META.yml 56
Makefile.PL 11
README 42
inc/Module/Install/Base.pm 11
inc/Module/Install/Can.pm 679
inc/Module/Install/Fetch.pm 11
inc/Module/Install/Makefile.pm 1215
inc/Module/Install/Metadata.pm 1118
inc/Module/Install/Win32.pm 11
inc/Module/Install/WriteAll.pm 11
inc/Module/Install.pm 33
lib/Net/Abuse/Utils/Spamhaus.pm 2430
t/Net-Abuse-Utils-Spamhaus.t 123
test.pl 180
17 files changed (This is a version diff) 102187
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>net-abuse-utils-spamhaus</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.epic.perleditor.perlbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.aptana.projects.webnature</nature>
+		<nature>org.epic.perleditor.perlnature</nature>
+	</natures>
+</projectDescription>
@@ -1,5 +1,12 @@
 Revision history for Perl extension Net::Abuse::Utils::Spamhaus.
 
+0.06    2014-07-26
+    - bugfix [#1] api updates
+
+0.05    2014-04-07
+    - bugfix to DBL api
+    - debfix, Net::DNS 0.74
+
 0.04    2013-01-03
     - version bump
 
@@ -22,4 +29,3 @@ Revision history for Perl extension Net::Abuse::Utils::Spamhaus.
 0.00_01  Tue Mar 27 14:05:27 2012
 	- original version; created by h2xs 1.23 with options
 		-ABXb 5.8.8 Net::Abuse::Utils::Spamhaus
-
@@ -1,3 +1,4 @@
+.project
 Changes
 inc/Module/Install.pm
 inc/Module/Install/Base.pm
@@ -14,4 +15,3 @@ META.yml
 README
 rebuild.sh
 t/Net-Abuse-Utils-Spamhaus.t
-test.pl
@@ -3,11 +3,12 @@ abstract: 'Perl extension for checking data against the spamhaus blacklists'
 author:
   - 'Wes Young, <wes@barely3am.com>'
 build_requires:
-  ExtUtils::MakeMaker: 6.42
+  ExtUtils::MakeMaker: 6.59
 configure_requires:
-  ExtUtils::MakeMaker: 6.42
+  ExtUtils::MakeMaker: 6.59
 distribution_type: module
-generated_by: 'Module::Install version 1.00'
+dynamic_config: 1
+generated_by: 'Module::Install version 1.08'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -18,8 +19,8 @@ no_index:
     - inc
     - t
 requires:
-  Net::DNS::Resolver: 0.72
+  Net::DNS: '0.74'
   perl: 5.8.8
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.04
+version: '0.06'
@@ -3,6 +3,6 @@ use inc::Module::Install;
 name        'Net-Abuse-Utils-Spamhaus';
 all_from    'lib/Net/Abuse/Utils/Spamhaus.pm';
 
-requires    'Net::DNS::Resolver'   => '0.72';
+requires    'Net::DNS'  => '0.74';
 
 WriteAll();
@@ -23,10 +23,8 @@ To install this module type the following:
 
 COPYRIGHT AND LICENCE
 
-Copyright (C) 2012 by Wes Young
-Copyright (C) 2012 by the REN-ISAC (ren-isac.net)
-Copyright (C) 2012 by the Trustees of Indiana University (iu.edu)
+Copyright (C) 2014 Wes Young
 
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself, either Perl version 5.10.1 or,
-at your option, any later version of Perl 5 you may have available.
+at your option, any later version of Perl 5 you may have available.
\ No newline at end of file
@@ -4,7 +4,7 @@ package Module::Install::Base;
 use strict 'vars';
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '1.00';
+	$VERSION = '1.08';
 }
 
 # Suspend handler for "redefined" warnings
@@ -3,13 +3,12 @@ package Module::Install::Can;
 
 use strict;
 use Config                ();
-use File::Spec            ();
 use ExtUtils::MakeMaker   ();
 use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.00';
+	$VERSION = '1.08';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -29,7 +28,7 @@ sub can_use {
 	eval { require $mod; $pkg->VERSION($ver || 0); 1 };
 }
 
-# check if we can run some command
+# Check if we can run some command
 sub can_run {
 	my ($self, $cmd) = @_;
 
@@ -38,14 +37,88 @@ sub can_run {
 
 	for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
 		next if $dir eq '';
-		my $abs = File::Spec->catfile($dir, $_[1]);
+		require File::Spec;
+		my $abs = File::Spec->catfile($dir, $cmd);
 		return $abs if (-x $abs or $abs = MM->maybe_command($abs));
 	}
 
 	return;
 }
 
-# can we locate a (the) C compiler
+# Can our C compiler environment build XS files
+sub can_xs {
+	my $self = shift;
+
+	# Ensure we have the CBuilder module
+	$self->configure_requires( 'ExtUtils::CBuilder' => 0.27 );
+
+	# Do we have the configure_requires checker?
+	local $@;
+	eval "require ExtUtils::CBuilder;";
+	if ( $@ ) {
+		# They don't obey configure_requires, so it is
+		# someone old and delicate. Try to avoid hurting
+		# them by falling back to an older simpler test.
+		return $self->can_cc();
+	}
+
+	# Do we have a working C compiler
+	my $builder = ExtUtils::CBuilder->new(
+		quiet => 1,
+	);
+	unless ( $builder->have_compiler ) {
+		# No working C compiler
+		return 0;
+	}
+
+	# Write a C file representative of what XS becomes
+	require File::Temp;
+	my ( $FH, $tmpfile ) = File::Temp::tempfile(
+		"compilexs-XXXXX",
+		SUFFIX => '.c',
+	);
+	binmode $FH;
+	print $FH <<'END_C';
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+int main(int argc, char **argv) {
+    return 0;
+}
+
+int boot_sanexs() {
+    return 1;
+}
+
+END_C
+	close $FH;
+
+	# Can the C compiler access the same headers XS does
+	my @libs   = ();
+	my $object = undef;
+	eval {
+		local $^W = 0;
+		$object = $builder->compile(
+			source => $tmpfile,
+		);
+		@libs = $builder->link(
+			objects     => $object,
+			module_name => 'sanexs',
+		);
+	};
+	my $result = $@ ? 0 : 1;
+
+	# Clean up all the build files
+	foreach ( $tmpfile, $object, @libs ) {
+		next unless defined $_;
+		1 while unlink;
+	}
+
+	return $result;
+}
+
+# Can we locate a (the) C compiler
 sub can_cc {
 	my $self   = shift;
 	my @chunks = split(/ /, $Config::Config{cc}) or return;
@@ -78,4 +151,4 @@ if ( $^O eq 'cygwin' ) {
 
 __END__
 
-#line 156
+#line 236
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.00';
+	$VERSION = '1.08';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -8,7 +8,7 @@ use Fcntl qw/:flock :seek/;
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.00';
+	$VERSION = '1.08';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -215,18 +215,22 @@ sub write {
 	require ExtUtils::MakeMaker;
 
 	if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) {
-		# MakeMaker can complain about module versions that include
-		# an underscore, even though its own version may contain one!
-		# Hence the funny regexp to get rid of it.  See RT #35800
-		# for details.
-		my $v = $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/;
-		$self->build_requires(     'ExtUtils::MakeMaker' => $v );
-		$self->configure_requires( 'ExtUtils::MakeMaker' => $v );
+		# This previous attempted to inherit the version of
+		# ExtUtils::MakeMaker in use by the module author, but this
+		# was found to be untenable as some authors build releases
+		# using future dev versions of EU:MM that nobody else has.
+		# Instead, #toolchain suggests we use 6.59 which is the most
+		# stable version on CPAN at time of writing and is, to quote
+		# ribasushi, "not terminally fucked, > and tested enough".
+		# TODO: We will now need to maintain this over time to push
+		# the version up as new versions are released.
+		$self->build_requires(     'ExtUtils::MakeMaker' => 6.59 );
+		$self->configure_requires( 'ExtUtils::MakeMaker' => 6.59 );
 	} else {
 		# Allow legacy-compatibility with 5.005 by depending on the
 		# most recent EU:MM that supported 5.005.
-		$self->build_requires(     'ExtUtils::MakeMaker' => 6.42 );
-		$self->configure_requires( 'ExtUtils::MakeMaker' => 6.42 );
+		$self->build_requires(     'ExtUtils::MakeMaker' => 6.36 );
+		$self->configure_requires( 'ExtUtils::MakeMaker' => 6.36 );
 	}
 
 	# Generate the MakeMaker params
@@ -241,7 +245,6 @@ in a module, and provide its file path via 'version_from' (or
 'all_from' if you prefer) in Makefile.PL.
 EOT
 
-	$DB::single = 1;
 	if ( $self->tests ) {
 		my @tests = split ' ', $self->tests;
 		my %seen;
@@ -412,4 +415,4 @@ sub postamble {
 
 __END__
 
-#line 541
+#line 544
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.00';
+	$VERSION = '1.08';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -151,15 +151,21 @@ sub install_as_site   { $_[0]->installdirs('site')   }
 sub install_as_vendor { $_[0]->installdirs('vendor') }
 
 sub dynamic_config {
-	my $self = shift;
-	unless ( @_ ) {
-		warn "You MUST provide an explicit true/false value to dynamic_config\n";
-		return $self;
+	my $self  = shift;
+	my $value = @_ ? shift : 1;
+	if ( $self->{values}->{dynamic_config} ) {
+		# Once dynamic we never change to static, for safety
+		return 0;
 	}
-	$self->{values}->{dynamic_config} = $_[0] ? 1 : 0;
+	$self->{values}->{dynamic_config} = $value ? 1 : 0;
 	return 1;
 }
 
+# Convenience command
+sub static_config {
+	shift->dynamic_config(0);
+}
+
 sub perl_version {
 	my $self = shift;
 	return $self->{values}->{perl_version} unless @_;
@@ -170,7 +176,7 @@ sub perl_version {
 	# Normalize the version
 	$version = $self->_perl_version($version);
 
-	# We don't support the reall old versions
+	# We don't support the really old versions
 	unless ( $version >= 5.005 ) {
 		die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n";
 	}
@@ -515,6 +521,7 @@ sub __extract_license {
 		'GNU Free Documentation license'     => 'unrestricted', 1,
 		'GNU Affero General Public License'  => 'open_source',  1,
 		'(?:Free)?BSD license'               => 'bsd',          1,
+		'Artistic license 2\.0'              => 'artistic_2',   1,
 		'Artistic license'                   => 'artistic',     1,
 		'Apache (?:Software )?license'       => 'apache',       1,
 		'GPL'                                => 'gpl',          1,
@@ -550,9 +557,9 @@ sub license_from {
 
 sub _extract_bugtracker {
 	my @links   = $_[0] =~ m#L<(
-	 \Qhttp://rt.cpan.org/\E[^>]+|
-	 \Qhttp://github.com/\E[\w_]+/[\w_]+/issues|
-	 \Qhttp://code.google.com/p/\E[\w_\-]+/issues/list
+	 https?\Q://rt.cpan.org/\E[^>]+|
+	 https?\Q://github.com/\E[\w_]+/[\w_]+/issues|
+	 https?\Q://code.google.com/p/\E[\w_\-]+/issues/list
 	 )>#gx;
 	my %links;
 	@links{@links}=();
@@ -581,7 +588,7 @@ sub bugtracker_from {
 sub requires_from {
 	my $self     = shift;
 	my $content  = Module::Install::_readperl($_[0]);
-	my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg;
+	my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+(v?[\d\.]+)/mg;
 	while ( @requires ) {
 		my $module  = shift @requires;
 		my $version = shift @requires;
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.00';
+	$VERSION = '1.08';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.00';
+	$VERSION = '1.08';
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }
@@ -31,7 +31,7 @@ BEGIN {
 	# This is not enforced yet, but will be some time in the next few
 	# releases once we can make sure it won't clash with custom
 	# Module::Install extensions.
-	$VERSION = '1.00';
+	$VERSION = '1.08';
 
 	# Storage for the pseudo-singleton
 	$MAIN    = undef;
@@ -451,7 +451,7 @@ sub _version ($) {
 }
 
 sub _cmp ($$) {
-	_version($_[0]) <=> _version($_[1]);
+	_version($_[1]) <=> _version($_[2]);
 }
 
 # Cloned from Params::Util::_CLASS
@@ -467,4 +467,4 @@ sub _CLASS ($) {
 
 1;
 
-# Copyright 2008 - 2010 Adam Kennedy.
+# Copyright 2008 - 2012 Adam Kennedy.
@@ -4,7 +4,7 @@ use 5.008008;
 use strict;
 use warnings;
 
-our $VERSION = '0.04';
+our $VERSION = '0.06';
 $VERSION = eval $VERSION;  # see L<perlmodstyle>
 
 =head1 NAME
@@ -102,29 +102,38 @@ my $fqdn_codes = {
         assessment  => 'suspicious',
         description => 'spammed redirector domain',
     },
-    '127.0.1.255'   => {
-        description => 'BANNED',
+    '127.0.1.4' => {
+        assessment  => 'phishing',
+        description => 'phishing domain',
     },
-};
-
-foreach(4 ... 19){
-    $fqdn_codes->{'127.0.1.'.$_} = {
+    '127.0.1.5' => {
+        assessment  => 'malware',
+        description => 'malware domain',
+    },
+    '127.0.1.102' => {
         assessment  => 'suspicious',
-        description => 'spammed domain',
-    };
-}
-
-foreach(20 ... 39){
-   $fqdn_codes->{'127.0.1.'.$_} = {
+        description => 'abused legit spam',
+    },
+    '127.0.1.103' => {
+        assessment  => 'suspicious',
+        description => 'abused legit spammed redirector',
+    },
+    '127.0.1.104' => {
         assessment  => 'phishing',
-    };
-}
-
-foreach(40 ... 39){
-   $fqdn_codes->{'127.0.1.'.$_} = {
+        description => 'abused legit phish',
+    },
+    '127.0.1.105' => {
         assessment  => 'malware',
-    };
-}
+        description => 'abused legit malware',
+    },
+    '127.0.1.106' => {
+        assessment  => 'botnet',
+        description => 'abused legit botnet',
+    },
+    '127.0.1.255'   => {
+        description => 'BANNED',
+    },
+};
 
 sub _return_rr {
     my $lookup  = shift;
@@ -231,7 +240,6 @@ __END__
 
 =head1 SEE ALSO
 
-  github.com/collectiveintel
   http://www.spamhaus.org/zen/
   http://www.spamhaus.org/dbl/
 
@@ -241,9 +249,7 @@ Wes Young, E<lt>wes@barely3am.comE<gt>
 
 =head1 COPYRIGHT AND LICENSE
 
-  Copyright (C) 2012 by Wes Young (claimid.com/wesyoung)
-  Copyright (C) 2012 the REN-ISAC (ren-isac.net)
-  Copyright (C) 2012 the Trustees of Indiana University (www.iu.edu)
+  Copyright (C) 2012 by Wes Young (wesyoung.me)
 
   This library is free software; you can redistribute it and/or modify
   it under the same terms as Perl itself, either Perl version 5.10.1 or,
@@ -1,15 +1,6 @@
-# Before `make install' is performed this script should be runnable with
-# `make test'. After `make install' it should work as `perl Net-Abuse-Utils-Spamhaus.t'
-
-#########################
-
-# change 'tests => 1' to 'tests => last_test_to_print';
+use strict;
+use warnings;
+use 5.008008;
 
 use Test::More tests => 1;
 BEGIN { use_ok('Net::Abuse::Utils::Spamhaus') };
-
-#########################
-
-# Insert your test code below, the Test::More module is use()ed here so read
-# its man page ( perldoc Test::More ) for help writing this test script.
-
@@ -1,18 +0,0 @@
-#!/usr/bin/perl -w
-
-use strict;
-
-use lib './lib';
-use Net::Abuse::Utils::Spamhaus qw(check_fqdn check_ip);
-use Data::Dumper;
-
-my $addr = 'google.com';
-$addr = 'dbltest.com';
-$addr = 'ns1.qq.com';
-
-my $ip = '111.161.48.230';
-
-#my $ret = check_fqdn($addr);
-my $ret = check_ip($ip);
-
-warn Dumper($ret);