[pylucene-dev] how to build a PyLucene egg?

Andi Vajda vajda at osafoundation.org
Mon Mar 3 17:58:07 PST 2008


On Mon, 3 Mar 2008, Bill Janssen wrote:

> I'd like to package PyLucene as part of the UpLib distribution for OS
> X, and I'd like to actually build JCC and PyLucene on my machine, then
> put a binary distribution of it into OS X installer.  I see that
> there's a binary for OS X, built by Kapil Thangavelu, on the Web site,
> but I don't see any instructions on how to reproduce that "egg".  I
> don't see anything in the Makefile, either.  What am I missing?
>
> [Later] Ah, "make compile" generates the egg.  May I suggest adding an
> alias so that one may say, "make egg"?

The egg is built if JCC and PyLucene are built with setuptools present. The 
PyLucene and JCC builds attempt to import setuptools and revert to the 
default distutils is setuptools is not available from your python 
installation. Except on Python 2.3.5, where setuptools is required because 
of a missing feature in distutils. (see jcc's setup.py and python.py files).

The problem with distributing JCC and PyLucene binaries is that you need to 
be careful with classpath and shared library path issues.
PyLucene's lucene.CLASSPATH variable is set to point to the lucene jar files 
that it contains as egg resources. The path is absolute but computed at 
runtime from a relative stub (see lucene....egg/lucene/__init__.py).
The shared library path, on the other hand, is baked into the jcc binaries 
via the rpath link flag. Different installs have java in different locations 
(albeit, not the case on mac) and the java shared libs might not get found 
until you workaround the bogus path baked in via LD_LIBRARY_PATH (on Linux) 
and PATH on Windows (or DYLD_LIBRARY_PATH on Mac, but it's not a problem in 
Mac since Apple pre-installs java into a known framework location).

> So, if I distribute the PyLucene egg, do I also need to distribute JCC?
> Is one egg somehow dependent on the other egg?

No, the lucene egg contains all the jcc runtime code that it needs to 
operate. You do not need to ship a separate jcc egg.

Andi..

>
> Bill
> _______________________________________________
> pylucene-dev mailing list
> pylucene-dev at osafoundation.org
> http://lists.osafoundation.org/mailman/listinfo/pylucene-dev
>


More information about the pylucene-dev mailing list