You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2014/07/11 21:04:02 UTC

[4/8] git commit: Add a `dist` action for the runtime's Perl build.

Add a `dist` action for the runtime's Perl build.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/834ab5d7
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/834ab5d7
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/834ab5d7

Branch: refs/heads/master
Commit: 834ab5d73f4180b3ab54d589e038695a7db073fb
Parents: a2167fb
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Mon Jul 7 17:38:59 2014 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Wed Jul 9 22:15:15 2014 -0700

----------------------------------------------------------------------
 runtime/perl/buildlib/Clownfish/Build.pm | 30 +++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/834ab5d7/runtime/perl/buildlib/Clownfish/Build.pm
----------------------------------------------------------------------
diff --git a/runtime/perl/buildlib/Clownfish/Build.pm b/runtime/perl/buildlib/Clownfish/Build.pm
index 4e7137d..5865fd9 100644
--- a/runtime/perl/buildlib/Clownfish/Build.pm
+++ b/runtime/perl/buildlib/Clownfish/Build.pm
@@ -309,5 +309,35 @@ sub ACTION_clean {
     $self->SUPER::ACTION_clean;
 }
 
+sub ACTION_dist {
+    my $self = shift;
+
+    # We build our Perl release tarball from a subdirectory rather than from
+    # the top-level $REPOS_ROOT.  Because some assets we need are outside this
+    # directory, we need to copy them in.
+    my %to_copy = (
+        '../../CONTRIBUTING' => 'CONTRIBUTING',
+        '../../LICENSE'      => 'LICENSE',
+        '../../NOTICE'       => 'NOTICE',
+        '../../README'       => 'README',
+        $CORE_SOURCE_DIR     => 'core',
+        $CHARMONIZER_C       => 'charmonizer.c',
+    );
+    print "Copying files...\n";
+    while ( my ( $from, $to ) = each %to_copy ) {
+        confess("'$to' already exists") if -e $to;
+        system("cp -R $from $to") and confess("cp failed");
+    }
+    move( "MANIFEST", "MANIFEST.bak" ) or die "move() failed: $!";
+    $self->depends_on("manifest");
+    $self->SUPER::ACTION_dist;
+
+    # Now that the tarball is packaged up, delete the copied assets.
+    rmtree($_) for values %to_copy;
+    unlink("META.yml");
+    unlink("META.json");
+    move( "MANIFEST.bak", "MANIFEST" ) or die "move() failed: $!";
+}
+
 1;