Skip to content

Commit

Permalink
Link to msgpack as a git submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuji Goro committed Aug 19, 2011
1 parent 827d2aa commit edd38a9
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -7,7 +7,7 @@ MessagePack.o
MessagePack.c
blib/
inc/
msgpack/
include/
t/std/
*.o
pm_to_blib
Expand All @@ -17,4 +17,5 @@ ppport.h
xshelper.h
*.swp
*~
*.bak

3 changes: 3 additions & 0 deletions .gitmodules
@@ -0,0 +1,3 @@
[submodule "msgpack"]
path = msgpack
url = git://github.com/msgpack/msgpack.git
4 changes: 3 additions & 1 deletion MANIFEST.SKIP
Expand Up @@ -7,7 +7,7 @@
^#
\.old$
\.swp$
~$
\.bak$
^blib/
^pm_to_blib
^MakeMaker-\d
Expand All @@ -28,3 +28,5 @@
^Data-MessagePack-[0-9.]+/
^\.testenv/test_pp.pl
^ppport.h$
^msgpack

27 changes: 19 additions & 8 deletions Makefile.PL
Expand Up @@ -21,6 +21,7 @@ if ( $] >= 5.008005 and want_xs() ) {
requires_c99();
use_xshelper();
cc_warnings;
cc_include_paths('include');
cc_src_paths('xs-src');

if($Module::Install::AUTHOR) {
Expand Down Expand Up @@ -50,17 +51,27 @@ clean_files qw{
cover_db
};

# copy modules
if ($Module::Install::AUTHOR && -d File::Spec->catfile('..', 'msgpack')) {
mkdir 'msgpack' unless -d 'msgpack';
if ($Module::Install::AUTHOR) {
print "AuthorMode: copy modules\n";
if(not -d 'msgpack') {
system 'git', 'submodule', 'init';
system 'git', 'submodule', 'update';
}

require File::Path;
require File::Copy;
for my $src (<../msgpack/*.h>) {
File::Copy::copy($src, 'msgpack/') or die "copy failed: $!";

File::Path::rmtree(qw(include t/std));
File::Path::mkpath(qw(include/msgpack t/std));

for my $src (<msgpack/msgpack/*.h>) {
print "AuthorMode: copy $src to include/msgpack\n";
File::Copy::copy($src, 'include/msgpack') or die "copy failed: $!";
}

mkdir 't/std';
for my $data(<../test/*.{json,mpac}>) {
File::Copy::copy($data, 't/std') or die "copy failed: $!";
for my $src(<msgpack/test/*.{json,mpac}>) {
print "AuthorMode: copy $src to t/std/\n";
File::Copy::copy($src, 't/std') or die "copy failed: $!";
}
}

Expand Down
1 change: 1 addition & 0 deletions msgpack
Submodule msgpack added at 6f043e

0 comments on commit edd38a9

Please sign in to comment.