Hi,
I have the following experiences. different systems differnet ways how
to get the best result:
- Windows: CavaPackager (even ActiveState perlapp had problems with
wxPerl code)
- Linux: PAR
- Mac OS X: Actually some selfmade "collect modules" + AppWarpper made
by Platypus
If Cava bes“come multi platfrom this would be a perfect gift!
Attached there is a "pre alpha state" module collector. Have a try on
this one to track down problems.
Greetings Alexander
Am 02.08.2010 um 20:31 schrieb Daniel Carrera:
On Mon, Aug 2, 2010 at 8:03 PM, Johan Vromans wrote:
Cava will be multi-platform soon.
ActiveState PDK ('perlapp') already works nice on all platforms but
is a
commercial product. If you have seral apps to ship is may be worth
considering.
Perl 'PAR' works nice in many cases as well.
Does Cava work better than PAR? How would you compare them? What's the
ETA for Cava to be cross-platform?
I don't have any urgency. I am not a commercial developer with a
deadline.
Daniel.
--
Intolerant people should be shot.
#!/opt/local/bin/perl -w
use strict;
use FindBin;
use lib "$FindBin::Bin";
use Getopt::Long;
use Module::ScanDeps;
use Data::Dumper;
use Config;
my $version = 'pre alpha';
my $debug = 1;
my $recurse = 1;
my $test;
my $warn;
my $compile;
my $libDir;
my $fileCnt;
my $dirCnt;
my $infile;
my @files;
@Module::ScanDeps::IncludeLibs = ("$Config::Config{privlibexp}", "$Config::Config{sitelibexp}", "$Config::Config{vendorlibexp}", "$Config::Config{archlibexp}", "$Config::Config{sitelibexp}/$Config::Config{archname}" );
######################### start #####################################
if ( @ARGV < 1 ) { show_help(); }
GetOptions(
"f=s" => \$infile,
"l=s" => \$libDir,
"w|warn" => \$warn,
"r|recurse" => \$recurse,
"c|compile" => \$compile,
"t|test" => \$test,
"d|debug" => \$debug,
"h|help|?" => \&show_help,
);
if(! $test) {
if (! (-d $libDir)) { mkdir($libDir); }
}
push(@files, $infile);
my $hash_ref = scan_deps(
files => \...@files,
recurse => $recurse,
compile => $compile,
# rv => \%rv,
# skip => \%skip,
# execute => $execute,
);
foreach my $key (keys %{$hash_ref}) {
unless ($hash_ref->{$key}{'type'} eq 'module'){ next; }
my $source = $hash_ref->{$key}{'file'};
my $target = $libDir .'/'. $hash_ref->{$key}{'key'};
my $targetDir = $target;
$targetDir =~ s/(\/\w.pm*)$//;
my $cmd = "cp '$source' '$target'";
print"Cmd: $cmd\n";
#my $perlName = path_to_inc_name($source, $warn);
#print"PerlName: $perlName\n";
if(! $test) {
if(! (-d $targetDir)) {
system("mkdir -p $targetDir") == 0 or die "Can't create targetDir!";
print"TargetDir has been created: $targetDir\n";
}
system($cmd) == 0 or die "Can't copy file/directory!";
print"Done.\n\n";
}
}
if(! $test) { print"\nCopied: $fileCnt files $dirCnt directorys\n"; }
if($debug) { print Dumper($hash_ref); }
exit 0;
############ subroutines #################
sub show_help {
print <<EOF;
modulecollector V 0.1 alpha
mcollector [ options ]-f=inputfile -l=lib
-f=input
-l=path to target directory
-recurse scan recursive (default)
-warn warn if moudles are missing
-compile compile while scanning
-test test only - no files will be copied
-h show this help (also --help and ?)
-debug print extra debugging infos
$version
EOF
exit 0;
}
sub copy_modules {
my $key = shift;
print"Working on $key\n";
my ($cmd, $type);
my @directorys = ("$Config::Config{privlibexp}", "$Config::Config{sitelibexp}", "$Config::Config{vendorlibexp}", "$Config::Config{archlibexp}", "$Config::Config{sitelibexp}/$Config::Config{archname}" );
my $libDir = '/Users/ademmler/Desktop/lib';
my $baseDir = '/opt/local/lib/perl5/';
#copy Module to libfolder
foreach my $entry (@directorys) {
print"Entry: $entry\n";
my $subDir = $entry;
$subDir =~ s/^$baseDir//;
print"SubDir: $subDir\n";
my $target = $libDir .'/'. $subDir;
print"Target: $target\n";
if(! (-d $target) ) {
system("mkdir -p $target") == 0 or die "Cant create directory $target($! $?)\n";
print"Target directory created!\n";
}
my $sourceFile = $entry .'/'. $key;
if (-f $sourceFile) {
print"Copy file: $sourceFile\n";
if (! $test) { system("cp $sourceFile $target") == 0 or die "Copy failed: $sourceFile\n"; }
$fileCnt ++;
} else {
print"No source file: $sourceFile\n";
}
my $sourceDir = $entry .'/'. $key;
$sourceDir =~ s/.pm$//;
print"SourceDir: $sourceDir\n";
if (-d $sourceDir) {
print"Copy directory: $sourceDir\n";
if (! $test) { system("cp -R $sourceDir $target") == 0 or die "Copy failed: $sourceDir\n"; }
$dirCnt ++;
} else {
print"No source dir: $sourceDir\n";
}
print"\n";
}
}