Tuesday 22 October 2013

Building mupdf on CentOs

So you want to know how to compile MuPDF on CentOs, ScientificLinux or Redhat? Let's jump in!

Setup

  1. log in as root or otherwise set the right permissions and use 'sudo' for make install
  2. run yum install libtool
  3. run mkdir mupdf ; cd mupdf
  4. run wget http://mupdf.googlecode.com/files/mupdf-1.1-source.tar.gz
  5. run wget http://mupdf.googlecode.com/files/mupdf-thirdparty-2012-08-14.zip
  6. run unzip -a mupdf-thirdparty-2012-08-14.zip use -a or you will have ^M issues
  7. run tar -xvf mupdf-1.1-source.tar.gz

Compile Third party libs

# cd thirdparty/freetype-2.4.10
# chmod -R 775 *
# sh autogen.sh
# ./configure
# make; make install

# cd thirdparty/jbig2dec
# chmod -R 775 *
# sh autogen.sh
# ./configure
# make; make install

# cd thirdparty/jpeg-9
# chmod -R 775 *
# ./configure
# make; make install

# cd thirdparty/openjpeg-1.5.0-patched
# chmod -R 775 *
# ./configure
# make; make install

# cd thirdparty/zlib-1.2.7
# chmod -R 775 *
# ./configure
# make; make install


Patch and Compile main mupdf source

  • yum install fontconfig fontconfig-devel freetype freetype-devel
  • yum install libX11 libX11-devel libXext libXext-devel
  • cp /usr/local/lib/* /usr/lib/
  • if something doesnt work try to yum install libtools-devel and run ldconfig
  • run ldconfig
  • Next:
    # cd mupdf/mupdf-1.1-source
    # chown -R root.root *
    # chmod -R 775 *
    # make; make install
    

Notes

  • If the directories are different (i.e. /usr/bin and not /usr/local/bin ) then ln -s mudraw, mupdf and mubusy to the correct dir and dont forget the man pages in /usr/local/share/man/man1

Updates

  • [2015-10-09] MuPDF is up to version 1.7a and it may or may not need the third-party  libs. Check out the download directory here.

1 comment: