Re: replicating package compression used by dpkg-deb
Ian Bruce <email@example.com> writes:
> On Thu, 28 Sep 2006 03:45:16 -0700
> Ian Bruce <firstname.lastname@example.org> wrote:
>> So it seems that with the currently shipping versions of gzip (I tried
>> both "stable/updates" and "testing"), there is actually no way to
>> exactly replicate the compression produced by the standard package
>> build system.
>> It appears that dpkg-deb does not exec gzip, and it's not dynamically
>> linked with anything except glibc. I suppose that it's statically
>> linked against zlib1g or something like it. So the question is, how
>> can the exact compression algorithm used by dpkg-deb be made available
>> for another piece of software? Is it something that's well-specified,
>> or is it liable to change at any moment?
> It turns out that the zlib1g-dev package contains a program called
> "minigzip" in source form. This is what's needed; "minigzip -9"
> reproduces exactly the compression used by dpkg-deb, unlike regular
Have you tried gzip -n?
Anyway, look at the source of dpkg-deb and then use the same (static
linking of zlib I assume).