Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add Net::Pcap plugin, which fixes the module's Makefile.PL.

  • Loading branch information...
commit 9dcf14137c349b6c816b10baf04ac40c1bd30bd3 1 parent 7b44a02
@voegelas authored
View
1  Changes
@@ -7,6 +7,7 @@ Revision history for CPANPLUS-Dist-Slackware
occur when these modules are built with the GCC compiler flag
"-Werror=format-security".
- Add Convert::BinHex plugin, which fixes a bug in the module's test suite.
+- Add Net::Pcap plugin, which fixes the module's Makefile.PL.
0.05 2012-02-01 19:31:33 CET
View
1  MANIFEST
@@ -14,6 +14,7 @@ lib/CPANPLUS/Dist/Slackware/PackageDescription.pm
lib/CPANPLUS/Dist/Slackware/Plugin/Alien/wxWidgets.pm
lib/CPANPLUS/Dist/Slackware/Plugin/Convert/BinHex.pm
lib/CPANPLUS/Dist/Slackware/Plugin/Mail/SpamAssassin.pm
+lib/CPANPLUS/Dist/Slackware/Plugin/Net/Pcap.pm
lib/CPANPLUS/Dist/Slackware/Plugin/Padre.pm
lib/CPANPLUS/Dist/Slackware/Plugin/YAML/LibYAML.pm
lib/CPANPLUS/Dist/Slackware/Plugin/YAML/Syck.pm
View
112 lib/CPANPLUS/Dist/Slackware/Plugin/Net/Pcap.pm
@@ -0,0 +1,112 @@
+package CPANPLUS::Dist::Slackware::Plugin::Net::Pcap;
+
+use strict;
+use warnings;
+
+use File::Spec qw();
+
+our $VERSION = '0.01';
+
+sub available {
+ my ( $plugin, $dist ) = @_;
+ return ( $dist->parent->package_name eq 'Net-Pcap' );
+}
+
+sub pre_prepare {
+ my ( $plugin, $dist ) = @_;
+
+ my $module = $dist->parent;
+ my $cb = $module->parent;
+
+ my $wrksrc = $module->status->extract;
+ return if !$wrksrc;
+
+ # See L<https://rt.cpan.org/Ticket/Display.html?id=73335>.
+ my $filename = File::Spec->catfile( $wrksrc, 'Makefile.PL' );
+ if ( -f $filename ) {
+ my $code = $dist->_read_file($filename);
+ if ( $code =~ /\$options{CCFLAGS}/xms ) {
+ $code =~ s/^(\s+\$options{CCFLAGS})/#$1/xms;
+ $cb->_move( file => $filename, to => "$filename.orig" ) or return;
+ $dist->_write_file( $filename, $code ) or return;
+ }
+ }
+
+ return 1;
+}
+
+1;
+__END__
+
+=head1 NAME
+
+CPANPLUS::Dist::Slackware::Plugin::Net::Pcap - Patch C<Net::Pcap> if
+necessary
+
+=head1 VERSION
+
+This documentation refers to
+C<CPANPLUS::Dist::Slackware::Plugin::Net::Pcap> version 0.01.
+
+=head1 SYNOPSIS
+
+ $is_available = $plugin->available($dist);
+ $success = $plugin->pre_prepare($dist);
+
+=head1 DESCRIPTION
+
+Fix the libpcap detection. Reported as bug #73335 at L<http://rt.cpan.org/>.
+
+=head1 SUBROUTINES/METHODS
+
+=over 4
+
+=item B<< $plugin->available($dist) >>
+
+Returns true if this plugin applies to the given Perl distribution.
+
+=item B<< $plugin->pre_prepare($dist) >>
+
+Patch F<Makefile.PL> if necessary.
+
+=back
+
+=head1 DIAGNOSTICS
+
+None.
+
+=head1 CONFIGURATION AND ENVIRONMENT
+
+None.
+
+=head1 DEPENDENCIES
+
+Requires the module C<File::Spec>.
+
+=head1 INCOMPATIBILITIES
+
+None known.
+
+=head1 SEE ALSO
+
+C<CPANPLUS::Dist::Slackware>
+
+=head1 AUTHOR
+
+Andreas Voegele, C<< <andreas at andreasvoegele.com> >>
+
+=head1 BUGS AND LIMITATIONS
+
+Please report any bugs to C<bug-cpanplus-dist-slackware at rt.cpan.org>, or
+through the web interface at L<http://rt.cpan.org/>.
+
+=head1 LICENSE AND COPYRIGHT
+
+Copyright (c) 2012 Andreas Voegele
+
+This library is free software; you can redistribute it and/or modify it under
+the same terms as Perl itself.
+
+See http://dev.perl.org/licenses/ for more information.
+
+=cut
Please sign in to comment.
Something went wrong with that request. Please try again.