LWP-Authen-Wsse-0.05000755 001751 001751 00000000000 10354014226 015737 5ustar00autrijusautrijus000000 000000 LWP-Authen-Wsse-0.05/inc000755 001751 001751 00000000000 10354014224 016506 5ustar00autrijusautrijus000000 000000 LWP-Authen-Wsse-0.05/META.yml000644 001751 001751 00000000511 10354014217 017264 0ustar00autrijusautrijus000000 000000 abstract: Library for enabling X-WSSE authentication in LWP author: Audrey Tang distribution_type: module generated_by: Module::Install version 0.50 license: perl name: LWP-Authen-Wsse no_index: directory: - inc - t requires: Digest::SHA1: 0 LWP: 0 MIME::Base64: 0 perl: 5.004 version: 0.05 LWP-Authen-Wsse-0.05/Changes000644 001751 000000 00000000623 10354012362 016531 0ustar00autrijuswheel000000 000000 [Changes for 0.05 - 2005-12-27] * In nonce generation, use only one round of SHA1 instead of two, as an extra SHA1 hash doesn't make things any more unpredictable. [Changes for 0.04 - 2004-07-11] * Use 4-digit years. [Changes for 0.03 - 2004-06-02] * Corrected a mis-assignment on w3cdtf_now. Reported by: Benjamin Trott [Changes for 0.01 - 2004-05-16] * Initial commit of LWP::Authen::Wsse. LWP-Authen-Wsse-0.05/t000755 001751 001751 00000000000 10354014224 016200 5ustar00autrijusautrijus000000 000000 LWP-Authen-Wsse-0.05/MANIFEST000644 001751 001751 00000000517 10354014156 017154 0ustar00autrijusautrijus000000 000000 Changes inc/Module/Install.pm inc/Module/Install/Base.pm inc/Module/Install/Can.pm inc/Module/Install/Fetch.pm inc/Module/Install/Makefile.pm inc/Module/Install/Metadata.pm inc/Module/Install/Win32.pm inc/Module/Install/WriteAll.pm lib/LWP/Authen/Wsse.pm Makefile.PL MANIFEST This list of files META.yml README SIGNATURE t/1-basic.t LWP-Authen-Wsse-0.05/SIGNATURE000644 001751 001751 00000003264 10354014226 017307 0ustar00autrijusautrijus000000 000000 This file contains message digests of all files listed in MANIFEST, signed via the Module::Signature module, version 0.41. To verify the content in this distribution, first make sure you have Module::Signature installed, then type: % cpansign -v It would check each file's integrity, as well as the signature's validity. If "==> Signature verified OK! <==" is not displayed, the distribution may already have been compromised, and you should not run its Makefile.PL or Build.PL. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 SHA1 c483a98d32cd27aa152f61e65875af231efa2b2b Changes SHA1 a74b68bae87681b7814ca640d47cec2cba4826be MANIFEST SHA1 0bf6ab81c00c2543c5b3a54b2c71a543f6723be5 META.yml SHA1 6f6de2e68b0a2b01f4d173be4846428c4522cb22 Makefile.PL SHA1 97f5e40095be50e1770209da3abb3ac6c27ac878 README SHA1 79926a0c5e11e6106bc212b90650e194762df664 inc/Module/Install.pm SHA1 9ee1903ce87a8b3cdd4121de15272dc25e7bc807 inc/Module/Install/Base.pm SHA1 1ae0b64895f73745680a2c2950053f64ccc116cc inc/Module/Install/Can.pm SHA1 d097dedadac0edcafbee3a14c262e24089f5795e inc/Module/Install/Fetch.pm SHA1 9dc6e65553c7e70f57287ecbf2e072611bf2b27f inc/Module/Install/Makefile.pm SHA1 88978dc470082a5c88449f3f3d6d2b68e97f0ad7 inc/Module/Install/Metadata.pm SHA1 8ee248d67d4c61a4f01e6a96c41afbd93be4c9ef inc/Module/Install/Win32.pm SHA1 3c099dd7fb73a49bcc489b152c3ca3c7a1b36427 inc/Module/Install/WriteAll.pm SHA1 f0af3e93337384c8c562b57a79d7eae702015cab lib/LWP/Authen/Wsse.pm SHA1 fdfe63d27de37aa943916cbc5b22b6a789a89b0e t/1-basic.t -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFDsBiWtLPdNzw1AaARAmCWAJ4z0lhwxfaRcv4M+2dJr291wn1PwgCgi/Rj M5UcE9ea5TkMopLZEuXTaqE= =3ktK -----END PGP SIGNATURE----- LWP-Authen-Wsse-0.05/README000644 001751 000000 00000001236 10354013715 016122 0ustar00autrijuswheel000000 000000 This is the README file for LWP::Authen::Wsse, a library for enabling X-WSSE authentication in LWP. Please type "perldoc LWP::Authen::Wsse" after installation to see the module usage information. * Installation LWP::Authen::Wsse uses the standard perl module install process: cpansign -v # optional; see SIGNATURE for details perl Makefile.PL make # or 'nmake' on Win32 make test make install * Copyright Copyright 2004, 2005 by Audrey Tang . All rights reserved. You can redistribute and/or modify this bundle under the same terms as Perl itself. See . LWP-Authen-Wsse-0.05/Makefile.PL000644 001751 000000 00000000420 10354013662 017207 0ustar00autrijuswheel000000 000000 use strict; use inc::Module::Install; name 'LWP-Authen-Wsse'; author 'Audrey Tang '; all_from 'lib/LWP/Authen/Wsse.pm'; requires 'LWP'; requires 'Digest::SHA1'; requires 'MIME::Base64'; sign; WriteAll; LWP-Authen-Wsse-0.05/lib000755 001751 001751 00000000000 10354014224 016503 5ustar00autrijusautrijus000000 000000 LWP-Authen-Wsse-0.05/lib/LWP000755 001751 001751 00000000000 10354014224 017145 5ustar00autrijusautrijus000000 000000 LWP-Authen-Wsse-0.05/lib/LWP/Authen000755 001751 001751 00000000000 10354014224 020371 5ustar00autrijusautrijus000000 000000 LWP-Authen-Wsse-0.05/lib/LWP/Authen/Wsse.pm000644 001751 001751 00000007731 10354014215 021737 0ustar00autrijusautrijus000000 000000 package LWP::Authen::Wsse; use 5.004; use strict; use warnings; use English qw( -no_match_vars ); $LWP::Authen::Wsse::VERSION = '0.05'; use Digest::SHA1 (); use MIME::Base64 (); =head1 NAME LWP::Authen::Wsse - Library for enabling X-WSSE authentication in LWP =head1 VERSION This document describes version 0.05 of LWP::Authen::Wsse, released December 27, 2005. =head1 SYNOPSIS use LWP::UserAgent; use HTTP::Request::Common; my $url = 'http://www.example.org/protected_page.html'; # Set up the WSSE client my $ua = LWP::UserAgent->new; $ua->credentials('example.org', '', 'username', 'password'); $request = GET $url; print "--Performing request now...-----------\n"; $response = $ua->request($request); print "--Done with request-------------------\n"; if ($response->is_success) { print "It worked!->", $response->code, "\n"; } else { print "It didn't work!->", $response->code, "\n"; } =head1 DESCRIPTION C allows LWP to authenticate against servers that are using the C authentication scheme, as required by the Atom Authentication API. The module is used indirectly through LWP, rather than including it directly in your code. The LWP system will invoke the WSSE authentication when it encounters the authentication scheme while attempting to retrieve a URL from a server. You also need to set the credentials on the UserAgent object like this: $ua->credentials('www.company.com:80', '', "username", "password"); Alternatively, you may also subclass B and override the C method. See L for more details. =cut use constant WITHOUT_LINEBREAK => q{}; sub authenticate { my $class = shift; my ( $ua, $proxy, $auth_param, $response, $request, $arg, $size ) = @_; my ( $user, $pass ) = $ua->get_basic_credentials( $auth_param->{realm}, $request->url, $proxy ); ( defined $user and defined $pass ) or return $response; my $now = $class->now_w3cdtf; my $nonce = $class->make_nonce; my $nonce_enc = MIME::Base64::encode_base64( $nonce, WITHOUT_LINEBREAK ); my $digest = MIME::Base64::encode_base64( Digest::SHA1::sha1( $nonce . $now . $pass ), WITHOUT_LINEBREAK ); my $auth_header = ( $proxy ? 'Proxy-Authorization' : 'Authorization' ); my $wsse_value = 'UsernameToken ' . join( ', ', qq(Username="$user"), qq(PasswordDigest="$digest"), qq(Nonce="$nonce_enc"), qq(Created="$now"), ); my $referral = $request->clone; # Need to check this isn't a repeated fail! my $r = $response; my $failed; while ($r) { my $prev = $r->request->{wsse_user_pass}; if ( $r->code == 401 and $prev and $prev->[0] eq $user and $prev->[1] eq $pass and $failed++ ) { # here we know this failed before $response->header( 'Client-Warning' => "Credentials for '$user' failed before" ); return $response; } $r = $r->previous; } $referral->header( $auth_header => 'WSSE profile="UsernameToken"' ); $referral->header( 'X-WSSE' => $wsse_value ); $referral->{wsse_user_pass} = [ $user, $pass ]; $ua->request( $referral, $arg, $size, $response ); } sub make_nonce { Digest::SHA1::sha1( time() . {} . rand() . $PID ); } sub now_w3cdtf { my ( $sec, $min, $hour, $mday, $mon, $year ) = gmtime(); $mon++; $year += 1900; sprintf( '%04s-%02s-%02sT%02s:%02s:%02sZ', $year, $mon, $mday, $hour, $min, $sec, ); } 1; =head1 SEE ALSO L, L, L. =head1 AUTHORS Audrey Tang Eaudrey@audrey.orgE =head1 COPYRIGHT Copyright 2004, 2005 by Audrey Tang Eaudrey@audrey.orgE. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See L =cut LWP-Authen-Wsse-0.05/t/1-basic.t000644 001751 001751 00000000155 10354014145 017666 0ustar00autrijusautrijus000000 000000 use strict; use Test; BEGIN { plan tests => 1 } require LWP::Authen::Wsse; ok(LWP::Authen::Wsse->VERSION); LWP-Authen-Wsse-0.05/inc/Module000755 001751 001751 00000000000 10354014224 017733 5ustar00autrijusautrijus000000 000000 LWP-Authen-Wsse-0.05/inc/Module/Install.pm000644 001751 001751 00000012154 10354014216 021762 0ustar00autrijusautrijus000000 000000 #line 1 "/home/autrijus/.cpanplus/5.8.7/build/LWP-Authen-Wsse-0.04/inc/Module/Install.pm - /usr/local/lib/perl5/site_perl/5.8.7/Module/Install.pm" package Module::Install; use 5.004; $VERSION = '0.50'; # Don't forget to update Module::Install::Admin too! die << "." unless $INC{join('/', inc => split(/::/, __PACKAGE__)).'.pm'}; Please invoke ${\__PACKAGE__} with: use inc::${\__PACKAGE__}; not: use ${\__PACKAGE__}; . use strict 'vars'; use Cwd qw(cwd abs_path); use FindBin; use File::Find (); use File::Path (); @inc::Module::Install::ISA = 'Module::Install'; *inc::Module::Install::VERSION = *VERSION; sub autoload { my $self = shift; my $caller = $self->_caller; my $cwd = cwd(); my $sym = "$caller\::AUTOLOAD"; $sym->{$cwd} = sub { my $pwd = cwd(); if (my $code = $sym->{$pwd}) { goto &$code unless $cwd eq $pwd; # delegate back to parent dirs } $$sym =~ /([^:]+)$/ or die "Cannot autoload $caller - $sym"; unshift @_, ($self, $1); goto &{$self->can('call')} unless uc($1) eq $1; }; } sub import { my $class = shift; my $self = $class->new(@_); if (not -f $self->{file}) { require "$self->{path}/$self->{dispatch}.pm"; File::Path::mkpath("$self->{prefix}/$self->{author}"); $self->{admin} = "$self->{name}::$self->{dispatch}"->new(_top => $self); $self->{admin}->init; @_ = ($class, _self => $self); goto &{"$self->{name}::import"}; } *{$self->_caller . "::AUTOLOAD"} = $self->autoload; $self->preload; # Unregister loader and worker packages so subdirs can use them again delete $INC{"$self->{file}"}; delete $INC{"$self->{path}.pm"}; } sub preload { my ($self) = @_; $self->load_extensions( "$self->{prefix}/$self->{path}", $self ) unless $self->{extensions}; my @exts = @{$self->{extensions}}; unless (@exts) { my $admin = $self->{admin}; @exts = $admin->load_all_extensions; } my %seen_method; foreach my $obj (@exts) { while (my ($method, $glob) = each %{ref($obj) . '::'}) { next unless defined *{$glob}{CODE}; next if $method =~ /^_/; next if $method eq uc($method); $seen_method{$method}++; } } my $caller = $self->_caller; foreach my $name (sort keys %seen_method) { *{"${caller}::$name"} = sub { ${"${caller}::AUTOLOAD"} = "${caller}::$name"; goto &{"${caller}::AUTOLOAD"}; }; } } sub new { my ($class, %args) = @_; # ignore the prefix on extension modules built from top level. my $base_path = abs_path($FindBin::Bin); delete $args{prefix} unless abs_path(cwd()) eq $base_path; return $args{_self} if $args{_self}; $args{dispatch} ||= 'Admin'; $args{prefix} ||= 'inc'; $args{author} ||= '.author'; $args{bundle} ||= 'inc/BUNDLES'; $args{base} ||= $base_path; $class =~ s/^\Q$args{prefix}\E:://; $args{name} ||= $class; $args{version} ||= $class->VERSION; unless ($args{path}) { $args{path} = $args{name}; $args{path} =~ s!::!/!g; } $args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm"; bless(\%args, $class); } sub call { my $self = shift; my $method = shift; my $obj = $self->load($method) or return; unshift @_, $obj; goto &{$obj->can($method)}; } sub load { my ($self, $method) = @_; $self->load_extensions( "$self->{prefix}/$self->{path}", $self ) unless $self->{extensions}; foreach my $obj (@{$self->{extensions}}) { return $obj if $obj->can($method); } my $admin = $self->{admin} or die << "END"; The '$method' method does not exist in the '$self->{prefix}' path! Please remove the '$self->{prefix}' directory and run $0 again to load it. END my $obj = $admin->load($method, 1); push @{$self->{extensions}}, $obj; $obj; } sub load_extensions { my ($self, $path, $top_obj) = @_; unshift @INC, $self->{prefix} unless grep { $_ eq $self->{prefix} } @INC; local @INC = ($path, @INC); foreach my $rv ($self->find_extensions($path)) { my ($file, $pkg) = @{$rv}; next if $self->{pathnames}{$pkg}; local $@; my $new = eval { require $file; $pkg->can('new') }; if (!$new) { warn $@ if $@; next; } $self->{pathnames}{$pkg} = delete $INC{$file}; push @{$self->{extensions}}, &{$new}($pkg, _top => $top_obj ); } $self->{extensions} ||= []; } sub find_extensions { my ($self, $path) = @_; my @found; File::Find::find(sub { my $file = $File::Find::name; return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is; return if $1 eq $self->{dispatch}; $file = "$self->{path}/$1.pm"; my $pkg = "$self->{name}::$1"; $pkg =~ s!/!::!g; push @found, [$file, $pkg]; }, $path) if -d $path; @found; } sub _caller { my $depth = 0; my $caller = caller($depth); while ($caller eq __PACKAGE__) { $depth++; $caller = caller($depth); } $caller; } 1; LWP-Authen-Wsse-0.05/inc/Module/Install000755 001751 001751 00000000000 10354014224 021341 5ustar00autrijusautrijus000000 000000 LWP-Authen-Wsse-0.05/inc/Module/Install/Fetch.pm000644 001751 001751 00000004627 10354014217 023022 0ustar00autrijusautrijus000000 000000 #line 1 "inc/Module/Install/Fetch.pm - /usr/local/lib/perl5/site_perl/5.8.7/Module/Install/Fetch.pm" package Module::Install::Fetch; use Module::Install::Base; @ISA = qw(Module::Install::Base); $VERSION = '0.01'; sub get_file { my ($self, %args) = @_; my ($scheme, $host, $path, $file) = $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return; if ($scheme eq 'http' and !eval { require LWP::Simple; 1 }) { $args{url} = $args{ftp_url} or (warn("LWP support unavailable!\n"), return); ($scheme, $host, $path, $file) = $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return; } $|++; print "Fetching '$file' from $host... "; unless (eval { require Socket; Socket::inet_aton($host) }) { warn "'$host' resolve failed!\n"; return; } return unless $scheme eq 'ftp' or $scheme eq 'http'; require Cwd; my $dir = Cwd::getcwd(); chdir $args{local_dir} or return if exists $args{local_dir}; if (eval { require LWP::Simple; 1 }) { LWP::Simple::mirror($args{url}, $file); } elsif (eval { require Net::FTP; 1 }) { eval { # use Net::FTP to get past firewall my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600); $ftp->login("anonymous", 'anonymous@example.com'); $ftp->cwd($path); $ftp->binary; $ftp->get($file) or (warn("$!\n"), return); $ftp->quit; } } elsif (my $ftp = $self->can_run('ftp')) { eval { # no Net::FTP, fallback to ftp.exe require FileHandle; my $fh = FileHandle->new; local $SIG{CHLD} = 'IGNORE'; unless ($fh->open("|$ftp -n")) { warn "Couldn't open ftp: $!\n"; chdir $dir; return; } my @dialog = split(/\n/, << "."); open $host user anonymous anonymous\@example.com cd $path binary get $file $file quit . foreach (@dialog) { $fh->print("$_\n") } $fh->close; } } else { warn "No working 'ftp' program available!\n"; chdir $dir; return; } unless (-f $file) { warn "Fetching failed: $@\n"; chdir $dir; return; } return if exists $args{size} and -s $file != $args{size}; system($args{run}) if exists $args{run}; unlink($file) if $args{remove}; print(((!exists $args{check_for} or -e $args{check_for}) ? "done!" : "failed! ($!)"), "\n"); chdir $dir; return !$?; } 1; LWP-Authen-Wsse-0.05/inc/Module/Install/Can.pm000644 001751 001751 00000003237 10354014217 022466 0ustar00autrijusautrijus000000 000000 #line 1 "inc/Module/Install/Can.pm - /usr/local/lib/perl5/site_perl/5.8.7/Module/Install/Can.pm" package Module::Install::Can; use Module::Install::Base; @ISA = qw(Module::Install::Base); $VERSION = '0.01'; use strict; use Config (); use File::Spec (); use ExtUtils::MakeMaker (); # check if we can load some module sub can_use { my ($self, $mod, $ver) = @_; $mod =~ s{::|\\}{/}g; $mod .= ".pm" unless $mod =~ /\.pm$/i; my $pkg = $mod; $pkg =~ s{/}{::}g; $pkg =~ s{\.pm$}{}i; local $@; eval { require $mod; $pkg->VERSION($ver || 0); 1 }; } # check if we can run some command sub can_run { my ($self, $cmd) = @_; my $_cmd = $cmd; return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd)); for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') { my $abs = File::Spec->catfile($dir, $_[1]); return $abs if (-x $abs or $abs = MM->maybe_command($abs)); } return; } sub can_cc { my $self = shift; my @chunks = split(/ /, $Config::Config{cc}) or return; # $Config{cc} may contain args; try to find out the program part while (@chunks) { return $self->can_run("@chunks") || (pop(@chunks), next); } return; } # Fix Cygwin bug on maybe_command(); if ($^O eq 'cygwin') { require ExtUtils::MM_Cygwin; if (!defined(&ExtUtils::MM_Cygwin::maybe_command)) { *ExtUtils::MM_Cygwin::maybe_command = sub { my ($self, $file) = @_; if ($file =~ m{^/cygdrive/}i) { ExtUtils::MM_Win32->maybe_command($file); } else { $self->SUPER::maybe_command($file); } } } } 1; LWP-Authen-Wsse-0.05/inc/Module/Install/WriteAll.pm000644 001751 001751 00000001526 10354014217 023507 0ustar00autrijusautrijus000000 000000 #line 1 "inc/Module/Install/WriteAll.pm - /usr/local/lib/perl5/site_perl/5.8.7/Module/Install/WriteAll.pm" package Module::Install::WriteAll; use Module::Install::Base; @ISA = qw(Module::Install::Base); sub WriteAll { my $self = shift; my %args = ( meta => 1, sign => 0, inline => 0, check_nmake => 1, @_ ); $self->sign(1) if $args{sign}; $self->Meta->write if $args{meta}; $self->admin->WriteAll(%args) if $self->is_admin; if ($0 =~ /Build.PL$/i) { $self->Build->write; } else { $self->check_nmake if $args{check_nmake}; $self->makemaker_args( PL_FILES => {} ) unless $self->makemaker_args->{'PL_FILES'}; if ($args{inline}) { $self->Inline->write; } else { $self->Makefile->write; } } } 1; LWP-Authen-Wsse-0.05/inc/Module/Install/Makefile.pm000644 001751 001751 00000007745 10354014217 023512 0ustar00autrijusautrijus000000 000000 #line 1 "inc/Module/Install/Makefile.pm - /usr/local/lib/perl5/site_perl/5.8.7/Module/Install/Makefile.pm" package Module::Install::Makefile; use Module::Install::Base; @ISA = qw(Module::Install::Base); $VERSION = '0.01'; use strict 'vars'; use vars '$VERSION'; use ExtUtils::MakeMaker (); sub Makefile { $_[0] } sub prompt { shift; goto &ExtUtils::MakeMaker::prompt; } sub makemaker_args { my $self = shift; my $args = ($self->{makemaker_args} ||= {}); %$args = ( %$args, @_ ) if @_; $args; } sub build_subdirs { my $self = shift; my $subdirs = $self->makemaker_args->{DIR} ||= []; for my $subdir (@_) { push @$subdirs, $subdir; } } sub clean_files { my $self = shift; my $clean = $self->makemaker_args->{clean} ||= {}; %$clean = ( %$clean, FILES => join(" ", grep length, $clean->{FILES}, @_), ); } sub libs { my $self = shift; my $libs = ref $_[0] ? shift : [shift]; $self->makemaker_args( LIBS => $libs ); } sub inc { my $self = shift; $self->makemaker_args( INC => shift ); } sub write { my $self = shift; die "&Makefile->write() takes no arguments\n" if @_; my $args = $self->makemaker_args; $args->{DISTNAME} = $self->name; $args->{NAME} = $self->module_name || $self->name || $self->determine_NAME($args); $args->{VERSION} = $self->version || $self->determine_VERSION($args); $args->{NAME} =~ s/-/::/g; $args->{test} = {TESTS => $self->tests} if $self->tests; if ($] >= 5.005) { $args->{ABSTRACT} = $self->abstract; $args->{AUTHOR} = $self->author; } if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) { $args->{NO_META} = 1; } if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 ) { $args->{SIGN} = 1 if $self->sign; } delete $args->{SIGN} unless $self->is_admin; # merge both kinds of requires into prereq_pm my $prereq = ($args->{PREREQ_PM} ||= {}); %$prereq = ( %$prereq, map { @$_ } map { @$_ } grep $_, ($self->build_requires, $self->requires) ); # merge both kinds of requires into prereq_pm my $subdirs = ($args->{DIR} ||= []); if ($self->bundles) { foreach my $bundle (@{ $self->bundles }) { my ($file, $dir) = @$bundle; push @$subdirs, $dir if -d $dir; delete $prereq->{$file}; } } if (my $perl_version = $self->perl_version) { eval "use $perl_version; 1" or die "ERROR: perl: Version $] is installed, ". "but we need version >= $perl_version"; } my %args = map {($_ => $args->{$_})} grep {defined($args->{$_})} keys %$args; if ($self->admin->preop) { $args{dist} = $self->admin->preop; } ExtUtils::MakeMaker::WriteMakefile(%args); $self->fix_up_makefile(); } sub fix_up_makefile { my $self = shift; my $top_class = ref($self->_top) || ''; my $top_version = $self->_top->VERSION || ''; my $preamble = $self->preamble ? "# Preamble by $top_class $top_version\n" . $self->preamble : ''; my $postamble = "# Postamble by $top_class $top_version\n" . ($self->postamble || ''); local *MAKEFILE; open MAKEFILE, '< Makefile' or die $!; my $makefile = do { local $/; }; close MAKEFILE; $makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /; $makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g; $makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g; $makefile =~ s/^(FULLPERL = .*)/$1 -Iinc/m; $makefile =~ s/^(PERL = .*)/$1 -Iinc/m; open MAKEFILE, '> Makefile' or die $!; print MAKEFILE "$preamble$makefile$postamble"; close MAKEFILE; } sub preamble { my ($self, $text) = @_; $self->{preamble} = $text . $self->{preamble} if defined $text; $self->{preamble}; } sub postamble { my ($self, $text) = @_; $self->{postamble} ||= $self->admin->postamble; $self->{postamble} .= $text if defined $text; $self->{postamble} } 1; __END__ #line 286 LWP-Authen-Wsse-0.05/inc/Module/Install/Win32.pm000644 001751 001751 00000003632 10354014217 022666 0ustar00autrijusautrijus000000 000000 #line 1 "inc/Module/Install/Win32.pm - /usr/local/lib/perl5/site_perl/5.8.7/Module/Install/Win32.pm" package Module::Install::Win32; use Module::Install::Base; @ISA = qw(Module::Install::Base); $VERSION = '0.02'; use strict; # determine if the user needs nmake, and download it if needed sub check_nmake { my $self = shift; $self->load('can_run'); $self->load('get_file'); require Config; return unless ( $Config::Config{make} and $Config::Config{make} =~ /^nmake\b/i and $^O eq 'MSWin32' and !$self->can_run('nmake') ); print "The required 'nmake' executable not found, fetching it...\n"; require File::Basename; my $rv = $self->get_file( url => 'http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe', ftp_url => 'ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe', local_dir => File::Basename::dirname($^X), size => 51928, run => 'Nmake15.exe /o > nul', check_for => 'Nmake.exe', remove => 1, ); if (!$rv) { die << '.'; ------------------------------------------------------------------------------- Since you are using Microsoft Windows, you will need the 'nmake' utility before installation. It's available at: http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe or ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe Please download the file manually, save it to a directory in %PATH% (e.g. C:\WINDOWS\COMMAND\), then launch the MS-DOS command line shell, "cd" to that directory, and run "Nmake15.exe" from there; that will create the 'nmake.exe' file needed by this module. You may then resume the installation process described in README. ------------------------------------------------------------------------------- . } } 1; __END__ LWP-Authen-Wsse-0.05/inc/Module/Install/Base.pm000644 001751 001751 00000002011 10354014217 022624 0ustar00autrijusautrijus000000 000000 #line 1 "inc/Module/Install/Base.pm - /usr/local/lib/perl5/site_perl/5.8.7/Module/Install/Base.pm" package Module::Install::Base; # Suspend handler for "redefined" warnings BEGIN { my $w = $SIG{__WARN__}; $SIG{__WARN__} = sub { $w } }; #line 30 sub new { my ($class, %args) = @_; foreach my $method (qw(call load)) { *{"$class\::$method"} = sub { +shift->_top->$method(@_); } unless defined &{"$class\::$method"}; } bless(\%args, $class); } #line 48 sub AUTOLOAD { my $self = shift; goto &{$self->_top->autoload}; } #line 59 sub _top { $_[0]->{_top} } #line 70 sub admin { my $self = shift; $self->_top->{admin} or Module::Install::Base::FakeAdmin->new; } sub is_admin { my $self = shift; $self->admin->VERSION; } sub DESTROY {} package Module::Install::Base::FakeAdmin; my $Fake; sub new { $Fake ||= bless(\@_, $_[0]) } sub AUTOLOAD {} sub DESTROY {} 1; # Restore warning handler BEGIN { $SIG{__WARN__} = $SIG{__WARN__}->() }; __END__ #line 117 LWP-Authen-Wsse-0.05/inc/Module/Install/Metadata.pm000644 001751 001751 00000016036 10354014217 023506 0ustar00autrijusautrijus000000 000000 #line 1 "inc/Module/Install/Metadata.pm - /usr/local/lib/perl5/site_perl/5.8.7/Module/Install/Metadata.pm" package Module::Install::Metadata; use Module::Install::Base; @ISA = qw(Module::Install::Base); $VERSION = '0.04'; use strict 'vars'; use vars qw($VERSION); my @scalar_keys = qw< name module_name version abstract author license distribution_type perl_version tests >; my @tuple_keys = qw< build_requires requires recommends bundles >; sub Meta { shift } sub Meta_ScalarKeys { @scalar_keys } sub Meta_TupleKeys { @tuple_keys } foreach my $key (@scalar_keys) { *$key = sub { my $self = shift; return $self->{'values'}{$key} if defined wantarray and !@_; $self->{'values'}{$key} = shift; return $self; }; } sub sign { my $self = shift; return $self->{'values'}{'sign'} if defined wantarray and !@_; $self->{'values'}{'sign'} = ( @_ ? $_[0] : 1 ); return $self; } foreach my $key (@tuple_keys) { *$key = sub { my $self = shift; return $self->{'values'}{$key} unless @_; my @rv; while (@_) { my $module = shift or last; my $version = shift || 0; if ( $module eq 'perl' ) { $version =~ s{^(\d+)\.(\d+)\.(\d+)} {$1 + $2/1_000 + $3/1_000_000}e; $self->perl_version($version); next; } my $rv = [ $module, $version ]; push @rv, $rv; } push @{ $self->{'values'}{$key} }, @rv; @rv; }; } sub all_from { my ( $self, $file ) = @_; $self->version_from($file) unless $self->version; $self->perl_version_from($file) unless $self->perl_version; # The remaining probes read from POD sections; if the file # has an accompanying .pod, use that instead my $pod = $file; if ( $pod =~ s/\.pm$/.pod/i and -e $pod ) { $file = $pod; } $self->author_from($file) unless $self->author; $self->license_from($file) unless $self->license; $self->abstract_from($file) unless $self->abstract; } sub provides { my $self = shift; my $provides = ( $self->{'values'}{'provides'} ||= {} ); %$provides = (%$provides, @_) if @_; return $provides; } sub auto_provides { my $self = shift; return $self unless $self->is_admin; unless (-e 'MANIFEST') { warn "Cannot deduce auto_provides without a MANIFEST, skipping\n"; return $self; } require Module::Build; my $build = Module::Build->new( dist_name => $self->{name}, dist_version => $self->{version}, license => $self->{license}, ); $self->provides(%{ $build->find_dist_packages || {} }); } sub feature { my $self = shift; my $name = shift; my $features = ( $self->{'values'}{'features'} ||= [] ); my $mods; if ( @_ == 1 and ref( $_[0] ) ) { # The user used ->feature like ->features by passing in the second # argument as a reference. Accomodate for that. $mods = $_[0]; } else { $mods = \@_; } my $count = 0; push @$features, ( $name => [ map { ref($_) ? ( ref($_) eq 'HASH' ) ? %$_ : @$_ : $_ } @$mods ] ); return @$features; } sub features { my $self = shift; while ( my ( $name, $mods ) = splice( @_, 0, 2 ) ) { $self->feature( $name, @$mods ); } return @{ $self->{'values'}{'features'} }; } sub no_index { my $self = shift; my $type = shift; push @{ $self->{'values'}{'no_index'}{$type} }, @_ if $type; return $self->{'values'}{'no_index'}; } sub read { my $self = shift; $self->include_deps( 'YAML', 0 ); require YAML; my $data = YAML::LoadFile('META.yml'); # Call methods explicitly in case user has already set some values. while ( my ( $key, $value ) = each %$data ) { next unless $self->can($key); if ( ref $value eq 'HASH' ) { while ( my ( $module, $version ) = each %$value ) { $self->can($key)->($self, $module => $version ); } } else { $self->can($key)->($self, $value); } } return $self; } sub write { my $self = shift; return $self unless $self->is_admin; $self->admin->write_meta; return $self; } sub version_from { my ( $self, $file ) = @_; require ExtUtils::MM_Unix; $self->version( ExtUtils::MM_Unix->parse_version($file) ); } sub abstract_from { my ( $self, $file ) = @_; require ExtUtils::MM_Unix; $self->abstract( bless( { DISTNAME => $self->name }, 'ExtUtils::MM_Unix' ) ->parse_abstract($file) ); } sub _slurp { my ( $self, $file ) = @_; local *FH; open FH, "< $file" or die "Cannot open $file.pod: $!"; do { local $/; }; } sub perl_version_from { my ( $self, $file ) = @_; if ( $self->_slurp($file) =~ m/ ^ use \s* v? ([\d\.]+) \s* ; /ixms ) { $self->perl_version($1); } else { warn "Cannot determine perl version info from $file\n"; return; } } sub author_from { my ( $self, $file ) = @_; my $content = $self->_slurp($file); if ($content =~ m/ =head \d \s+ (?:authors?)\b \s* ([^\n]*) | =head \d \s+ (?:licen[cs]e|licensing|copyright|legal)\b \s* .*? copyright .*? \d\d\d[\d.]+ \s* (?:\bby\b)? \s* ([^\n]*) /ixms) { my $author = $1 || $2; $author =~ s{E}{<}g; $author =~ s{E}{>}g; $self->author($author); } else { warn "Cannot determine author info from $file\n"; } } sub license_from { my ( $self, $file ) = @_; if ( $self->_slurp($file) =~ m/ =head \d \s+ (?:licen[cs]e|licensing|copyright|legal)\b (.*?) (=head\\d.*|=cut.*|) \z /ixms ) { my $license_text = $1; my @phrases = ( 'under the same (?:terms|license) as perl itself' => 'perl', 'GNU public license' => 'gpl', 'GNU lesser public license' => 'gpl', 'BSD license' => 'bsd', 'Artistic license' => 'artistic', 'GPL' => 'gpl', 'LGPL' => 'lgpl', 'BSD' => 'bsd', 'Artistic' => 'artistic', ); while ( my ( $pattern, $license ) = splice( @phrases, 0, 2 ) ) { $pattern =~ s{\s+}{\\s+}g; if ( $license_text =~ /\b$pattern\b/i ) { $self->license($license); return 1; } } } warn "Cannot determine license info from $file\n"; return 'unknown'; } 1;