Archive for October, 2010

Install GNU PDF library from source

1 Comment

First of all, this post is a clarification of the official GNU PDF library newcomers guide, found here, and a more explicit explanation steps than those found in the INSTALL and README files of the source trunk. There is no intention here to replace, but to better explain the contents of these sources, and I encourage all readers installing the GNU PDF library to refer them.

All GNU PDF library source is managed with the bazaar version control system, so the first step is to install the bzr package. You can install it from source, from a pre-compiled package, or from your preferred repository. For the latter, and assuming a Debian-style system, you can install it by just typing on your terminal (make sure you have enough permissions to run installation of packages):

  1. apt-get install bzr

Answering yes to APT will install the packages and all dependencies needed. Now it is time for retrieving the source:

  1. bzr branch bzr://bzr.sv.gnu.org/pdf/libgnupdf/trunk

Wait a while, and source will be downloaded to ./trunk. Step inside this directory:

  1. cd trunk

The autogen.sh script will do the work, but it depends on the autoconf and libtool packages, so we install them and then we bootstrap the library:

  1. apt-get install autoconf libtool
  2. sh autogen.sh

After some messages from the libtool library the source is ready to configure, but usually some dependencies are not fulfilled at this point: zlib, libgpg-error, libgcrypt, uuid-dev and libcheck. Except libcheck, the rest of the required libraries are available in the Debian/Ubuntu repos:

  1. apt-get install zlib1g-dev libgpg-error-dev libgcrypt11-dev uuid-dev

The GNU PDF library requires the SVN source of libcheck to assure the latest version of this library. Obviously we need the subversion package in our system, and then retrieve sources, configure, compile and install (as root):

  1. apt-get install subversion
  2. cd ~
  3. svn co https://check.svn.sourceforge.net/svnroot/check check
  4. cd check/trunk/
  5. autoreconf -i
  6. ./configure
  7. make
  8. make install

At this point, all GNU PDF library requirements are met, so we go for it:

  1. cd ~/trunk/
  2. ./configure
  3. make
  4. make install

This will install the GNU PDF library in the default location. In most cases, you can see the compiled library objects by issuing:

  1. ls /usr/local/lib

In further posts we’ll explain how to use the generated dynamic library for a first hacking session with some of the actual library features. Hope this helps!

Welcome to PDF — a blog about GNU PDF developing

Add a comment

As some may know, this is the final year of my degree in Facultat d’Informàtica de Barcelona (FIB, UPC). If everything goes as it should (and, believe me, it will), someday in the end of June 2011 I will be a Computer Engineer, Computer Scientist, Computer Science Engineer or put_here_your_favourite_computing_degree_title.

As some others (I guess less) may know, to achieve that one must pass the final degree project or PFC. My PFC will be a one year collaboration with the GNU PDF project. This is a wish I had since I began my studies, and my chance to provide something valuable to the free software community.

This blog is going to be useful to achieve the following:

  • As a log of my work; this way, my director Toni Soto and I will be able to track everything done,
  • To help any other developer who may encounter similar problems to those described here, and
  • To let you know a little more about the GNU PDF project

So, let’s do it, and hope this helps!