Install swftools in Ubuntu / Linux

When I Installed swftools version 0.9.0 I got an error saying

make[1]: Entering directory `/home/ubuntu/swftools-0.9.0/swfs'
/bin/bash ../mkinstalldirs /usr/local/share/swftools
/bin/bash ../mkinstalldirs /usr/local/share/swftools/swfs
/usr/bin/install -c -m 644 ./simple_viewer.swf /usr/local/share/swftools/swfs/simple_viewer.swf
/usr/bin/install: cannot stat `./simple_viewer.swf': No such file or directory
make[1]: *** [install] Error 1
make[1]: Leaving directory `/home/ubuntu/swftools-0.9.0/swfs'
make: *** [install] Error 2

So I tried the version 0.9.1 and its done for me,

The Steps I followed is given below

Get necessary libraries and extract

  $ wget http://swftools.org/swftools-0.9.1.tar.gz
  $ tar -zvxf swftools-0.9.1.tar.gz
  $ wget http://www.ijg.org/files/jpegsrc.v7.tar.gz
  $ tar -zvxf jpegsrc.v7.tar.gz
  $ wget http://download.savannah.gnu.org/releases-noredirect/freetype/freetype-2.3.12.tar.gz
  $ tar -zvxf freetype-2.3.12.tar.gz

Now order of installation. First we install jpeg:

  $ cd jpegsrc.v7
  $ sudo ./configure
  $ sudo make
  $ sudo make install

Freetype is a little trickier. For installation you have to reset cache, set flags, run ranlib (not sure why but it wouldnโ€™t work for me without this, if you know Iโ€™d love the explanation)

  $ cd freetype-2.3.12
  $ rm -f config.cache 
  $ sudo ranlib /usr/local/lib/libjpeg.a
  $ sudo ldconfig /usr/local/lib
  $ sudo LDFLAGS="-L/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure
  $ sudo make
  $ sudo make install

If you want to be able to convert pdf files into text you have to install xpdf. Fortunately aptitude does provide us with the right libraries this time.

$ sudo apt-get install xpdf-reader

And now for the final step

  $ cd swftools-0.9.1
  $ sudo LDFLAGS="-L/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure
  $ sudo make
  $ sudo make install

References:
https://designbye.wordpress.com/2010/02/23/installing-swftools-and-pdf2swf-on-ubuntu-linux/