Christian Heimes <li...@cheimes.de> wrote:

> It makes no sense to offer binaries of an open source Python extension
> except for Windows. Any other important operating system (Linux, Mac,
> *BSD) has the necessary tools already on board or they can be easily
> installed.

Well, building pylucene is pretty complicated.  Here's a script fragment
I use to build it on OS X.  $sitepackages is where to install it, and
$distdir is the prefix of that spot.  The Linux script is similarly
complicated by the difficulty of locating a JDK on Linux, and by the
lib/lib64 split.  The use of setuptools also means that you have to fool
the nagging condescending sanity checks in setuptools by setting things
like PYTHONPATH.

Bill
-----------------------------------------------------------

# we need to know where java is, to build PyLucene
if ( -x /usr/libexec/java_home ) then
   set javahome=`/usr/libexec/java_home -v 1.5+`
else
   set javahome=/Library/Java/Home
endif
# we need to know whether Python supports the -m commandline flag
set moduleflag=`${python} -c "import sys; print (sys.version_info >= (2, 5)) 
and '1' or '0'"`

setenv PYTHONPATH "${sitepackages}"

cd ../pylucene-*/jcc
${python} setup.py install --prefix=${distdir}
cd ..

setenv JAVA_HOME "$javahome"
set jccpath=./jcc/build/lib.*/jcc
setenv PYTHONPATH ${jccpath}:${PYTHONPATH}
set pythonhome=`dirname ${python}`
set pythonhome=`dirname ${pythonhome}`
if ( "${pyversion}" == "2.5" ) then
   set JCCCOMMAND="${python} -m jcc --shared"
else if ( "${pyversion}" == "2.3" ) then
   set 
JCCCOMMAND="${distdir}/lib/python${pyversion}/site-packages/jcc/__init__.py 
--shared"
else
   set JCCCOMMAND="${python} -m jcc.__main__ --shared"
endif
make PREFIX_PYTHON=${pythonhome} ANT=ant PYTHON=${python} JCC="${JCCCOMMAND}" 
NUM_FILES=1
make PREFIX_PYTHON=${pythonhome} ANT=ant PYTHON=${python} JCC="${JCCCOMMAND}" 
NUM_FILES=1 install INSTALL_OPT="--prefix '${distdir}'"
unsetenv PYTHONPATH
install -m 444 build/lucene/lucene-core-*.jar ${distdir}/lib
set lucenejar=${distdir}/lib/lucene-core-*.jar

Reply via email to