Tukaani logo

History of LZMA Utils

LZMA and pkgtools

Our experience with LZMA compression began when support for it was added to the Tukaani package management system (pkgtools). The LZMA encoder/decoder from Igor Pavlov's LZMA SDK was soon found to be an excellent piece of free software distributed under the GNU LGPL. Despite its roots in the MS-Windows world, it compiles cleanly with GCC and works without glitches at least on GNU/*/Linux and OpenBSD.

After adding LZMA support to Tukaani package management system, we wondered why this excellent compression software isn't used as widely as gzip and bzip2 are. The main reason is obviously that nowadays both gzip and bzip2 are bundled with practically every GNU/*/Linux distribution. Of course, that is a very good thing because you can be sure that recipient can uncompress your tar.gz and tar.bz2 files. People are also used to them, so why learn something new?

The idea of LZMA utils

It is reasonable to assume that bzip2 became popular not only because it provided better compression ratio than gzip, but because transition from gzip to bzip2 was made easy. The key is that the user interface (i.e. supported command line parameters) of bzip2 is very similar than that of gzip. It makes the learning curve very low for the users already familiar with gzip.

The LZMA encoder/decoder of LZMA SDK is a normal program with a command line interface. However, the command line arguments are totally different compared to gzip and bzip2. This is where LZMA utils come to play; the main purporse of the LZMA utils is to make usage of the LZMA format as easy as possible for those who are already familiar with gzip and bzip2. The first step was lzmash, a small wrapper script, which gave the LZMA encoder/decoder almost identical command line interface than what gzip and bzip2 have. Technically lzmash was an ugly and buggy hack which was replaced with a real program in 4.32.0beta1.

lzmash was still a good start so we continued by adapting zgrep, zdiff and zmore scripts (by the way, it would be cool to make GNU grep and diff to use compression libraries directly). As a whole LZMA utils provide a very similar command set than what gzip and bzip2 packages have. Up to LZMA utils version 4.32.0beta1, LZMA SDK was used almost as is. Next stable version will introduce liblzma, a LZMA library with a zlib-like API. It will enable developers to easily integrate LZMA compression to existing applications.