From: Audrey Tang Date: Tue, 14 Oct 2003 18:32:28 +0000 (+0800) Subject: SIGN => 1 support for MakeMaker X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bb68fe9ecde0d594dda8ebcc5d2b0ca22c837feb;p=p5sagit%2Fp5-mst-13.2.git SIGN => 1 support for MakeMaker Message-Id: <1066127547.65845.35.camel@localhost> p4raw-id: //depot/perl@21449 --- diff --git a/lib/ExtUtils/MM_Any.pm b/lib/ExtUtils/MM_Any.pm index 5d8d640..9c73e04 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 3821a35..43c5098 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 9b7d6eb..22ee8af 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