Building PyLucene on Ubuntu Edgy

PenguinTV actually has a good search feature, but it’s rarely used because it requires PyLucene, and installing PyLucene is extremely hard. Here’s the HOWTO for Ubuntu Edgy:

  • Make sure you have the following packages installed (may not be enough): gcj, libdb4.4, libdb4.4-dev, libdb4.4-java, libdb4.4-java-dev, libdb4.4-java-gcj
  • download and extract pylucene
  • Also download berkeleydb 4.4.20, and extract it inside the extracted pylucene folder
  • change to db-4.4.20/build_unix
  • run
    ../dist/configure
  • do not make or install db-4.4, it’s not necessary. Pylucene just needs the sources
  • edit Makefile and insert the following:
    PREFIX=/usr
    PREFIX_PYTHON=$(PREFIX)
    LIBDIR_NAME=lib
    GCJ_HOME=/usr
    GCJ_LIBDIR=$(GCJ_HOME)/$(LIBDIR_NAME)
    GCJ_STATIC=0
    DB=$(PYLUCENE)/db-$(DB_VER)
    PREFIX_DB=$(PREFIX)
    ANT=ant
    PYTHON=$(PREFIX_PYTHON)/bin/python
  • Then try running Make and see if it works