14 Commits
8.73 ... 8.78

Author SHA1 Message Date
Joey Hess
6ab9218809 releasing version 8.78 2009-07-08 13:55:16 -04:00
Pavel Roskin
9c28b11e6c Fix support for recent versions of rpm
Recent versions of rpm (such as 4.7.0) ignore the buildroot setting in
the spec file.  Use the --buildroot option to ensure the correct
buildroot is used.
2009-07-08 13:52:49 -04:00
Joey Hess
e14d223117 releasing version 8.77 2009-07-06 13:40:58 -04:00
Joey Hess
f456bbf8b6 In rpm permission fixup code, avoid processing symlinks since that would result in the file the link points to being "fixed". Closes: #535586 2009-07-06 13:35:03 -04:00
Joey Hess
78734c0523 Don't allow whitespace in package version when parsing debian/changelog. 2009-06-17 13:07:18 -04:00
Joey Hess
f680d3af91 releasing version 8.76 2009-06-08 13:24:25 -04:00
Joey Hess
5b605e1960 Fix bash shebang and recognise bash scripts as editable shell scripts when converting to deb. Closes: #532330 (Thanks, Bruce Stephens) 2009-06-08 13:22:30 -04:00
Joey Hess
cbf330f982 Avoid using hostname -f for portability to unix systems, such as Solaris, where any options _set_ the hostname. 2009-05-29 13:03:17 -04:00
Joey Hess
bcd8dae206 releasing version 8.75 2009-05-06 17:24:21 -04:00
Joey Hess
edcd96f80f Modify maintainer scripts from rpm files to use /bin/bash rather than /bin/sh. Many such scripts are only tested on systems where /bin/sh is bash, and contain bashisms, which can cause trouble when converting the rpm to be used on eg, the Debian family of distributions, where /bin/sh can legitimatly be dash. Closes: #495971 2009-05-06 17:20:44 -04:00
Joey Hess
c21645ddfa Simplified rules file. 2009-02-27 20:20:37 -05:00
Joey Hess
0f8fa0df54 pod fixes 2009-02-15 19:56:50 -05:00
Joey Hess
2a84d6e8ec true slackware packages unlikely, so generalize messages 2009-01-14 13:39:14 -05:00
Joey Hess
66a1247dfd Support bzipped and uncompressed tar files, using tar's auto-compression detection. (Requires gnu tar 1.14.91) 2009-01-14 13:37:06 -05:00
8 changed files with 91 additions and 28 deletions

View File

