debuild: force to compress data.tar with gzip instead of xz

Sergey V. sftp.mtuci at gmail.com
Sun May 11 13:03:47 UTC 2014


В письме от Суббота 10 мая 2014 15:48:49 пользователь James McCoy написал:
> On Sat, May 10, 2014 at 06:38:48PM +0400, Sergey V. wrote:
> > В письме от Суббота 10 мая 2014 10:09:03 пользователь James McCoy написал:
> > > If you're using a 3.0 (quilt) format source package, you could add
> > > 
> > >   compression = "gzip"
> > > 
> > > in debian/source/options.
> > 
> > It seems not works for me:
> > > Alternatively, pass "-Zgzip" to debuild as part of the dpkg-buildpackage
> > > options
> > > 
> > >   debuild [debuild options] [dpkg-buildpackage options] [--lintian-opts
> > > 
> > > lintian options]
> > 
> > I did tryed it too with same result:
> Ah, right, that just handles compression of the orig tarball.  Your
> initial approach was targeting the right command.
> 
> It doesn't look like dpkg provides a way to modify this behavior in a
> more general manner.  Looks like your options are then to either
> 
> a) modify the rules file as you already suggested
> b) rebuild current dpkg with default compression set back to gz
> c) write a wrapper dpkg-deb script that adds "-Zgzip" to the command
>    unless a non-xz option is already present
> 
> Option c is probably the easiest.  Just need to make sure it's present
> in $PATH in your build environment before the real dpkg-deb and that it
> doesn't call itself when it tries to run the real dpkg-deb.
I like this approach. But seems debuild (or precisely its child 
tool/process) calls dpkg-deb by direct name, not looking into $PATH:

$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
$ which dpkg-deb
/usr/local/bin/dpkg-deb
$ ls -l /usr/local/bin/dpkg-deb
-rwxr-xr-x 1 root root 41 May 11 16:40 /usr/local/bin/dpkg-deb
$ cat /usr/local/bin/dpkg-deb
#!/bin/bash
/usr/bin/dpkg-deb $@ -Zgzip
$ strace -e execve -f debuild 2>&1 | grep dpkg-deb
[pid 11090] execve("/usr/sbin/dpkg-deb", ["dpkg-deb", "--build", 
"debian/my_package", ".."], [/* 43 vars */]) = -1 ENOENT (No such file or 
directory)
[pid 11090] execve("/usr/bin/dpkg-deb", ["dpkg-deb", "--build", 
"debian/my_package", ".."], [/* 43 vars */]) = 0
dpkg-deb: building package `my_package' in `../my_package_0.1_all.deb'.
[pid 11132] execve("/usr/bin/dpkg-deb", ["/usr/bin/dpkg-deb", "--fsys-tarfile", 
"/tmp/temp-lintian-lab-jMbu4Zxvsc"...], [/* 40 vars */] <unfinished ...>
[pid 11133] execve("/usr/bin/dpkg-deb", ["/usr/bin/dpkg-deb", "--fsys-tarfile", 
"/tmp/temp-lintian-lab-jMbu4Zxvsc"...], [/* 40 vars */]) = 0
[pid 11145] execve("/usr/bin/dpkg-deb", ["/usr/bin/dpkg-deb", "--fsys-tarfile", 
"/tmp/temp-lintian-lab-jMbu4Zxvsc"...], [/* 40 vars */] <unfinished ...>

So, it tries to run '/usr/sbin/dpkg-deb', then '/usr/bin/dpkg-deb', but not 
/usr/local/bin/dpkg-deb before this. So i needed to move original tool and 
place a wrapper to original filename '/usr/bin/dpkg-deb'.

The same problem applies to dh_builddeb.
 
> Are you trying to build your own packages or rebuild existing Debian
> packages?  If it's the latter, I wouldn't be surprised if you run into
> more significant problems than this, as systems that don't even have
> dpkg 1.15.6 are fairly old.
I'm trying to build my own packages.

> Cheers,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.alioth.debian.org/pipermail/devscripts-devel/attachments/20140511/90860a82/attachment.sig>


More information about the devscripts-devel mailing list