debian/0000755000000000000000000000000011765200072007166 5ustar debian/compat0000644000000000000000000000000211765200072010364 0ustar 8 debian/changelog0000644000000000000000000001006711765200072011044 0ustar libmodule-depends-perl (0.16-1) unstable; urgency=low * Team upload. [ Ansgar Burchardt ] * debian/control: Convert Vcs-* fields to Git. [ Salvatore Bonaccorso ] * debian/copyright: Replace DEP5 Format-Specification URL from svn.debian.org to anonscm.debian.org URL. [ intrigeri ] * Refresh set-environment-variables.patch. * Get refreshed cpan_meta.patch back. * Bump Standards-Version to 3.9.3 (no change required). * Update debian/copyright to nowadays standards, thanks to cme. -- intrigeri Sun, 10 Jun 2012 22:14:24 +0200 libmodule-depends-perl (0.15-2) unstable; urgency=low [ gregor herrmann ] * Clean up the additional features added by our patches: - Combine patches yaml_xs.patch, meta_json.patch, and configure_test_requires.patch into new patch cpan_meta.patch. Update META.json test case. Use CPAN::META for parsing META.yml and META.json. - Drop support for test_requires for old META.yml syntax; test_requires never existed in the CPAN metadata specification. - Change (build) dependency from libyaml-libyaml-perl to libcpan-meta-perl. - Adjust long description (referred only to META.yml). - Closes: #609351. * Bump debhelper compatibility level to 8. [ Maximilian Gass ] * Bump Standards-Version to 3.9.2 (no changes necessary) -- gregor herrmann Fri, 03 Jun 2011 13:39:14 +0200 libmodule-depends-perl (0.15-1) unstable; urgency=low [ Ryan Niebur ] * Take over for the Debian Perl Group * debian/control: Added: Vcs-Svn field (source stanza); Vcs-Browser field (source stanza); Homepage field (source stanza); ${misc:Depends} to Depends: field. Changed: Maintainer set to Debian Perl Group (was: James Bromberger ). * debian/watch: use dist-based URL. * Switch to YAML::XS to support JSON META.ymls (Closes: #541159) * Look at META.json too (Closes: #541164) * look at configure_requires and test_requires as well (Closes: #541165) * use dh7 * set Standards-Version to 3.8.3 * fixup descriptions * machine readable copyright format * use Env::Sanctify to set some env variables in Intrusive [ gregor herrmann ] * debian/watch: remove call to uupdate. * New upstream release: fixes "Dies when Makefile.PL doesn't return a true value" (closes: #317061) * Switch to source format 3.0 (quilt). * debian/copyright: update years of upstream copyright and formatting. * Add /me to Uploaders. * Set Standards-Version to 3.9.1; remove ancient version from perl build dependency. * Refresh patches and add tests for two of them. -- gregor herrmann Fri, 17 Dec 2010 21:45:14 +0100 libmodule-depends-perl (0.14-3) unstable; urgency=low * Fix watch file (again???!). -- James Bromberger Mon, 04 May 2009 21:21:20 +0100 libmodule-depends-perl (0.14-2) unstable; urgency=low * Remove dh-make-perl boilerplait (just the last lines). Closes: #507469. -- James Bromberger Sat, 10 Jan 2009 13:34:36 +0000 libmodule-depends-perl (0.14-1) unstable; urgency=low * New upstream release * Correct watch file to not get the wrong module (was matching Module::Tree) * Standards updated to 3.8.0; no changes required -- James Bromberger Sat, 26 Jul 2008 16:27:09 +0100 libmodule-depends-perl (0.10-1) unstable; urgency=low * New upstream release -- James Bromberger Tue, 26 Jul 2005 23:19:51 +0100 libmodule-depends-perl (0.07-1) unstable; urgency=low * New upstream release. * Moved ${misc:Depends} from control file. -- James Bromberger Fri, 25 Feb 2005 00:49:20 +0000 libmodule-depends-perl (0.05-2) unstable; urgency=low * Fixed dependency on libclass-accessor-chained-perl. Closes: #258743. -- James Bromberger Tue, 13 Jul 2004 13:32:02 +0100 libmodule-depends-perl (0.05-1) unstable; urgency=low * Initial Release. Closes: #256016. -- James Bromberger Sat, 26 Jun 2004 01:38:31 +0100 debian/rules0000755000000000000000000000003611765200072010245 0ustar #!/usr/bin/make -f %: dh $@ debian/patches/0000755000000000000000000000000011765200072010615 5ustar debian/patches/set-environment-variables.patch0000644000000000000000000000142011765200072016736 0ustar Description: set some variables to keep the build system from doing stupid stuff Origin: vendor Forwarded: no Author: Ryan Niebur Reviewed-by: gregor herrmann Last-Update: 2010-11-17 --- a/lib/Module/Depends/Intrusive.pm +++ b/lib/Module/Depends/Intrusive.pm @@ -3,6 +3,7 @@ package Module::Depends::Intrusive; use base qw( Module::Depends ); use Cwd qw( getcwd ); use ExtUtils::MakeMaker (); +use Env::Sanctify; sub _find_modules { my $self = shift; @@ -86,6 +87,7 @@ sub _find_modules { no strict; no warnings; local $0 = $file; + my $sanctify = Env::Sanctify->sanctify( env => { PERL_MM_USE_DEFAULT => 1, PERL_AUTOINSTALL => "--skipdeps" } ); do "$file"; }; $self->error( $@ ) if $@; debian/patches/cpan_meta.patch0000644000000000000000000001643111765200072013572 0ustar Description: Support META.json additionally to META.yml; add support for test_requires; use CPAN::META. Origin: vendor Bug: https://rt.cpan.org/Ticket/Display.html?id=64017 https://rt.cpan.org/Ticket/Display.html?id=64016 Bug-Debian: http://bugs.debian.org/541159 http://bugs.debian.org/541164 http://bugs.debian.org/541165 Forwarded: yes Author: Ryan Niebur gregor herrmann intrigeri Reviewed-by: gregor herrmann Last-Update: 2012-06-10 diff --git a/lib/Module/Depends.pm b/lib/Module/Depends.pm index aa3fd9b..984b6d4 100644 --- a/lib/Module/Depends.pm +++ b/lib/Module/Depends.pm @@ -1,9 +1,9 @@ use strict; package Module::Depends; -use Parse::CPAN::Meta; +use CPAN::Meta; use Cwd qw( getcwd ); use base qw( Class::Accessor::Chained ); -__PACKAGE__->mk_accessors(qw( dist_dir debug libs requires configure_requires build_requires error )); +__PACKAGE__->mk_accessors(qw( dist_dir debug libs requires configure_requires build_requires test_requires error )); our $VERSION = '0.16'; =head1 NAME @@ -12,7 +12,6 @@ Module::Depends - identify the dependencies of a distribution =head1 SYNOPSIS - use YAML; use Module::Depends; my $deps = Module::Depends->new->dist_dir( '.' )->find_modules; print "Our dependencies:\n", Dump $deps->requires; @@ -42,6 +41,7 @@ sub new { libs => [], requires => {}, build_requires => {}, + test_requires => {}, configure_requires => {}, error => '', }); @@ -53,7 +53,7 @@ Path where the distribution has been extracted to. =head2 find_modules -scan the C to populate C, C, and C +scan the C to populate C, C, C, C, and C =cut @@ -75,14 +75,17 @@ sub find_modules { sub _find_modules { my $self = shift; - my ($file) = grep { -e $_ } qw( MYMETA.yml META.yml ); + my ($file) = grep { -e $_ } qw( MYMETA.json MYMETA.yml META.json META.yml ); if ($file) { - my $meta = ( Parse::CPAN::Meta::LoadFile( $file ) )[0]; - $self->requires( $meta->{requires} ); - $self->build_requires( $meta->{build_requires} ); + my $meta = CPAN::Meta->load_file( $file ); + my $prereqs = $meta->effective_prereqs(); + $self->requires( $prereqs->requirements_for( 'runtime', 'requires' )->as_string_hash() ); + $self->build_requires( $prereqs->requirements_for( 'build', 'requires' )->as_string_hash() ); + $self->configure_requires( $prereqs->requirements_for( 'configure', 'requires' )->as_string_hash() ); + $self->test_requires( $prereqs->requirements_for( 'test', 'requires' )->as_string_hash() ); } else { - $self->error( "No META.yml found in ". $self->dist_dir ); + $self->error( "No {MY,}META.{json,yml} found in ". $self->dist_dir ); } return $self; } diff --git a/lib/Module/Depends/Intrusive.pm b/lib/Module/Depends/Intrusive.pm index ae240b9..6d57287 100644 --- a/lib/Module/Depends/Intrusive.pm +++ b/lib/Module/Depends/Intrusive.pm @@ -33,6 +33,8 @@ sub _find_modules { my %args = @_; $self->requires( $args{requires} || {} ); $self->build_requires( $args{build_requires} || {} ); + $self->test_requires( $args{test_requires} || {} ); + $self->configure_requires( $args{configure_requires} || {} ); bless {}, "Module::Depends::Intrusive::Fake::Module::Build"; }; local *Module::Build::subclass = sub { 'Module::Build' }; @@ -41,6 +43,7 @@ sub _find_modules { my $WriteMakefile = sub { my %args = @_; $self->requires( $args{PREREQ_PM} || {} ); + $self->build_requires ( $args{BUILD_REQUIRES} || {} ); 1; }; local *main::WriteMakefile; @@ -63,7 +66,7 @@ sub _find_modules { all_from auto_install AUTOLOAD build_requires check_nmake include include_deps installdirs Makefile makemaker_args Meta name no_index requires WriteAll clean_files can_cc sign cc_inc_paths cc_files - cc_optimize_flags author license + cc_optimize_flags author license test_requires ); local *inc::Module::Install::AUTOLOAD = sub { 1 }; @@ -80,6 +83,10 @@ sub _find_modules { my %deps = (@_ == 1 ? ( $_[0] => 0 ) : @_); $self->configure_requires->{ $_ } = $deps{ $_ } for keys %deps; }; + local *inc::Module::Install::test_requires = sub { + my %deps = (@_ == 1 ? ( $_[0] => 0 ) : @_); + $self->test_requires->{ $_ } = $deps{ $_ } for keys %deps; + }; my $file = File::Spec->catfile( getcwd(), $pl ); eval { diff --git a/t/depends.t b/t/depends.t index 423df2d..f7e93a6 100644 --- a/t/depends.t +++ b/t/depends.t @@ -1,7 +1,7 @@ #!perl use strict; use warnings; -use Test::More tests => 20; +use Test::More tests => 21; my $class = 'Module::Depends::Intrusive'; require_ok("Module::Depends"); require_ok($class); @@ -68,6 +68,10 @@ my $distant = Module::Depends->new->dist_dir('t/with-yaml')->find_modules; is_deeply( $distant->requires, $our_requires, "got our own requires, non-intrusively, from a distance" ); +my $json = Module::Depends->new->dist_dir('t/with-json')->find_modules; +is_deeply( $json->requires, $our_requires, + "got our own requires, non-intrusively, from a distance" ); + my $inline_mm = $class->new->dist_dir('t/inline-makemaker')->find_modules; is_deeply( $inline_mm->requires, diff --git a/t/with-json/META.json b/t/with-json/META.json new file mode 100644 index 0000000..5253ffa --- /dev/null +++ b/t/with-json/META.json @@ -0,0 +1,56 @@ +{ + "abstract" : "identify the dependencies of a distribution", + "author" : [ + "unknown" + ], + "dynamic_config" : 1, + "generated_by" : "Module::Build version 0.2608, CPAN::Meta::Converter version 2.110930", + "license" : [ + "perl_5" + ], + "meta-spec" : { + "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", + "version" : "2" + }, + "name" : "Module-Depends", + "prereqs" : { + "build" : { + "requires" : { + "Test::More" : 0 + } + }, + "test" : { + "requires" : { + "Test::Fatal" : 0 + } + }, + "runtime" : { + "requires" : { + "Class::Accessor::Chained" : 0, + "File::Spec" : 0, + "File::chdir" : 0, + "YAML" : 0 + } + } + }, + "provides" : { + "Module::Depends" : { + "file" : "lib/Module/Depends.pm", + "version" : "0.06" + }, + "Module::Depends::Intrusive" : { + "file" : "lib/Module/Depends/Intrusive.pm", + "version" : 0 + }, + "Module::Depends::Intrusive::Fake::Module::Build" : { + "file" : "lib/Module/Depends/Intrusive.pm", + "version" : 0 + }, + "main" : { + "file" : "lib/Module/Depends/Intrusive.pm", + "version" : 0 + } + }, + "release_status" : "stable", + "version" : "0.06" +} diff --git a/t/with-yaml/META.yml b/t/with-yaml/META.yml index ce1faa9..024e7b2 100644 --- a/t/with-yaml/META.yml +++ b/t/with-yaml/META.yml @@ -11,6 +11,8 @@ requires: YAML: 0 build_requires: Test::More: 0 +configure_requires: + Test::Fatal: 0 provides: Module::Depends: file: lib/Module/Depends.pm debian/patches/series0000644000000000000000000000006011765200072012026 0ustar cpan_meta.patch set-environment-variables.patch debian/watch0000644000000000000000000000017111765200072010216 0ustar version=3 http://search.cpan.org/dist/Module-Depends/ .*/Module-Depends-v?(\d[\d.-]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$ debian/source/0000755000000000000000000000000011765200072010466 5ustar debian/source/format0000644000000000000000000000001411765200072011674 0ustar 3.0 (quilt) debian/copyright0000644000000000000000000000216111765200072011121 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: Module-Depends Upstream-Contact: Richard Clamp Source: http://search.cpan.org/dist/Module-Depends/ Files: * Copyright: 2004-2008, Fotango 2010, Richard Clamp License: Artistic or GPL-1+ Files: debian/* Copyright: 2004, 2005, 2008, 2009, James Bromberger 2010, Ryan Niebur 2010, gregor herrmann License: Artistic or GPL-1+ License: Artistic This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License, which comes with Perl. . On Debian systems, the complete text of the Artistic License can be found in `/usr/share/common-licenses/Artistic'. License: GPL-1+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. . On Debian systems, the complete text of version 1 of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-1'. debian/TODO0000644000000000000000000000014511765200072007656 0ustar * recommends and conflicts support * http://rt.cpan.org/Public/Dist/Display.html?Name=Module-Depends debian/control0000644000000000000000000000223411765200072010572 0ustar Source: libmodule-depends-perl Section: perl Priority: optional Build-Depends: debhelper (>= 8) Build-Depends-Indep: perl, libclass-accessor-chained-perl, libcpan-meta-perl, libenv-sanctify-perl, libfile-chdir-perl Maintainer: Debian Perl Group Uploaders: Ryan Niebur , gregor herrmann Standards-Version: 3.9.3 Homepage: http://search.cpan.org/dist/Module-Depends/ Vcs-Git: git://git.debian.org/pkg-perl/packages/libmodule-depends-perl.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-perl/packages/libmodule-depends-perl.git Package: libmodule-depends-perl Architecture: all Depends: ${misc:Depends}, ${perl:Depends}, libclass-accessor-chained-perl, libcpan-meta-perl, libenv-sanctify-perl, libfile-chdir-perl Description: Perl module to identify the dependencies of a distribution Module::Depends extracts module dependencies from an unpacked distribution tree. . Module::Depends only evaluates the {MY,}META.{json,yml} files shipped with a distribution. This won't be effective until all distributions ship such files, so you should look at Module::Depends::Intrusive.