@@ -317,6 +317,7 @@ sub prep {
my $line=<$changelog>;
if ($line=~/^[^ ]+\s+\(([^)]+)\)\s/) {
my $version=$1;
$version=~s/\s+//; # ensure no whitespace
if ($version=~/(.*)-(.*)/) {
$version=$1;
$this->release($2);
@@ -683,7 +684,7 @@ sub email {
close MAILNAME;
}
if (!$mailname) {
$mailname=$this->runpipe(1, "hostname -f");
$mailname=$this->runpipe(1, "hostname");
chomp $mailname;
}
return "$login\@$mailname";
@@ -738,7 +739,7 @@ sub postinst {
return $postinst unless %$owninfo;
my ($firstline, $rest)=split(/\n/, $postinst, 2);
if ($firstline !~ m/^#!\s*\/bin\/sh/) {
if ($firstline !~ m/^#!\s*\/bin\/(ba)?sh/) {
print STDERR "warning: unable to add ownership fixup code to postinst as the postinst is not a shell script!\n";
return $postinst;
}
@@ -754,7 +755,7 @@ sub postinst {
return "$firstline\n$permscript\n$rest";
}
=cut
=back
=head1 AUTHOR

View File

@@ -327,6 +327,8 @@ sub build {
return $name;
}
=back
=head1 AUTHOR
Mark Hershberger <mah@everybody.org>

View File

@@ -239,6 +239,9 @@ sub unpack {
while (<GETPERMS>) {
chomp;
my ($mode, $owner, $group, $file) = split(/ /, $_, 4);
next if -l "$workdir/$file";
$mode = $mode & 07777; # remove filetype
my $uid = getpwnam($owner);
if (! defined $uid || $uid != 0) {
@@ -258,12 +261,10 @@ sub unpack {
if (defined($owninfo{$file}) && ($mode & 07000 > 0)) {
$modeinfo{$file} = sprintf "%lo", $mode;
}
next unless -e "$workdir/$file"; # skip broken links
if ($> == 0) {
$this->do("chown", "$uid:$gid", "$workdir/$file")
|| die "failed chowning $file to $uid\:$gid\: $!";
}
next if -l "$workdir/$file"; # skip links
$this->do("chmod", sprintf("%lo", $mode), "$workdir/$file")
|| die "failed changing mode of $file to $mode\: $!";
}
@@ -418,7 +419,9 @@ sub build {
}
$opts.=" $ENV{RPMBUILDOPT}" if exists $ENV{RPMBUILDOPT};
my $command="cd $dir; $buildcmd -bb $opts ".$this->name."-".$this->version."-".$this->release.".spec";
my $pwd=`pwd`;
chomp $pwd;
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;
@@ -463,11 +466,16 @@ debian/slackware scripts can be anything -- perl programs or binary files
-- and rpm is limited to only shell scripts, we need to encode the files
and add a scrap of shell script to make it unextract and run on the fly.
When setting a value, we do some mangling too. Rpm maitainer scripts
are typically shell scripts, but often lack the leading #!/bin/sh
This can confuse dpkg, so add the #!/bin/sh if it looks like there
When setting a value, we do some mangling too. Rpm maintainer scripts
are typically shell scripts, but often lack the leading shebang line.
This can confuse dpkg, so add the shebang if it looks like there
is no shebang magic already in place.
Additionally, it's not uncommon for rpm maintainer scripts to contain
bashisms, which can be triggered when they are ran on systems where /bin/sh
is not bash. To work around this, the shebang line of the scripts is
changed to use bash.
Also, if the rpm is relocatable, the script could refer to
RPM_INSTALL_PREFIX, which is set by rpm at run time. Deal with this by
adding code to the script to set RPM_INSTALL_PREFIX.
@@ -489,9 +497,10 @@ sub _script_helper {
my $value=shift;
if (length $value and $value !~ m/^#!\s*\//) {
$value="#!/bin/sh\n$prefixcode$value";
$value="#!/bin/bash\n$prefixcode$value";
}
else {
$value=~s@^#!\s*/bin/sh(\s)@#!/bin/bash$1@;
$value=~s/\n/\n$prefixcode/s;
}
$this->{$script} = $value;

View File

@@ -358,6 +358,8 @@ sub release {
}
=back
=head1 AUTHOR
Joey Hess <joey@kitenet.net>

View File

@@ -9,10 +9,14 @@ Alien::Package::Tgz - an object that represents a tgz package
package Alien::Package::Tgz;
use strict;
use base qw(Alien::Package);
use Cwd qw(abs_path);
my $tarext=qr/\.(?:tgz|tar(?:\.(?:gz|Z|z|bz|bz2))?|taz)$/;
=head1 DESCRIPTION
This is an object class that represents a tgz package, as used in Slackware.
It also allows conversion of raw tar files.
It is derived from Alien::Package.
=head1 CLASS DATA
@@ -49,7 +53,7 @@ sub checkfile {
my $this=shift;
my $file=shift;
return $file =~ m/.*\.(?:tgz|tar\.(?:gz|Z|z)|taz)$/;
return $file =~ m/$tarext$/;
}
=item install
@@ -93,7 +97,7 @@ sub scan {
my ($basename)=('/'.$file)=~m#^/?.*/(.*?)$#;
# Strip out any tar extentions.
$basename=~s/\.(tgz|tar\.(gz|Z))$//;
$basename=~s/$tarext//;
if ($basename=~m/([\w-]+)-([0-9\.?]+).*/) {
$this->name($1);
@@ -106,11 +110,11 @@ sub scan {
$this->arch('all');
$this->summary("Converted Slackware tgz package");
$this->summary("Converted tgz package");
$this->description($this->summary);
$this->copyright('unknown');
$this->release(1);
$this->distribution("Slackware");
$this->distribution("Slackware/tarball");
$this->group("unknown");
$this->origformat('tgz');
$this->changelogtext('');
@@ -119,7 +123,7 @@ sub scan {
# Now figure out the conffiles. Assume anything in etc/ is a
# conffile.
my @conffiles;
open (FILELIST,"tar zvtf $file | grep etc/ |") ||
open (FILELIST,"tar vtf $file | grep etc/ |") ||
die "getting filelist: $!";
while (<FILELIST>) {
# Make sure it's a normal file. This is looking at the
@@ -136,7 +140,7 @@ sub scan {
# Now get the whole filelist. We have to add leading /'s to the
# filenames. We have to ignore all files under /install/
my @filelist;
open (FILELIST, "tar ztf $file |") ||
open (FILELIST, "tar tf $file |") ||
die "getting filelist: $!";
while (<FILELIST>) {
chomp;
@@ -148,7 +152,7 @@ sub scan {
# Now get the scripts.
foreach my $script (keys %{scripttrans()}) {
$this->$script(scalar $this->runpipe(1, "tar Oxzf $file install/${scripttrans()}{$script} 2>/dev/null"));
$this->$script(scalar $this->runpipe(1, "tar Oxf $file install/${scripttrans()}{$script} 2>/dev/null"));
}
return 1;
@@ -163,9 +167,9 @@ Unpack tgz.
sub unpack {
my $this=shift;
$this->SUPER::unpack(@_);
my $file=$this->filename;
my $file=abs_path($this->filename);
$this->do("cat $file | (cd ".$this->unpacked_tree."; tar zxpf -)")
$this->do("cd ".$this->unpacked_tree."; tar xpf $file")
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");
@@ -218,6 +222,8 @@ sub build {
return $tgz;
}
=back
=head1 AUTHOR
Joey Hess <joey@kitenet.net>

44
debian/changelog vendored
View File

@@ -1,3 +1,47 @@
alien (8.78) unstable; urgency=low
* Add support for rpm 4.7.0, which ignores the buildroot setting in the
spec file, by passing --buildroot. (Thanks, Pavel Roskin)
-- Joey Hess <joeyh@debian.org> Wed, 08 Jul 2009 13:53:05 -0400
alien (8.77) unstable; urgency=low
* Don't allow whitespace in package version when parsing debian/changelog.
* In rpm permission fixup code, avoid processing symlinks since that
would result in the file the link points to being "fixed". Closes: #535586
-- Joey Hess <joeyh@debian.org> Mon, 06 Jul 2009 13:37:01 -0400
alien (8.76) unstable; urgency=low
* Avoid using hostname -f for portability to unix systems,
such as Solaris, where any options _set_ the hostname.
* Fix bash shebang and recognise bash scripts as editable
shell scripts when converting to deb. Closes: #532330
(Thanks, Bruce Stephens)
-- Joey Hess <joeyh@debian.org> Mon, 08 Jun 2009 13:22:35 -0400
alien (8.75) unstable; urgency=low
* Simplified rules file.
* Modify maintainer scripts from rpm files to use /bin/bash rather
than /bin/sh. Many such scripts are only tested on systems where /bin/sh
is bash, and contain bashisms, which can cause trouble when converting
the rpm to be used on eg, the Debian family of distributions, where
/bin/sh can legitimatly be dash. Closes: #495971
-- Joey Hess <joeyh@debian.org> Wed, 06 May 2009 17:22:02 -0400
alien (8.74) unstable; urgency=low
* Support bzipped and uncompressed tar files, using tar's auto-compression
detection. (Requires gnu tar 1.14.91)
* pod fixes
-- Joey Hess <joeyh@debian.org> Sun, 15 Feb 2009 19:51:54 -0500
alien (8.73) unstable; urgency=low
* Fix pkg generation to not include /prototype in all packages.

4
debian/control vendored
View File

@@ -1,9 +1,9 @@
Source: alien
Section: admin
Priority: optional
Build-Depends: debhelper (>= 7)
Build-Depends: debhelper (>= 7.0.50)
Maintainer: Joey Hess <joeyh@debian.org>
Standards-Version: 3.7.3
Standards-Version: 3.8.1
Vcs-Git: git://git.kitenet.net/alien
Homepage: http://kitenet.net/~joey/code/alien/

13
debian/rules vendored
View File

@@ -2,20 +2,19 @@
%:
dh $@
build:
dh build
override_dh_auto_test:
# simple smoke test
./alien.pl -V
binary-indep: build
dh install --before dh_auto_install
override_dh_auto_install:
$(MAKE) pure_install INSTALLDIRS=vendor \
PREFIX=$(shell pwd)/debian/alien/$(shell perl -MConfig -e 'print $$Config{prefix}') \
VARPREFIX=$(shell pwd)/debian/alien
dh install --after dh_auto_install
override_dh_auto_clean:
# distclean moans about MANIFEST, this is quieter
if [ -e Makefile ]; then $(MAKE) realclean; fi
# Not intended for use by anyone except the author.
announcedir:
@echo ${HOME}/src/joeywiki/code/alien/news
binary: binary-indep binary-arch