Commit 06fa2997 authored by Nicholas Bamber's avatar Nicholas Bamber

[svn-upgrade] new version libsoftware-license-perl (0.103001)

parent 5ee6cea1
Revision history for Software-License
0.103001 2011-04-28 07:20:39 America/New_York
re-import text of GPL 1 and 2 to get new FSF address (RT #67795)
0.103000 2011-03-31 22:31:03 America/New_York
improve method dependency chains (thanks, Flavio Poletti)
......
......@@ -4,7 +4,7 @@
"Ricardo Signes <rjbs@cpan.org>"
],
"dynamic_config" : 0,
"generated_by" : "Dist::Zilla version 4.200005, CPAN::Meta::Converter version 2.110580",
"generated_by" : "Dist::Zilla version 4.200005, CPAN::Meta::Converter version 2.110930",
"license" : [
"perl_5"
],
......@@ -23,7 +23,6 @@
"requires" : {
"Carp" : 0,
"Data::Section" : 0,
"English" : 0,
"Sub::Install" : 0,
"Text::Template" : 0,
"perl" : "5.006"
......@@ -42,7 +41,7 @@
"url" : "git://git.codesimply.com/Software-License.git"
}
},
"version" : "0.103000",
"version" : "0.103001",
"x_Dist_Zilla" : {
"plugins" : [
{
......@@ -158,7 +157,7 @@
{
"class" : "Dist::Zilla::Plugin::Repository",
"name" : "@RJBS/Repository",
"version" : "0.17"
"version" : "0.18"
},
{
"class" : "Dist::Zilla::Plugin::Prereqs",
......
......@@ -7,7 +7,7 @@ build_requires:
configure_requires:
ExtUtils::MakeMaker: 6.31
dynamic_config: 0
generated_by: 'Dist::Zilla version 4.200005, CPAN::Meta::Converter version 2.110580'
generated_by: 'Dist::Zilla version 4.200005, CPAN::Meta::Converter version 2.110930'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
......@@ -16,13 +16,12 @@ name: Software-License
requires:
Carp: 0
Data::Section: 0
English: 0
Sub::Install: 0
Text::Template: 0
perl: 5.006
resources:
repository: git://git.codesimply.com/Software-License.git
version: 0.103000
version: 0.103001
x_Dist_Zilla:
plugins:
-
......@@ -116,7 +115,7 @@ x_Dist_Zilla:
-
class: Dist::Zilla::Plugin::Repository
name: '@RJBS/Repository'
version: 0.17
version: 0.18
-
class: Dist::Zilla::Plugin::Prereqs
config:
......
......@@ -24,11 +24,10 @@ my %WriteMakefileArgs = (
'PREREQ_PM' => {
'Carp' => '0',
'Data::Section' => '0',
'English' => '0',
'Sub::Install' => '0',
'Text::Template' => '0'
},
'VERSION' => '0.103000',
'VERSION' => '0.103001',
'test' => {
'TESTS' => 't/*.t'
}
......
This archive contains the distribution Software-License,
version 0.103000:
version 0.103001:
packages that provide templated software licenses
......
......@@ -3,7 +3,7 @@ use warnings;
use 5.006; # warnings
package Software::License;
BEGIN {
$Software::License::VERSION = '0.103000';
$Software::License::VERSION = '0.103001';
}
# ABSTRACT: packages that provide templated software licenses
......@@ -90,7 +90,7 @@ Software::License - packages that provide templated software licenses
=head1 VERSION
version 0.103000
version 0.103001
=head1 SYNOPSIS
......
......@@ -2,7 +2,7 @@ use strict;
use warnings;
package Software::License::AGPL_3;
BEGIN {
$Software::License::AGPL_3::VERSION = '0.103000';
$Software::License::AGPL_3::VERSION = '0.103001';
}
use base 'Software::License';
# ABSTRACT: GNU Affero General Public License, Version 3
......@@ -24,7 +24,7 @@ Software::License::AGPL_3 - GNU Affero General Public License, Version 3
=head1 VERSION
version 0.103000
version 0.103001
=head1 AUTHOR
......
......@@ -2,7 +2,7 @@ use strict;
use warnings;
package Software::License::Apache_1_1;
BEGIN {
$Software::License::Apache_1_1::VERSION = '0.103000';
$Software::License::Apache_1_1::VERSION = '0.103001';
}
use base 'Software::License';
# ABSTRACT: The Apache Software License, Version 1.1
......@@ -23,7 +23,7 @@ Software::License::Apache_1_1 - The Apache Software License, Version 1.1
=head1 VERSION
version 0.103000
version 0.103001
=head1 AUTHOR
......
......@@ -2,7 +2,7 @@ use strict;
use warnings;
package Software::License::Apache_2_0;
BEGIN {
$Software::License::Apache_2_0::VERSION = '0.103000';
$Software::License::Apache_2_0::VERSION = '0.103001';
}
use base 'Software::License';
# ABSTRACT: The Apache License, Version 2.0
......@@ -23,7 +23,7 @@ Software::License::Apache_2_0 - The Apache License, Version 2.0
=head1 VERSION
version 0.103000
version 0.103001
=head1 AUTHOR
......
......@@ -2,7 +2,7 @@ use strict;
use warnings;
package Software::License::Artistic_1_0;
BEGIN {
$Software::License::Artistic_1_0::VERSION = '0.103000';
$Software::License::Artistic_1_0::VERSION = '0.103001';
}
use base 'Software::License';
# ABSTRACT: The Artistic License
......@@ -39,7 +39,7 @@ Software::License::Artistic_1_0 - The Artistic License
=head1 VERSION
version 0.103000
version 0.103001
=head1 OPTIONS
......
......@@ -2,7 +2,7 @@ use strict;
use warnings;
package Software::License::Artistic_2_0;
BEGIN {
$Software::License::Artistic_2_0::VERSION = '0.103000';
$Software::License::Artistic_2_0::VERSION = '0.103001';
}
use base 'Software::License';
# ABSTRACT: The Artistic License 2.0
......@@ -23,7 +23,7 @@ Software::License::Artistic_2_0 - The Artistic License 2.0
=head1 VERSION
version 0.103000
version 0.103001
=head1 AUTHOR
......
......@@ -2,7 +2,7 @@ use strict;
use warnings;
package Software::License::BSD;
BEGIN {
$Software::License::BSD::VERSION = '0.103000';
$Software::License::BSD::VERSION = '0.103001';
}
use base 'Software::License';
# ABSTRACT: The (three-clause) BSD License
......@@ -23,7 +23,7 @@ Software::License::BSD - The (three-clause) BSD License
=head1 VERSION
version 0.103000
version 0.103001
=head1 AUTHOR
......
......@@ -2,7 +2,7 @@ use strict;
use warnings;
package Software::License::CC0_1_0;
BEGIN {
$Software::License::CC0_1_0::VERSION = '0.103000';
$Software::License::CC0_1_0::VERSION = '0.103001';
}
use base 'Software::License';
# ABSTRACT: the "public domain"-like CC0 license, version 1.0
......@@ -25,7 +25,7 @@ Software::License::CC0_1_0 - the "public domain"-like CC0 license, version 1.0
=head1 VERSION
version 0.103000
version 0.103001
=head1 WARNING
......
use strict;
use warnings;
package Software::License::Custom;
BEGIN {
$Software::License::Custom::VERSION = '0.103000';
$Software::License::Custom::VERSION = '0.103001';
}
use strict;
use warnings;
use Carp;
use English qw( -no_match_vars );
# ABSTRACT: custom license handler
use base 'Software::License';
# ABSTRACT: custom license handler
use Carp;
use Text::Template;
sub new {
my ($class, $arg) = @_;
......@@ -21,7 +22,8 @@ sub new {
$self->load_sections_from($filename) if defined $filename;
return $self;
} ## end sub new
}
sub load_sections_from {
my ($self, $filename) = @_;
......@@ -30,8 +32,8 @@ sub load_sections_from {
$self->{'Software::License::Custom'}{section_for} = \my %section_for;
my $current_section = '';
open my $fh, '<', $filename
or croak "open('$filename'): $OS_ERROR";
open my $fh, '<', $filename or croak "open('$filename'): $!";
while (<$fh>) {
if (my ($section) = m{\A __ (.*) __ \n\z}mxs) {
($current_section = $section) =~ s/\W+//gmxs;
......@@ -48,27 +50,48 @@ sub load_sections_from {
return $self;
}
sub section_data {
my ($self, $name) = @_;
my $section = $self->{'Software::License::Custom'}{section_for}{$name};
return defined($section) ? \$section : undef;
my $section_for = $self->{'Software::License::Custom'}{section_for} ||= {};
return unless exists $section_for->{$name};
return unless defined $section_for->{$name};
return \$section_for->{$name};
}
sub name { shift->_fill_in('NAME') }
sub url { shift->_fill_in('URL') }
sub meta2_name { shift->_fill_in('META2_NAME') }
# This is (also) a class method in the other modules, so we stick to this
# convention and the tests will be happy.
sub meta_name {
my $self = shift;
return 'custom' unless ref $self;
return $self->_fill_in('META_NAME')
}
1;
sub meta2_name {
my $self = shift;
return 'custom' unless ref $self;
$self->_fill_in('META2_NAME')
}
sub license { shift->_fill_in('LICENSE') }
sub notice { shift->_fill_in('NOTICE') }
sub fulltext {
my ($self) = @_;
return join "\n", $self->notice, $self->license;
}
sub version {
my ($self) = @_;
return unless $self->section_data('VERSION');
return $self->_fill_in('VERSION')
}
1;
__END__
=pod
=head1 NAME
......@@ -77,15 +100,136 @@ Software::License::Custom - custom license handler
=head1 VERSION
version 0.103000
version 0.103001
=head1 DESCRIPTION
This module gives the possibility of
specifying all aspects related to a software license in a custom file.
This allows for setting custom dates, notices, etc. while still preserving
compatibility with all places where L<Software::License> is used, e.g.
L<Dist::Zilla>.
This module extends L<Software::License> to give the possibility of specifying
all aspects related to a software license in a custom file. This allows for
setting custom dates, notices, etc. while still preserving compatibility with
all places where L<Software::License> is used, e.g. L<Dist::Zilla>.
In this way, you should be able to customise some aspects of the licensing
messages that would otherwise be difficult to tinker, e.g. adding a note
in the notice, setting multiple years for the copyright notice or set multiple
authors and/or copyright holders.
The license details should be put inside a file that contains different
sections. Each section has the following format:
=over 4
=item header line
This is a line that begins and ends with two underscores C<__>. The string
between the begin and the end of the line is first depured of any non-word
character, then used as the name of the section;
=item body
a L<Text::Template> (possibly a plain text file) where items to be
expanded are enclosed between double braces
=back
Each section is terminated by the header of the following section or by
the end of the file. Example:
__[ NAME ]__
The Foo-Bar License
__URL__
http://www.example.com/foo-bar.txt
__[ META_NAME ]__
foo_bar_meta
__{ META2_NAME }__
foo_bar_meta2
__[ NOTICE ]__
Copyright (C) 2000-2002 by P.R. Evious
Copyright (C) {{$self->year}} by {{$self->holder}}.
This is free software, licensed under {{$self->name}}.
__[ LICENSE ]__
The Foo-Bar License
Well... this is only some sample text. Verily... only sample text!!!
Yes, spanning more lines and more paragraphs.
The different formats for specifying the section name in the example
above are only examples, you're invited to use a consistent approach.
=head1 METHODS
=head2 new
my $slc = Software::License::Custom->new({filename => 'LEGAL'});
Create a new object. Arguments are passed through an anonymous hash, the
following keys are allowed:
filename - the file where the custom software license details are stored
=head2 load_sections_from
$slc->load_sections_from('MY-LEGAL-ASPECTS');
Loads the different sections of the license from the provided filename.
Returns the input object.
=head2 section_data
my $notice_template_reference = $slc->section_data('NOTICE');
Returns a reference to a textual template that can be fed to
L<Text::Template> (it could be simple text), according to what is
currently loaded in the object.
=head1 MORE METHODS
The following methods, found in all software license classes, look up and
render the template with the capitalized form of their name. In other words,
the C<license> method looks in the C<LICENSE> template.
For now, the C<meta_name> and C<meta2_name> methods return C<custom> if called
on the class. This may become fatal in the future.
=over 4
=item *
name
=item *
url
=item *
meta_name
=item *
meta2_name
=item *
license
=item *
notice
=item *
fulltext
=item *
version
=back
=head1 AUTHOR
......@@ -100,6 +244,3 @@ the same terms as the Perl 5 programming language system itself.
=cut
__END__
......@@ -2,7 +2,7 @@ use strict;
use warnings;
package Software::License::FreeBSD;
BEGIN {
$Software::License::FreeBSD::VERSION = '0.103000';
$Software::License::FreeBSD::VERSION = '0.103001';
}
use base 'Software::License';
# ABSTRACT: The FreeBSD License (aka two-clause BSD)
......@@ -24,7 +24,7 @@ Software::License::FreeBSD - The FreeBSD License (aka two-clause BSD)
=head1 VERSION
version 0.103000
version 0.103001
=head1 AUTHOR
......
......@@ -2,7 +2,7 @@ use strict;
use warnings;
package Software::License::GFDL_1_2;
BEGIN {
$Software::License::GFDL_1_2::VERSION = '0.103000';
$Software::License::GFDL_1_2::VERSION = '0.103001';
}
use base 'Software::License';
# ABSTRACT: The GNU Free Documentation License
......@@ -23,7 +23,7 @@ Software::License::GFDL_1_2 - The GNU Free Documentation License
=head1 VERSION
version 0.103000
version 0.103001
=head1 AUTHOR
......
......@@ -2,7 +2,7 @@ use strict;
use warnings;
package Software::License::GPL_1;
BEGIN {
$Software::License::GPL_1::VERSION = '0.103000';
$Software::License::GPL_1::VERSION = '0.103001';
}
use base 'Software::License';
# ABSTRACT: GNU General Public License, Version 1
......@@ -23,7 +23,7 @@ Software::License::GPL_1 - GNU General Public License, Version 1
=head1 VERSION
version 0.103000
version 0.103001
=head1 AUTHOR
......@@ -41,15 +41,16 @@ the same terms as the Perl 5 programming language system itself.
__DATA__
__LICENSE__
GNU GENERAL PUBLIC LICENSE
Version 1, February 1989
GNU GENERAL PUBLIC LICENSE
Version 1, February 1989
Copyright (C) 1989 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
Preamble
The license agreements of most software companies try to keep users
at the mercy of those companies. By contrast, our General Public
......@@ -90,7 +91,7 @@ authors' reputations.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any program or other work which
......@@ -208,7 +209,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
NO WARRANTY
9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
......@@ -230,9 +231,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to humanity, the best way to achieve this is to make it
......@@ -258,8 +259,9 @@ the exclusion of warranty; and each file should have at least the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
......
This diff is collapsed.
......@@ -2,7 +2,7 @@ use strict;
use warnings;
package Software::License::GPL_3;
BEGIN {
$Software::License::GPL_3::VERSION = '0.103000';
$Software::License::GPL_3::VERSION = '0.103001';
}
use base 'Software::License';
# ABSTRACT: GNU General Public License, Version 3
......@@ -23,7 +23,7 @@ Software::License::GPL_3 - GNU General Public License, Version 3
=head1 VERSION
version 0.103000
version 0.103001
=head1 AUTHOR
......
......@@ -2,7 +2,7 @@ use strict;
use warnings;
package Software::License::LGPL_2_1;
BEGIN {
$Software::License::LGPL_2_1::VERSION = '0.103000';
$Software::License::LGPL_2_1::VERSION = '0.103001';
}
use base 'Software::License';
# ABSTRACT: GNU Lesser General Public License, Version 2.1
......@@ -23,7 +23,7 @@ Software::License::LGPL_2_1 - GNU Lesser General Public License, Version 2.1
=head1 VERSION
version 0.103000
version 0.103001
=head1 AUTHOR
......
......@@ -2,7 +2,7 @@ use strict;
use warnings;
package Software::License::LGPL_3_0;
BEGIN {
$Software::License::LGPL_3_0::VERSION = '0.103000';
$Software::License::LGPL_3_0::VERSION = '0.103001';
}
use base 'Software::License';
# ABSTRACT: GNU Lesser General Public License, Version 3
......@@ -38,7 +38,7 @@ Software::License::LGPL_3_0 - GNU Lesser General Public License, Version 3
=head1 VERSION
version 0.103000
version 0.103001
=head1 AUTHOR
......
......@@ -2,7 +2,7 @@ use strict;
use warnings;
package Software::License::MIT;
BEGIN {
$Software::License::MIT::VERSION = '0.103000';
$Software::License::MIT::VERSION = '0.103001';
}
use base 'Software::License';
# ABSTRACT: The MIT (aka X11) License
......@@ -23,7 +23,7 @@ Software::License::MIT - The MIT (aka X11) License
=head1 VERSION
version 0.103000
version 0.103001
=head1 AUTHOR
......
......@@ -2,7 +2,7 @@ use strict;
use warnings;
package Software::License::Mozilla_1_0;
BEGIN {
$Software::License::Mozilla_1_0::VERSION = '0.103000';
$Software::License::Mozilla_1_0::VERSION = '0.103001';
}
use base 'Software::License';
# ABSTRACT: Mozilla Public License 1.0
......@@ -23,7 +23,7 @@ Software::License::Mozilla_1_0 - Mozilla Public License 1.0
=head1 VERSION
version 0.103000
version 0.103001
=head1 AUTHOR
......
......@@ -2,7 +2,7 @@ use strict;
use warnings;
package Software::License::Mozilla_1_1;
BEGIN {
$Software::License::Mozilla_1_1::VERSION = '0.103000';
$Software::License::Mozilla_1_1::VERSION = '0.103001';
}
use base 'Software::License';
# ABSTRACT: The Mozilla Public License 1.1
......@@ -23,7 +23,7 @@ Software::License::Mozilla_1_1 - The Mozilla Public License 1.1
=head1 VERSION
version 0.103000
version 0.103001
=head1 AUTHOR
......
......@@ -2,7 +2,7 @@ use strict;
use warnings;
package Software::License::None;
BEGIN {
$Software::License::None::VERSION = '0.103000';
$Software::License::None::VERSION = '0.103001';
}
use base 'Software::License';
# ABSTRACT: describes a "license" that gives no license for re-use
......@@ -24,7 +24,7 @@ Software::License::None - describes a "license" that gives no license for re-use
=head1 VERSION
version 0.103000
version 0.103001
=head1 AUTHOR
......
......@@ -2,7 +2,7 @@ use strict;
use warnings;
package Software::License::OpenSSL;
BEGIN {
$Software::License::OpenSSL::VERSION = '0.103000';
$Software::License::OpenSSL::VERSION = '0.103001';
}
use base 'Software::License';
# ABSTRACT: The OpenSSL License
......@@ -33,7 +33,7 @@ Software::License::OpenSSL - The OpenSSL License
=head1 VERSION
version 0.103000
version 0.103001
=head1 AUTHOR
......
......@@ -2,7 +2,7 @@ use strict;
use warnings;