lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [4/8] git commit: Add a `dist` action for the runtime's Perl build.
Date Fri, 11 Jul 2014 19:04:02 GMT
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 <marvin@rectangular.com>
Authored: Mon Jul 7 17:38:59 2014 -0700
Committer: Marvin Humphrey <marvin@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;
 


Mime
View raw message