Skip to content

Commit

Permalink
[install]
Browse files Browse the repository at this point in the history
- remove Perl modules dependencies
- this script must be shipped (see RT #58852)

git-svn-id: https://svn.parrot.org/parrot/trunk@32067 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
fperrad committed Oct 21, 2008
1 parent 15a7b06 commit 8b34285
Showing 1 changed file with 18 additions and 59 deletions.
77 changes: 18 additions & 59 deletions tools/install/smoke.pl
Expand Up @@ -5,9 +5,9 @@
use strict;
use warnings;
use 5.008;

use Getopt::Long;
use lib qw( lib );
use vars qw( %PConfig );
use File::Spec::Functions;

use Test::More tests => 28;

Expand All @@ -17,23 +17,22 @@ =head1 NAME
=head1 SYNOPSIS
parrot in bin
parrot in bin
% cd /usr/local/parrot-$version
% perl tools/install/smoke.pl -Ilib
% perl tools/install/smoke.pl
parrot in .
parrot in .
% perl tools/install/smoke.pl --bindir=.
test installation in DESTDIR:
test installation in DESTDIR:
% cd /usr/src/parrot
% mkdir .inst
% make install DESTDIR=.inst
% perl tools/install/smoke.pl DESTDIR=.inst
=head1 DESCRIPTION
Checks that most of things run (or just start) into the install directory,
Expand All @@ -43,68 +42,29 @@ =head1 OPTIONS
=over
=item -I libdir
Add libdir to the libpath to find Parrot::Config
=item --bindir=/usr/bin
Override Parrot::Config bindir
Override default value : 'bin'
=item --libdir=/usr/lib
Override Parrot::Config libdir
=item --prefix=/usr
Override Parrot::Config prefix and adjust
libdir and bindir accordingly.
=item DESTDIR=instpath
Use the temp. installation in instpath.
Override default value : 'lib'
=back
=cut

my (@libdirs, $prefix, $bindir, $libdir, $DESTDIR);
my $opts = GetOptions( 'I=s' => \@libdirs,
'prefix=s' => \$prefix,
'bindir=s' => \$bindir,
'libdir=s' => \$libdir,
'DESTDIR=s' => \$DESTDIR,
);
if (@libdirs) {
push @INC, @libdirs;
}
require Parrot::Config;
Parrot::Config->import;
require Parrot::Test;

$bindir = $PConfig{bindir} unless $bindir;
$libdir = $PConfig{libdir} unless $libdir;
if ($prefix) {
$bindir = $prefix . "/bin";
$libdir = $prefix . "/lib";
}
# Check for DESTDIR arg and adjust the path
if (@ARGV and $ARGV[0] =~ /^DESTDIR/) {
if ($ARGV[0] =~ /^DESTDIR=(\S+)/) {
$DESTDIR = $1;
}
else {
$DESTDIR = $ARGV[1];
}
}
if ($DESTDIR) {
my $envsep = $^O eq 'MSWin32' ? ';' : ':';
$ENV{PATH} = $DESTDIR.$bindir.$envsep.$ENV{PATH};
$bindir = $DESTDIR . $bindir;
$libdir = $DESTDIR . $libdir;
}
my ($bindir, $libdir, $DESTDIR);
my $opts = GetOptions(
'bindir=s' => \$bindir,
'libdir=s' => \$libdir,
'DESTDIR=s' => \$DESTDIR,
);

use File::Spec::Functions;
$bindir = 'bin' unless $bindir;
$libdir = 'lib' unless $libdir;

chdir $DESTDIR if ($DESTDIR);

my $filename;
my $exe;
Expand All @@ -115,7 +75,6 @@ =head1 OPTIONS
#
# parrot executable
#
-x $parrot or die "$parrot does not exist\n";

$exe = catfile($bindir, 'pbc_merge');
$out = `$exe`;
Expand Down

0 comments on commit 8b34285

Please sign in to comment.