Hi, I had the same problem and the following patch did the job for me:
diff --git a/Alien/Package/Tgz.pm b/Alien/Package/Tgz.pm index 7ab6e8b..bd85b4e 100644 --- a/Alien/Package/Tgz.pm +++ b/Alien/Package/Tgz.pm @@ -169,7 +169,11 @@ sub unpack { $this->SUPER::unpack(@_); my $file=abs_path($this->filename); - $this->do("cd ".$this->unpacked_tree."; tar xpf $file") + my $transform=""; + if (defined $this->install_prefix) { + $transform=" --transform s:^:".$this->install_prefix.":"; + } + $this->do("cd ".$this->unpacked_tree."; tar xpf $file".$transform) or die "Unpacking of '$file' failed: $!"; # Delete the install directory that has slackware info in it. $this->do("cd ".$this->unpacked_tree."; rm -rf ./install"); diff --git a/alien.pl b/alien.pl index 602ba59..dfa3729 100755 --- a/alien.pl +++ b/alien.pl @@ -334,6 +334,7 @@ Usage: alien [options] file [...] --veryverbose Be verbose, and also display output of run commands. -k, --keep-version Do not change version of generated package. --bump=number Increment package version by this number. + --prefix=<prefix> Add prefix to files inside input tgz. -h, --help Display this help message. -V, --version Display alien's version number. @@ -344,7 +345,7 @@ EOF # Start by processing the parameters. my (%destformats, $generate, $install, $single, $scripts, $patchfile, $nopatch, $tgzdescription, $tgzversion, $keepversion, $fixperms, - $test, $anypatch); + $test, $anypatch, $install_prefix); my $versionbump=1; # Bundling is nice anyway, and it is required or Getopt::Long will confuse @@ -374,6 +375,7 @@ GetOptions( "keep-version|k" => \$keepversion, "bump=s" => \$versionbump, "fixperms" => \$fixperms, + "prefix=s" => \$install_prefix, "help|h" => \&usage, ) || usage(); @@ -435,6 +437,7 @@ foreach my $file (@ARGV) { $package=Alien::Package::Tgz->new(filename => $file); $package->description($tgzdescription) if defined $tgzdescription; $package->version($tgzversion) if defined $tgzversion; + $package->install_prefix($install_prefix) if defined $install_prefix; } elsif (Alien::Package::Slp->checkfile($file)) { $package=Alien::Package::Slp->new(filename => $file); Ilya