[SCM] Debian packaging of dh-make-perl branch, master, updated. debian/0.76-1-33-ga2d201b

Axel Beckert abe at deuxchevaux.org
Wed Mar 6 18:37:43 UTC 2013


The following commit has been merged in the master branch:
commit 156753a7c888566c03a84696ae3747a3ccbf0944
Author: Axel Beckert <abe at deuxchevaux.org>
Date:   Wed Mar 6 19:35:48 2013 +0100

    Add a cpan2dsc 'flavour' of dh-make-perl for easy .dsc creation

diff --git a/debian/changelog b/debian/changelog
index 733ab5d..cc577d9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -50,7 +50,9 @@ dh-make-perl (0.77-1) UNRELEASED; urgency=low
   * Add patch by Matthew Gabeler-Lee to understand packages named
     "-vX.Y.Z". (Closes: #701140)
   * Fix "fatal: pathspec '…' did not match any files" error of "git add".
-  * Add option --build-source to also build .dsc file (c.f. #645011)
+  * Add option --build-source to build .dsc file (c.f. #645011). Also add
+    a cpan2dsc 'flavour' of dh-make-perl. If it is called by that name,
+    the behaviour changes for easy .dsc creation.
 
  -- Salvatore Bonaccorso <carnil at debian.org>  Wed, 19 Sep 2012 15:11:17 +0200
 
diff --git a/debian/links b/debian/links
index f4ef83e..b4f9f7b 100644
--- a/debian/links
+++ b/debian/links
@@ -1,2 +1,4 @@
 usr/bin/dh-make-perl                usr/bin/cpan2deb
+usr/bin/dh-make-perl                usr/bin/cpan2dsc
 usr/share/man/man1/dh-make-perl.1p  usr/share/man/man1/cpan2deb.1p
+usr/share/man/man1/dh-make-perl.1p  usr/share/man/man1/cpan2dsc.1p
diff --git a/dh-make-perl b/dh-make-perl
index a19ea63..257648c 100755
--- a/dh-make-perl
+++ b/dh-make-perl
@@ -31,6 +31,8 @@ dh-make-perl - Create debian source packages from Perl modules
 
 =item cpan2deb I<MODULE>|I<DIST> I<options...>
 
+=item cpan2dsc I<MODULE>|I<DIST> I<options...>
+
 =back
 
 =head1 DESCRIPTION
@@ -57,6 +59,14 @@ it behaves like
 
     dh-make-perl make <options...> --build --cpan Foo::Bar
 
+If B<dh-make-perl> is called as
+
+    cpan2dsc <options...> Foo::Bar
+
+it behaves like
+
+    dh-make-perl make <options...> --build-source --cpan Foo::Bar
+
 Using this program is no excuse for not reading the
 debian developer documentation, including the Debian policy,
 the Debian Perl policy, the packaging manual and so on.
diff --git a/lib/DhMakePerl/Config.pm b/lib/DhMakePerl/Config.pm
index f04b448..d566529 100644
--- a/lib/DhMakePerl/Config.pm
+++ b/lib/DhMakePerl/Config.pm
@@ -52,6 +52,7 @@ __PACKAGE__->mk_accessors(
     },
     'command',
     'cpan2deb',
+    'cpan2dsc',
     '_explicitly_set',
 );
 
@@ -83,11 +84,18 @@ use constant cpan2deb_DEFAULTS => {
     #recursive   => 1,
 };
 
+use constant cpan2dsc_DEFAULTS => {
+    build_source => 1,
+
+    #recursive   => 1,
+};
+
 sub new {
     my $class = shift;
     my $values = shift || {};
 
     my $cpan2deb = basename($0) eq 'cpan2deb';
+    my $cpan2dsc = basename($0) eq 'cpan2dsc';
 
     my $self = $class->SUPER::new(
         {   %{ $class->DEFAULTS },
@@ -95,7 +103,12 @@ sub new {
                 ? %{ $class->cpan2deb_DEFAULTS }
                 : ()
             ),
+            (   $cpan2dsc
+                ? %{ $class->cpan2dsc_DEFAULTS }
+                : ()
+            ),
             cpan2deb    => $cpan2deb,
+            cpan2dsc    => $cpan2dsc,
             %$values,
         },
     );
@@ -197,6 +210,15 @@ sub parse_command_line_options {
         $self->command('make');
     }
 
+    if ($self->cpan2dsc) {
+        @ARGV == 1 or die "cpan2dsc requires exactly one non-option argument";
+
+        $self->cpan( shift @ARGV );
+        $self->_explicitly_set->{cpan} = 1;
+        $self->build_source(1);
+        $self->command('make');
+    }
+
     $self->check_obsolete_entries;
 }
 

-- 
Debian packaging of dh-make-perl



More information about the Pkg-perl-cvs-commits mailing list