[SCM] Debian packaging of libsoftware-license-perl branch, master, updated. 33505d2fbb8f7612450811be1a846ecead6168e8

Dominique Dumont dod at debian.org
Fri Oct 7 15:58:16 UTC 2011


The following commit has been merged in the master branch:
commit b3218b12185c1d517660fc9462aabb04a646330c
Author: Dominique Dumont <dod at debian.org>
Date:   Thu Oct 6 18:08:16 2011 +0200

    added pod doc

diff --git a/debian/patches/create-license-from-short-name b/debian/patches/create-license-from-short-name
index c97fcc5..9da24e7 100644
--- a/debian/patches/create-license-from-short-name
+++ b/debian/patches/create-license-from-short-name
@@ -1,6 +1,6 @@
 --- a/lib/Software/License.pm
 +++ b/lib/Software/License.pm
-@@ -11,13 +11,38 @@
+@@ -11,15 +11,51 @@
  use Sub::Install ();
  use Text::Template ();
  
@@ -15,6 +15,11 @@
 +  'Artistic-1' => 'Artistic_1_0',
 +  'Artistic-2' => 'Artistic_2_0',
 +);
++
++# Software::License is a virtual class. On the other hand, it's a
++# natural entry point to create "real" license using short names.
++# Of the 2 solutions provided below, I don't know which one is the best
++# (or the worse).
  
  sub new {
    my ($class, $arg) = @_;
@@ -22,21 +27,45 @@
    Carp::croak "no copyright holder specified" unless $arg->{holder};
  
 -  bless $arg => $class;
++  # This ugly hack avoids having 2 constructors.
 +  if ($class eq __PACKAGE__ ) {
-+    # must create a new license using license short name
-+    Carp::croak "no license short name specified" unless $arg->{short_name};
-+    my $short = delete $arg->{short_name} ;
-+    my $lic = $short_name{$short} ;
-+    Carp::croak "Unknow license with short name $short" unless $lic;
-+
-+    my $lic_file = my $lic_class = __PACKAGE__.'::'.$lic ;
-+    $lic_file =~ s!::!/!g ;
-+    require "$lic_file.pm";
-+    return $lic_class->new ($arg) ;
++    return new_from_short_name(@_) ;
 +  }
 +  else {
 +    bless $arg => $class;
 +  }
  }
  
++# here's a second constructor that will provide a real license
++sub new_from_short_name {
++  my ($class, $arg) = @_;
++
++  Carp::croak "no license short name specified" unless $arg->{short_name};
++  my $short = delete $arg->{short_name} ;
++  my $lic = $short_name{$short} ;
++  Carp::croak "Unknow license with short name $short" unless $lic;
++
++  my $lic_file = my $lic_class = __PACKAGE__.'::'.$lic ;
++  $lic_file =~ s!::!/!g ;
++  require "$lic_file.pm";
++  return $lic_class->new ($arg) ;
++}
+ 
+ sub year   { defined $_[0]->{year} ? $_[0]->{year} : (localtime)[5]+1900 }
+ sub holder { $_[0]->{holder}     }
+@@ -117,6 +153,15 @@
+   holder - the holder of the copyright; required
+   year   - the year of copyright; defaults to current year
+ 
++=head2 new_from_short_name
++
++ my $license = Software::License -> new_from_short_name(
++   { short_name => 'GPL-1', %arg }
++ );
++
++This constructor will return the correct subclass depending on
++C<short_name> value.
++
+ =head2 year
  
+ =head2 holder
diff --git a/debian/patches/gpl-1-plus-class b/debian/patches/gpl-1-plus-class
index 22ebec6..d95a8f0 100644
--- a/debian/patches/gpl-1-plus-class
+++ b/debian/patches/gpl-1-plus-class
@@ -1,7 +1,7 @@
 Description: new class to represent GPL-1+ clauses
 --- /dev/null
 +++ b/lib/Software/License/GPL_1_plus.pm
-@@ -0,0 +1,18 @@
+@@ -0,0 +1,42 @@
 +use strict;
 +use warnings;
 +package Software::License::GPL_1_plus;
@@ -11,6 +11,30 @@ Description: new class to represent GPL-1+ clauses
 +sub name { 'The GNU General Public License, Version 1 or later, February 1989' }
 +
 +1;
