Converting LIT files in Ubuntu

LIT files are a proprietary Microsoft e-book format. Proprietary is always bad, but you can't help it if sometimes you get files in the format (from, er, you know...various sources.) Those occasions, though, will be rare.

There's no package in the Ubuntu repositories that can help you with this. There is a program, though, called Convert-Lit, but you'll have to go download and build it yourself. Convert Lit will convert a LIT file into HTML as well as OEBPF format.

The best instructions for building C-Lit can be found here. I'm reproducing a simplified set of instructions based on that document.

  1. First, install the build-essential package, if you haven't already done so. I've already covered it in a previous entry.
  2. Download the Convert Lit source.
  3. Download libtomcrypt. This is a library decrypting the encrypted files.
  4. Unpack and build the files
    gzip -cd < open_clit18src.tar.gz | tar xf -
    bzip2 -cd < ltm-0.30.tar.bz2 | tar xf -
    cd libtommath-0.30
    cd ../lib
    cd ../cl?t18

  5. The final optional step is to install the program into your system:
    sudo install clit /usr/local/bin

You can choose not to install the program, though, and just invoke it from its directory.

As I said, Convert Lit will convert a LIT file into HTML as well as OEBPF format. To do this for a file called book.lit, you would run the command:

clit book.lit book/

The trailing / is necessary to create the directory, if it doesn't exist already. After executing, the HTML files and e-book files will be found in the book directory.