lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [1/7] git commit: Add a `dist` action for the runtime's Perl build.
Date Tue, 08 Jul 2014 01:18:48 GMT
Repository: lucy-clownfish
Updated Branches:
  refs/heads/prep_cpan_dist_for_0.4.0 [created] 7a69398d8


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/dbe99a7c
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/dbe99a7c
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/dbe99a7c

Branch: refs/heads/prep_cpan_dist_for_0.4.0
Commit: dbe99a7c8380388a45826412009b3bc59dacda54
Parents: 0a6ee30
Author: Marvin Humphrey <marvin@rectangular.com>
Authored: Mon Jul 7 17:38:59 2014 -0700
Committer: Marvin Humphrey <marvin@rectangular.com>
Committed: Mon Jul 7 17:48:42 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/dbe99a7c/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