@@ -95,16 +95,21 @@ sub create_distro {
95
95
96
96
if ( ( not $self -> {author } ) && ( $^O ne ' MSWin32' ) ) {
97
97
( $self -> {author } ) = split /,/, ( getpwuid $> )[6];
98
+ $self -> {author } = [
99
+ exists $ENV {EMAIL }
100
+ ? " $self ->{author} <$ENV {EMAIL}>"
101
+ : $self -> {author }
102
+ ];
98
103
}
99
104
100
- if ( not $self -> {email } and exists $ENV {EMAIL } ) {
101
- $self -> {email } = $ENV {EMAIL };
102
- }
103
-
104
- croak " Must specify an author\n " unless $self -> {author };
105
- croak " Must specify an email address\n " unless $self -> {email };
106
- ($self -> {email_obfuscated } = $self -> {email }) =~ s / @/ at / ;
105
+ croak " Must specify one or more authors\n "
106
+ unless $self -> {author }
107
+ && ref ($self -> {author }) eq ' ARRAY'
108
+ && @{$self -> {author }} > 0;
107
109
110
+ croak " author strings must be in the format: 'Author Name <author-email\@ domain.tld>'"
111
+ if grep { $_ !~ m / ^.*?\s *\< .*?\>\s *$ / } @{$self -> {author }};
112
+
108
113
$self -> {license } ||= ' artistic2' ;
109
114
$self -> {minperl } ||= 5.006;
110
115
$self -> {ignores_type } ||= [' generic' ];
@@ -610,7 +615,7 @@ sub _license_blurb {
610
615
This program is released under the following license: $self ->{license}
611
616
EOT
612
617
613
- $license_blurb =~ s / ___AUTHOR___/ $self ->{author}/ ge ;
618
+ $license_blurb =~ s / ___AUTHOR___/ join(',', @{ $self ->{author}}) / ge ;
614
619
chomp $license_blurb ;
615
620
return $license_blurb ;
616
621
}
@@ -749,8 +754,10 @@ sub Makefile_PL_guts {
749
754
my $main_module = shift ;
750
755
my $main_pm_file = shift ;
751
756
752
- (my $author = " $self ->{author} <$self ->{email}>" ) =~ s / '/ \' / g ;
753
-
757
+ my $author = ' [' .
758
+ join (' ,' , map { s / '/ \' / g ; " '$_ '" ; } @{ $self -> {author } })
759
+ . ' ]' ;
760
+
754
761
my $slname = $self -> {license_record } ? $self -> {license_record }-> {slname } : $self -> {license };
755
762
756
763
my $warnings = sprintf ' warnings%s;' , ($self -> {fatalize } ? " FATAL => 'all" : ' ' );
@@ -763,7 +770,7 @@ use ExtUtils::MakeMaker;
763
770
764
771
WriteMakefile(
765
772
NAME => '$main_module ',
766
- AUTHOR => q{ $author } ,
773
+ AUTHOR => $author ,
767
774
VERSION_FROM => '$main_pm_file ',
768
775
ABSTRACT_FROM => '$main_pm_file ',
769
776
LICENSE => '$slname ',
@@ -799,9 +806,13 @@ sub MI_Makefile_PL_guts {
799
806
my $main_module = shift ;
800
807
my $main_pm_file = shift ;
801
808
802
- my $author = " $self ->{author} < $self ->{email}> " ;
809
+ my $author = join ' , ' , @{ $self -> {author }} ;
803
810
$author =~ s / '/ \' / g ;
804
-
811
+
812
+ # if there is more than one author, select the first one as
813
+ # the repository owner
814
+ my ($repo_author ) = (split /\s *\</, $self -> {author }-> [0])[0];
815
+
805
816
my $license_url = $self -> {license_record } ? $self -> {license_record }-> {url } : ' ' ;
806
817
807
818
my $warnings = sprintf ' warnings%s;' , ($self -> {fatalize } ? " FATAL => 'all" : ' ' );
@@ -825,8 +836,8 @@ resources (
825
836
#homepage => 'http://yourwebsitehere.com',
826
837
#IRC => 'irc://irc.perl.org/#$self ->{distro}',
827
838
license => '$license_url ',
828
- #repository => 'git://github.com/$self ->{author} /$self ->{distro}.git',
829
- #repository => 'https://bitbucket.org/$self ->{author} /$self ->{distro}',
839
+ #repository => 'git://github.com/$repo_author /$self ->{distro}.git',
840
+ #repository => 'https://bitbucket.org/$repo_author /$self ->{distro}',
830
841
bugtracker => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=$self ->{distro}',
831
842
);
832
843
@@ -891,8 +902,9 @@ sub Build_PL_guts {
891
902
my $main_module = shift ;
892
903
my $main_pm_file = shift ;
893
904
894
- (my $author = " $self ->{author} <$self ->{email}>" ) =~ s / '/ \' / g ;
895
-
905
+ my $author = ' [' .
906
+ join (' ,' , map { s / '/ \' / g ; " '$_ '" ; } @{$self -> {author }})
907
+ . ' ]' ;
896
908
my $slname = $self -> {license_record } ? $self -> {license_record }-> {slname } : $self -> {license };
897
909
898
910
my $warnings = sprintf ' warnings%s;' , ($self -> {fatalize } ? " FATAL => 'all" : ' ' );
@@ -906,7 +918,7 @@ use Module::Build;
906
918
my \$ builder = Module::Build->new(
907
919
module_name => '$main_module ',
908
920
license => '$slname ',
909
- dist_author => q{ $author } ,
921
+ dist_author => $author ,
910
922
dist_version_from => '$main_pm_file ',
911
923
release_status => 'stable',
912
924
configure_requires => {
@@ -1029,11 +1041,11 @@ sub _README_license {
1029
1041
1030
1042
my $year = $self -> _thisyear();
1031
1043
my $license_blurb = $self -> _license_blurb();
1032
-
1044
+ my $author_string = join ' , ' , @{ $self -> { author }};
1033
1045
return <<"HERE" ;
1034
1046
LICENSE AND COPYRIGHT
1035
1047
1036
- Copyright (C) $year $self ->{author}
1048
+ Copyright (C) $year $author_string
1037
1049
1038
1050
$license_blurb
1039
1051
HERE
@@ -1757,11 +1769,11 @@ sub _module_license {
1757
1769
1758
1770
my $license_blurb = $self -> _license_blurb();
1759
1771
my $year = $self -> _thisyear();
1760
-
1772
+ my $author_string = join ' , ' , @{ $self -> { author }};
1761
1773
my $content = qq[
1762
1774
\= head1 LICENSE AND COPYRIGHT
1763
1775
1764
- Copyright $year $self ->{author} .
1776
+ Copyright $year $author_string .
1765
1777
1766
1778
$license_blurb
1767
1779
] ;
@@ -1775,11 +1787,12 @@ sub module_guts {
1775
1787
my $rtname = shift ;
1776
1788
1777
1789
# Sub-templates
1778
- my $header = $self -> _module_header($module , $rtname );
1779
- my $bugs = $self -> _module_bugs($module , $rtname );
1780
- my $support = $self -> _module_support($module , $rtname );
1781
- my $license = $self -> _module_license($module , $rtname );
1782
-
1790
+ my $header = $self -> _module_header($module , $rtname );
1791
+ my $bugs = $self -> _module_bugs($module , $rtname );
1792
+ my $support = $self -> _module_support($module , $rtname );
1793
+ my $license = $self -> _module_license($module , $rtname );
1794
+ my $author_string = join ' ,' , @{$self -> {author }};
1795
+
1783
1796
my $content = <<"HERE" ;
1784
1797
$header
1785
1798
@@ -1817,7 +1830,7 @@ sub function2 {
1817
1830
1818
1831
\= head1 AUTHOR
1819
1832
1820
- $self ->{author}, C<< < $self ->{email_obfuscated}> >>
1833
+ $author_string
1821
1834
1822
1835
$bugs
1823
1836
0 commit comments