mirror of
https://github.com/Project-OSS-Revival/alien.git
synced 2026-04-24 14:00:17 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d8ec3bf09 | ||
|
|
decc4d75c8 | ||
|
|
de7aa3b0f8 | ||
|
|
5836229bae | ||
|
|
8bba6dfdc5 | ||
|
|
04a9c4fa04 |
@@ -254,19 +254,27 @@ sub scan {
|
||||
for (my $i=0; $i <= $#control; $i++) {
|
||||
$_ = $control[$i];
|
||||
chomp;
|
||||
if (/^(\w.*?):\s+(.*)/) {
|
||||
if (/^(\w.*?):\s*(.*)/) {
|
||||
# Really old debs might have oddly capitalized
|
||||
# field names.
|
||||
$field=ucfirst(lc($1));
|
||||
if (exists $fieldtrans{$field}) {
|
||||
$field=$fieldtrans{$field};
|
||||
$this->$field($2);
|
||||
my $value = $2;
|
||||
# Only set field if value is non-empty.
|
||||
# For Description, empty first line means
|
||||
# the actual text starts on next line.
|
||||
$this->$field($value) if length $value;
|
||||
}
|
||||
}
|
||||
elsif (/^ / && $field eq 'summary') {
|
||||
# Handle extended description.
|
||||
s/^ //g;
|
||||
$_="" if $_ eq ".";
|
||||
# If summary is empty, use first line of extended description
|
||||
if (!defined $this->summary || !length $this->summary) {
|
||||
$this->summary($_);
|
||||
}
|
||||
$description.="$_\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -463,9 +463,8 @@ sub prep {
|
||||
# Write out the spec file.
|
||||
my $spec="$dir/".$this->name."-".$this->version."-".$this->release.".spec";
|
||||
open (OUT, ">$spec") || die "$spec: $!";
|
||||
my $pwd=`pwd`;
|
||||
chomp $pwd;
|
||||
print OUT "Buildroot: $pwd/$dir\n"; # must be absolute dirname
|
||||
# Note: Buildroot is passed via --buildroot command line option
|
||||
# to handle paths with spaces correctly
|
||||
print OUT "Name: ".$this->name."\n";
|
||||
print OUT "Version: ".$this->version."\n";
|
||||
print OUT "Release: ".$this->release."\n";
|
||||
@@ -483,22 +482,22 @@ sub prep {
|
||||
if ($this->usescripts) {
|
||||
if ($this->preinst) {
|
||||
print OUT "\%pre\n";
|
||||
print OUT $this->preinst."\n";
|
||||
print OUT escape_percents($this->preinst)."\n";
|
||||
print OUT "\n";
|
||||
}
|
||||
if ($this->postinst) {
|
||||
print OUT "\%post\n";
|
||||
print OUT $this->postinst."\n";
|
||||
print OUT escape_percents($this->postinst)."\n";
|
||||
print OUT "\n";
|
||||
}
|
||||
if ($this->prerm) {
|
||||
print OUT "\%preun\n";
|
||||
print OUT $this->prerm."\n";
|
||||
print OUT escape_percents($this->prerm)."\n";
|
||||
print OUT "\n";
|
||||
}
|
||||
if ($this->postrm) {
|
||||
print OUT "\%postun\n";
|
||||
print OUT $this->postrm."\n";
|
||||
print OUT escape_percents($this->postrm)."\n";
|
||||
print OUT "\n";
|
||||
}
|
||||
}
|
||||
@@ -574,7 +573,7 @@ sub build {
|
||||
$opts.=" $ENV{RPMBUILDOPT}" if exists $ENV{RPMBUILDOPT};
|
||||
my $pwd=`pwd`;
|
||||
chomp $pwd;
|
||||
my $command="cd $dir; $buildcmd --buildroot='$pwd/$dir' -bb $opts '".$this->name."-".$this->version."-".$this->release.".spec'";
|
||||
my $command="cd '$dir'; $buildcmd --buildroot='$pwd/$dir' -bb $opts '".$this->name."-".$this->version."-".$this->release.".spec'";
|
||||
my $log=$this->runpipe(1, "$command 2>&1");
|
||||
if ($?) {
|
||||
die "Package build failed. Here's the log of the command ($command):\n", $log;
|
||||
@@ -659,6 +658,7 @@ sub _script_helper {
|
||||
$this->{$script} = $value;
|
||||
}
|
||||
$this->{$script} = shift if @_;
|
||||
return $this->{$script};
|
||||
|
||||
# get
|
||||
return unless defined wantarray; # optimization
|
||||
@@ -694,6 +694,11 @@ sub prerm {
|
||||
my $this=shift;
|
||||
$this->_script_helper('prerm', @_);
|
||||
}
|
||||
sub escape_percents {
|
||||
my $s=shift;
|
||||
$s =~ s/\%/\%\%/g;
|
||||
return $s;
|
||||
}
|
||||
|
||||
=item arch
|
||||
|
||||
|
||||
@@ -489,7 +489,10 @@ sub build {
|
||||
$Alien::Package::verbose=$v;
|
||||
}
|
||||
else {
|
||||
die "Sorry, I cannot generate the .tgz file because /sbin/makepkg is not present.\n"
|
||||
# Fallback to plain tar when makepkg is not available
|
||||
# Use same method as makepkg: strip ./ prefix via sed to match Slackware format
|
||||
$this->do("cd ".$this->unpacked_tree."; find ./ | LC_COLLATE=C sort | sed '2,\$s,^\\./,,' | tar --no-recursion -T - -czf ../$tgz")
|
||||
or die "Package build failed";
|
||||
}
|
||||
return $tgz;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ sub MY::libscan {
|
||||
sub MY::postamble {
|
||||
return q{
|
||||
|
||||
VER=$(shell perl -e '$$_=<>;print m/\((.*?)\)/'<debian/changelog)
|
||||
VER=$(shell perl -e '$$_=<>;print m/\((.*?)\)/'<ChangeLog)
|
||||
|
||||
all:: extra_build
|
||||
clean:: extra_build
|
||||
|
||||
4
README
4
README
@@ -51,8 +51,8 @@ Note:
|
||||
Programs that use alien:
|
||||
|
||||
I know of one program that acts as a frontend to alien - kpackviewer is a
|
||||
package viewer that can convert between package formats by using alien. Its
|
||||
homepage is at http://www.momentus.com.br/users/hook/kpackviewer.html
|
||||
package viewer that can convert between package formats by using alien. Can
|
||||
be downloaded from https://download.kde.org/Attic/stable/stable/apps/KDE1.x/utils/kpackviewer-0.70.tar.gz
|
||||
|
||||
Corel also appears to have (or had) something in Corel linux that
|
||||
uses alien.
|
||||
|
||||
Reference in New Issue
Block a user