summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAudrey Tang <cpan@audreyt.org>2003-10-15 02:32:28 +0800
committerAbhijit Menon-Sen <ams@wiw.org>2003-10-15 06:32:44 +0000
commitbb68fe9ecde0d594dda8ebcc5d2b0ca22c837feb (patch)
treec81654c071634c81d009d572dfa60d7dde1889db
parent15355bd644d0a0cbc5931824e5f7faa2cd9a3a98 (diff)
downloadperl-bb68fe9ecde0d594dda8ebcc5d2b0ca22c837feb.tar.gz
SIGN => 1 support for MakeMaker
Message-Id: <1066127547.65845.35.camel@localhost> p4raw-id: //depot/perl@21449
-rw-r--r--lib/ExtUtils/MM_Any.pm55
-rw-r--r--lib/ExtUtils/MM_Unix.pm2
-rw-r--r--lib/ExtUtils/MakeMaker.pm13
3 files changed, 68 insertions, 2 deletions
diff --git a/lib/ExtUtils/MM_Any.pm b/lib/ExtUtils/MM_Any.pm
index 5d8d640b68..9c73e04d20 100644
--- a/lib/ExtUtils/MM_Any.pm
+++ b/lib/ExtUtils/MM_Any.pm
@@ -607,6 +607,32 @@ MAKE_FRAG
}
+=item signature_target
+
+ my $target = $mm->signature_target;
+
+Generate the signature target.
+
+Writes the file SIGNATURE with "cpansign -s".
+
+=cut
+
+sub signature_target {
+ my $self = shift;
+
+ return <<'MAKE_FRAG' if !$self->{SIGN};
+signature:
+ $(NOECHO) $(NOOP)
+MAKE_FRAG
+
+ return <<'MAKE_FRAG';
+signature:
+ cpansign -s
+MAKE_FRAG
+
+}
+
+
=item metafile_addtomanifest_target
my $target = $mm->metafile_addtomanifest_target
@@ -636,6 +662,35 @@ MAKE_FRAG
}
+=item signature_addtomanifest_target
+
+ my $target = $mm->signature_addtomanifest_target
+
+Adds the META.yml file to the MANIFEST.
+
+=cut
+
+sub signature_addtomanifest_target {
+ my $self = shift;
+
+ return <<'MAKE_FRAG' if !$self->{SIGN};
+signature_addtomanifest:
+ $(NOECHO) $(NOOP)
+MAKE_FRAG
+
+ my $add_sign = $self->oneliner(<<'CODE', ['-MExtUtils::Manifest=maniadd']);
+eval { maniadd({q{SIGNATURE} => q{Public-key signature (added by MakeMaker)}}) }
+ or print "Could not add SIGNATURE to MANIFEST: $${'@'}\n"
+CODE
+
+ return sprintf <<'MAKE_FRAG', $add_sign;
+signature_addtomanifest:
+ $(NOECHO) %s
+MAKE_FRAG
+
+}
+
+
=back
=head2 Abstract methods
diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm
index 3821a3571d..43c5098516 100644
--- a/lib/ExtUtils/MM_Unix.pm
+++ b/lib/ExtUtils/MM_Unix.pm
@@ -953,7 +953,7 @@ sub distdir {
my($self) = shift;
return <<'MAKE_FRAG';
-distdir : metafile metafile_addtomanifest
+distdir : metafile metafile_addtomanifest signature signature_addtomanifest
$(RM_RF) $(DISTVNAME)
$(PERLRUN) "-MExtUtils::Manifest=manicopy,maniread" \
-e "manicopy(maniread(),'$(DISTVNAME)', '$(DIST_CP)');"
diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm
index 9b7d6ebfad..22ee8af866 100644
--- a/lib/ExtUtils/MakeMaker.pm
+++ b/lib/ExtUtils/MakeMaker.pm
@@ -226,7 +226,7 @@ sub full_setup {
PERL_SRC PERM_RW PERM_RWX
PL_FILES PM PM_FILTER PMLIBDIRS POLLUTE PPM_INSTALL_EXEC
PPM_INSTALL_SCRIPT PREREQ_FATAL PREREQ_PM PREREQ_PRINT PRINT_PREREQ
- SKIP TYPEMAPS VERSION VERSION_FROM XS XSOPT XSPROTOARG
+ SIGN SKIP TYPEMAPS VERSION VERSION_FROM XS XSOPT XSPROTOARG
XS_VERSION clean depend dist dynamic_lib linkext macro realclean
tool_autosplit
@@ -265,6 +265,7 @@ sub full_setup {
installbin subdirs
clean_subdirs clean realclean_subdirs realclean
metafile metafile_addtomanifest
+ signature signature_addtomanifest
dist_basics dist_core distdir dist_test dist_ci
install force perldepend makefile staticmake test ppd
@@ -1991,6 +1992,16 @@ $Config{installprefix} will be used.
Overridable by PREFIX
+=item SIGN
+
+When true, perform the generation and addition to the MANIFEST of
+the SIGNATURE file during 'make distdir', via 'cpansign -s'.
+
+Note that you need to install the Module::Signature module to
+perform this operation.
+
+Defaults to false.
+
=item SKIP
Arrayref. E.g. [qw(name1 name2)] skip (do not write) sections of the