diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/build_perl_modules | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/tools/build_perl_modules b/tools/build_perl_modules index 4bdb81b..9a880ff 100755 --- a/tools/build_perl_modules +++ b/tools/build_perl_modules | |||
@@ -62,11 +62,19 @@ foreach my $tarball (@tarballs) { | |||
62 | if ($opts->{m}) { | 62 | if ($opts->{m}) { |
63 | # Don't compile if already done - this is because of invocating this | 63 | # Don't compile if already done - this is because of invocating this |
64 | # script at different stages | 64 | # script at different stages |
65 | print "******************** $tarball\n"; | ||
65 | unless (-e $dir) { | 66 | unless (-e $dir) { |
66 | system("gunzip -c $tarball | tar -xf -") == 0 or die "Cannot extract $tarball"; | 67 | system("gunzip -c $tarball | tar -xf -") == 0 or die "Cannot extract $tarball"; |
67 | chdir $dir or die "Can't chdir into $dir"; | 68 | chdir $dir or die "Can't chdir into $dir"; |
68 | system("perl Makefile.PL PREFIX=$destdir INSTALLDIRS=site LIB=$destdir/lib") == 0 or die "Can't run perl Makefile.PL"; | 69 | if (-e "Makefile.PL") { |
69 | system("make") == 0 or die "Can't run make"; | 70 | system("perl Makefile.PL PREFIX=$destdir INSTALLDIRS=site LIB=$destdir/lib") == 0 |
71 | or die "Can't run perl Makefile.PL"; | ||
72 | system("make") == 0 or die "Can't run make"; | ||
73 | } else { | ||
74 | system("perl Build.PL --prefix $destdir --installdirs site --install_path lib=$destdir/lib") == 0 | ||
75 | or die "Can't run perl Build.PL"; | ||
76 | system("./Build") == 0 or die "Can't run ./Build"; | ||
77 | } | ||
70 | chdir $topdir or die "Can't chdir to top";; | 78 | chdir $topdir or die "Can't chdir to top";; |
71 | } | 79 | } |
72 | } | 80 | } |
@@ -79,10 +87,18 @@ foreach my $tarball (@tarballs) { | |||
79 | $ENV{PERL5LIB}=join(":", @dirs); | 87 | $ENV{PERL5LIB}=join(":", @dirs); |
80 | 88 | ||
81 | if ($opts->{t}) { | 89 | if ($opts->{t}) { |
82 | system("make test") == 0 or die "Can't run make test failed"; | 90 | if (-e "Makefile") { |
91 | system("make test") == 0 or die "Can't run make test failed"; | ||
92 | } else { | ||
93 | system("./Build test") == 0 or die "./Build test failed"; | ||
94 | } | ||
83 | } | 95 | } |
84 | if ($opts->{i}) { | 96 | if ($opts->{i}) { |
85 | system("make install SITEPREFIX=$destdir") == 0 or die "Can't run make install"; | 97 | if (-e "Makefile") { |
98 | system("make install SITEPREFIX=$destdir") == 0 or die "Can't run make install"; | ||
99 | } else { | ||
100 | system("./Build install") == 0 or die "Can't run ./Build install"; | ||
101 | } | ||
86 | } | 102 | } |
87 | chdir $topdir or die "Can't go back to $topdir"; | 103 | chdir $topdir or die "Can't go back to $topdir"; |
88 | } | 104 | } |