[pylucene-dev] PyLucene on Debian Stable (Sarge)

Matthew O'Connor matthew at canonical.org
Thu Feb 2 07:35:56 PST 2006


I got PyLucene 1.9rc1-7 to build and pass all tests on
Debian stable (Sarge).  I had some trouble at first but I
got it to go.  I know others have gotten it to work but I
didn't see any recent success stories in the archives, so I
thought I'd share mine.

To build PyLucene 1.9rc1-7 you need the following packages

    gcj-3.4 (>= 3.4.3-13)
    libgcj5-dev (>= 3.4.3-13)
    swig (>= 1.3.24-1)
    python2.4-dev (>= 2.4.1-2)
    libgcj5 (>= 3.4.3-13)
    python2.4 (>= 2.4.1-2)

The version numbers in the parens are the versions I used
and which were available to me through Sarge.  These
versions are unlikely to change in Sarge unless there are
security patches.

To run PyLucene 1.9rc1-7 (after it is built) you only need
the following packages, which were listed above:

    libgcj5 (>= 3.4.3-13)
    python2.4 (>= 2.4.1-2)

Once you have the listed packages installed you will have to
modify the Makefile.  Find the the "Linux" section and set
the following values:


You may leave the DB, PREFIX_DB, and ANT things commented
out (unless, of course, you want the Berkeley DB stuff.  I
didn't bother with that).

On Line 159 of the Makefile, where CCFLAGS is set for Linux
w/o Debugging, I set it to the following:

    CCFLAGS=-O2 -fPIC -I/usr/lib/gcc/i486-linux/3.4.4/include

That differs from what you'll already see there in that I
added a -I option to point to where some of GCJ's include
files.  Without this I was having issues finding certain
include files.

In Debian gcj 3.4 is invoked by the command "gcj-3.4".  So
we have to update another part of the Makefile which was
assuming the command was just "gcj".  On lines 202 and 203
of the Makefile I set the following:


That is, all I did was append "-3.4" to the gcj and gcjh
commands.  This section of the Makefile sets the GCJ
compiler for operating systems other than FreeBSD.

Now type "make" and everything builds.  To run the tests you
need to use Python 2.4.  In Sarge Python 2.4 is run with the
command "python2.4".  To get the tests to run you'll need to
update the Makefile again.

On lines 792, 795, and 796 change the word "python" to
"python2.4".  Now you should be able to run the tests with
"make test" and have them all pass.  

You should be able to install without any modifications to
the Makefile.  Just "sudo make install".  Remember you'll
need to make sure you're using python2.4 to use PyLucene.
In Debian Stable /usr/bin/python is 2.3 and that won't work.

I've attached my Makefile diff to this email.  I've also
built a Debian package for this.  It's not an official
package, just something quick I put together.  I can put it
somewhere if people are interested but I suppose 1.9 is a
moving target and so it is probably of limited value.

FWIW, I have no experience with Java or Lucene and I've only
done a few small toy things with PyLucene.  It doesn't
segfault, explode, or otherwise appear to malfunction.  So,
WFM, YMMV, etc.


More information about the pylucene-dev mailing list