++
++=pod
++
++=head1 NAME
++
++Software::License::GPL_1_plus - GNU General Public License, Version 1 or later
++
++=head1 VERSION
++
++version 0.103002
++
++=head1 AUTHOR
++
++Dominique Dumont <ddumont at cpan.org>
++
++=head1 COPYRIGHT AND LICENSE
++
++This software is copyright (c) 2011 by Dominique Dumont
++
++This is free software; you can redistribute it and/or modify it under
++the same terms as the Perl 5 programming language system itself.
++
++=cut
++
 +__DATA__
 +__DEBIAN-SUMMARY__
 +This program is free software; you can redistribute it and/or modify
diff --git a/debian/patches/gpl-2-plus-class b/debian/patches/gpl-2-plus-class
index a7fa73b..3aa6f2f 100644
--- a/debian/patches/gpl-2-plus-class
+++ b/debian/patches/gpl-2-plus-class
@@ -1,7 +1,7 @@
 Description: new class 
 --- /dev/null
 +++ b/lib/Software/License/GPL_2_plus.pm
-@@ -0,0 +1,18 @@
+@@ -0,0 +1,43 @@
 +use strict;
 +use warnings;
 +package Software::License::GPL_2_plus;
@@ -10,7 +10,32 @@ Description: new class
 +
 +sub name { 'The GNU General Public License, Version 2 or later' }
 +
-+2;
++1;
++
++=pod
++
++=head1 NAME
++
++Software::License::GPL_2_plus - GNU General Public License, Version 2 or later
++
++=head1 VERSION
++
++version 0.103002
++
++=head1 AUTHOR
++
++Dominique Dumont <ddumont at cpan.org>
++
++=head1 COPYRIGHT AND LICENSE
++
++This software is copyright (c) 2011 by Dominique Dumont
++
++This is free software; you can redistribute it and/or modify it under
++the same terms as the Perl 5 programming language system itself.
++
++=cut
++
++
 +__DATA__
 +__DEBIAN-SUMMARY__
 +This program is free software; you can redistribute it and/or modify
diff --git a/debian/patches/gpl-3-plus-class b/debian/patches/gpl-3-plus-class
index 0aab193..e3e0748 100644
--- a/debian/patches/gpl-3-plus-class
+++ b/debian/patches/gpl-3-plus-class
@@ -1,7 +1,7 @@
 Description: new class for gpl3 plus summary
 --- /dev/null
 +++ b/lib/Software/License/GPL_3_plus.pm
-@@ -0,0 +1,18 @@
+@@ -0,0 +1,42 @@
 +use strict;
 +use warnings;
 +package Software::License::GPL_3_plus;
@@ -11,6 +11,30 @@ Description: new class for gpl3 plus summary
 +sub name { 'The GNU General Public License, Version 3 or later' }
 +
 +1;
++
++=pod
++
++=head1 NAME
++
++Software::License::GPL_3_plus - GNU General Public License, Version 3 or later
++
++=head1 VERSION
++
++version 0.103002
++
++=head1 AUTHOR
++
++Dominique Dumont <ddumont at cpan.org>
++
++=head1 COPYRIGHT AND LICENSE
++
++This software is copyright (c) 2011 by Dominique Dumont
++
++This is free software; you can redistribute it and/or modify it under
++the same terms as the Perl 5 programming language system itself.
++
++=cut
++
 +__DATA__
 +__DEBIAN-SUMMARY__
 +This program is free software; you can redistribute it and/or modify
diff --git a/debian/patches/summary_method b/debian/patches/summary_method
index 6584bee..7d78834 100644
--- a/debian/patches/summary_method
+++ b/debian/patches/summary_method
@@ -5,7 +5,7 @@ Description: new method
  
  sub notice { shift->_fill_in('NOTICE') }
  
-+sub summary { 
++sub summary {
 +    my ($self,$distro) = @_;
 +    $distro ||= 'debian' ;
 +    $self->_fill_in(uc($distro).'-SUMMARY');
@@ -13,3 +13,17 @@ Description: new method
  
  sub license { shift->_fill_in('LICENSE') }
  
+@@ -165,6 +170,13 @@
+ C<meta_name> returns open_source, restricted, unrestricted, or unknown, that
+ value will be used.
+ 
++=head2 summary
++
++This method returns a summary of the license. This summary must contains
++refer to a file containing the whole license. On Debian system, the file
++containing the whole license will be in C</usr/share/common-licenses/>
++directory.
++
+ =head1 LOOKING UP LICENSE CLASSES
+ 
+ If you have an entry in a F<META.yml> or F<META.json> file, or similar

-- 
Debian packaging of libsoftware-license-perl



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