You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pylucene-dev@lucene.apache.org by Andi Vajda <va...@apache.org> on 2009/10/14 03:02:51 UTC
[ANNOUNCE] Apache PyLucene 2.9.0
I am pleased to announce the availability of Apache PyLucene 2.9.0.
Apache PyLucene, a subproject of Apache Lucene, is a Python extension for
accessing Java Lucene. Its goal is to allow you to use Lucene's text
indexing and searching capabilities from Python. It is API compatible with
the latest version of Java Lucene, 2.9.0.
This release contains a number of bug fixes and improvements. Details can be
found in the changes files:
http://svn.apache.org/repos/asf/lucene/pylucene/tags/pylucene_2_9_0/CHANGES
http://svn.apache.org/repos/asf/lucene/pylucene/tags/pylucene_2_9_0/jcc/CHANGES
Apache PyLucene 2.9.0 is available from the following download page:
http://www.apache.org/dyn/closer.cgi/lucene/pylucene/pylucene-2.9.0-1-src.tar.gz
When downloading from a mirror site, please remember to verify the downloads
using signatures found on the Apache site:
http://www.apache.org/dist/lucene/pylucene/KEYS
For more information on Apache PyLucene, visit the project home page:
http://lucene.apache.org/pylucene
Andi..
Re: [ANNOUNCE] Apache PyLucene 2.9.0
Posted by Andi Vajda <va...@apache.org>.
On Thu, 15 Oct 2009, Christian Heimes wrote:
> Andi Vajda wrote:
>> Hmm, that's an idea...
>>
>> It is my understanding that for a package to 'work' in PyPI it needs to have
>> some setup.py support, right ? JCC, for example, is already on PyPI since
>> it's entirely built with setup.py.
>>
>> PyLucene, on the other hand, does not have a setup.py file, it relies on JCC
>> and 'make' to provide this functionality. If JCC became a
>> distutils/setuptools 'compiler', using setup.py to do a PyLucene build might
>> become easier.
>
> As far as I know -- and I'm pretty sure -- PyPI doesn't enforce any
> rules how a package is installed. As long as its related to Python it's
> just fine. Setup.py is the canonical way to install Python packages but
> I know of no rule that forbids Makefile based installation routines. The
> current build system could be improved but it's not a show stopper for
> PyPI.
>
>> Even in a distribution that included binaries, setup.py would be needed to
>> install them. For Windows binaries this would be most welcome for many
>> reasons. For other systems, in particular those where the path to the libjcc
>> shared library (shared mode) is linked into the executables depending on
>> it (using -rpath or -R), such a binary install might become more
>> problematic.
>
> 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. Just Windows is a pain in the ....
Agreed.
> I had to install Python 2.4 + 2.5 + 2.6, setuptools for every Python
> version, JDK, ant, MSys, MinGW, svn command line tools, VS 7.1 and VS
> 9.0 just to build the binaries. My build.bat sets several environment
> variables and some of the are really tricky, for example backslashes
> don't work for the Apache Ant path as argument for make.
Ugh :)
>> But maybe I'm misunderstanding how this works. Do you already have
>> easy_install'able binary distributions for PyLucene on Windows ?
>> With setup.py ?
>>
>> If so, are they dependent on another binary distribution of JCC itself which
>> PyLucene depends on but includes in its sources ? I'd imagine that in a PyPI
>> distribution scenario, PyLucene would _not_ include JCC but would list it as
>> a dependency instead.
>>
>> As a matter of fact, we could experiment with this right away with JCC since
>> it is already listed on PyPI (in source only).
>> What do I need to do to give you upload permissions ? What's your account on
>> PyPI ?
>
> I haven't tried to install my packages with easy install yet. I'll do so
> tomorrow. I believe that it should just work, though. For now users
> would have to install JCC first because JCC isn't listed as dependency
> for PyLucene or any other distribution created with JCC. Also it
> wouldn't be possible to create new packages with the easy installed JCC
> because the config files reflects my local settings. I guess most people
> can either live with the fact or build JCC on their own.
Well, building JCC on Windows is half the problems of what people report on
this list. They forget to set the PATH to include the required DLLs, don't
know how to operate a C compiler, etc... etc..
It's true that getting rid of the cygwin/msys requirement on Windows just to
operate PyLucene's Makefile would be a vast improvement. That Makefile used
to be quite fancy(!) in the gcj days but now it just builds jars by calling
ant and invokes JCC which does the rest. Both things could be ported to
something else on Windows or provided by a binary package as you suggest.
> I like to provide wininst installer (.exe files), too. It looks like JCC
> already supports bdist_wininst but PyLucene's Makefiles doesn't expose it.
A patch surfacing this would be welcome.
> My account name on PyPI is 'tiran'. The maintainer role should be
> sufficient to upload new files. Are you creating the pylucene package?
At this point, I'm more inclined to just say "go for it" since you're
creating a Windows specific package for PyPI users. I have no objections to
your creating and owning a pylucene-windows package or somesuch on PyPI that
serves as a vehicle for distributing PyLucene Windows binaries. This would
be a welcome development, this is open source at its best :)
If, in addition, you'd like to also provide JCC binaries for Windows - since
you've already built them - and since they're easy to upload with setup.py
bdist upload (provided nothing is left out, such as jcc.dll) - let me know
and I'll give you the privileges for the existing JCC PyPI project.
It's been my itch for a while to extend distutils/setuptools to make JCC a
'compiler' there so that a vanilla setup.py could be used to build PyLucene.
The Makefile would then ultimately disappear.
I just don't get warm fuzzies about investing time in the setuptools space
right now.
Bill, could you please expand a bit on that red flag you just alluded to
for those of us who don't follow the distutils list.
Currently, there are two reasons I use setuptools over distutils with JCC:
- Python 2.3 support (admittedly, not so relevant anymore)
- Library support for shared mode (with a patch for Linux) (not supported
on Solaris at all). As long as distutils isn't capable of building a
plain shared library (as opposed to a python extension shared library)
I'm stuck with setuptools for shared mode.
One can of course use distutils over setuptools if they don't care about
shared mode and run Python 2.x with x > 3.
This issue of setuptools vs distutils is also somewhat holding up the port
of JCC to Python 3.x as setuptools hadn't been ported to Python 3.x last I
checked a few months ago. Rumors were at the time that this port was
unlikely.
> Apropos Windows, a ZIP file that already contains a svn export of lucene
> and all jars (make jars) would spare Windows users some pain. They
> wouldn't have to install a tool to extract tar.gz as well as Apache Ant
> and a svn command line interface. The rest of the build process could be
> automated with a small Python script, too, and spare users the
> installation of MSys or Cygwin.
Definitely, a binary release should include all this. As for the source
release including jar files, the Makefile could try to get them from the
Apache Lucene download sites but there still is the problem of the PyLucene
java files, the ones that implement extensions (in the java dir tree). They
would still need to be built. At least, svn would no longer be required, but
curl/wget would.
Andi..
Re: [ANNOUNCE] Apache PyLucene 2.9.0
Posted by Bill Janssen <ja...@parc.com>.
Christian Heimes <li...@cheimes.de> wrote:
> I know of no rule that forbids Makefile based installation routines.
I include a Makefile with the ssl module, for instance.
And easy_install hooks aren't a requirement; in fact, I consider a
connection to setuptools a red flag (folks following the distutils
mailing list will know why).
Bill
Re: finding Java on Linux
Posted by Andi Vajda <va...@apache.org>.
On Thu, 15 Oct 2009, Bill Janssen wrote:
> Andi Vajda <va...@apache.org> wrote:
>
>> I was making suggestions in the context of simplifying the common
>> case: PyLucene users don't care (they're Python users first) what Java
>> version they use or have and just want it to work (tm). They're happy
>> to just have one version of Java installed and put it on their PATH. I
>> could be wrong, of course with 'happy', of course.
>
> Will gcj support PyLucene these days? If so, you're fine.
I doubt it. Just including the headers fails.
Also, supporting gcj via JNI would make me cringe since it has a much better
C++ interface into Java. It would need custom code to take advantage of it.
Does gcj have a future, is it worth the effort ?
> If not, the Java-ignorant folks you're postulating will be receiving a
> package that will be broken more often than not
No, only on RedHat, and they're moving to OpenJDK like everyone else.
> and will have a hard
> time understanding why that's the case. Wouldn't you rather have
> something that works more often than not?
The error message would clearly state that they're using a version of Java
that is not supported. I don't understand why they couldn't understand it.
> Maybe the state of Java-on-Linux is quite different by now. I worked
> all this out a couple of years ago, when all my Linux users kept
> tripping over the default Java being gcj.
It's still common on RedHat. On other distros, either Sun JDK or OpenJDK is
there. I just hit that on Fedora Core 11.
Andi..
Re: finding Java on Linux
Posted by Bill Janssen <ja...@parc.com>.
Andi Vajda <va...@apache.org> wrote:
> I was making suggestions in the context of simplifying the common
> case: PyLucene users don't care (they're Python users first) what Java
> version they use or have and just want it to work (tm). They're happy
> to just have one version of Java installed and put it on their PATH. I
> could be wrong, of course with 'happy', of course.
Will gcj support PyLucene these days? If so, you're fine.
If not, the Java-ignorant folks you're postulating will be receiving a
package that will be broken more often than not, and will have a hard
time understanding why that's the case. Wouldn't you rather have
something that works more often than not?
Maybe the state of Java-on-Linux is quite different by now. I worked
all this out a couple of years ago, when all my Linux users kept
tripping over the default Java being gcj.
Bill
Re: finding Java on Linux
Posted by Andi Vajda <va...@apache.org>.
On Oct 15, 2009, at 9:40, Bill Janssen <ja...@parc.com> wrote:
> Andi Vajda <va...@apache.org> wrote:
>
>> Emit an error message that says "sorry, gcj is not supported, please
>> use OpenJDK or Sun JDK" and abort.
>
> Right. That's the problem, as I see it. If you have Sun Java
> installed, it's not necessarily first on your path. But you want to
> find it, even if it's masked by gcj. You don't want to abort.
This goes beyond what I had in mind.
The case where you want to use a Java not on the PATH is advanced
enough for either your scripts to handle or the manual edits in
setup.py and Makefile required today.
I was making suggestions in the context of simplifying the common
case: PyLucene users don't care (they're Python users first) what Java
version they use or have and just want it to work (tm). They're happy
to just have one version of Java installed and put it on their PATH. I
could be wrong, of course with 'happy', of course.
Andi..
>
>
>> JAVA_HOME is returned by System.getProperty('java.home'). Java should
>> know best. If you can build and run that class, it means you have a
>> JDK and you can now ask it to tell you about itself.
>
> Right. Now, suppose it tells you it's not the right Java, not a Java
> that will allow you to use it. What next? I don't see a good
> alternative to having some script that has a number of likely search
> paths in it, and which searches each possible location until it
> finds a
> suitable Java. In which case, using Java to find "java.home" isn't
> much
> use -- you're already looking in some specific spot. Might as well
> use
> the locate db to find all instances of javac, and search each
> directory
> you find there.
>
> Bill
Re: finding Java on Linux
Posted by Bill Janssen <ja...@parc.com>.
Andi Vajda <va...@apache.org> wrote:
> Emit an error message that says "sorry, gcj is not supported, please
> use OpenJDK or Sun JDK" and abort.
Right. That's the problem, as I see it. If you have Sun Java
installed, it's not necessarily first on your path. But you want to
find it, even if it's masked by gcj. You don't want to abort.
> JAVA_HOME is returned by System.getProperty('java.home'). Java should
> know best. If you can build and run that class, it means you have a
> JDK and you can now ask it to tell you about itself.
Right. Now, suppose it tells you it's not the right Java, not a Java
that will allow you to use it. What next? I don't see a good
alternative to having some script that has a number of likely search
paths in it, and which searches each possible location until it finds a
suitable Java. In which case, using Java to find "java.home" isn't much
use -- you're already looking in some specific spot. Might as well use
the locate db to find all instances of javac, and search each directory
you find there.
Bill
Re: finding Java on Linux
Posted by Andi Vajda <va...@apache.org>.
On Wed, 14 Oct 2009, Bill Janssen wrote:
> Andi Vajda <va...@apache.org> wrote:
>
>> On Wed, 14 Oct 2009, Bill Janssen wrote:
>>
>>> Andi Vajda <va...@apache.org> wrote:
>>>
>>>> The same approach could be used for figuring out the Java stuff. Have
>>>> a small class running in Java tell us.
>>>
>>> You would think, wouldn't you? But then you'll often end up with gcj.
>>
>> And it would tell you by looking at System.getProperties(), no ?
>
> Sure. But what do you do then?
Emit an error message that says "sorry, gcj is not supported, please use
OpenJDK or Sun JDK" and abort.
>>> The JDK/JRE distinction is another killer.
>>
>> Indeed but then trying to compile that small class would fail telling
>> us that there is no JDK.
>
> Maybe I'm just dense, but my requirements may be more extreme than
> PyLucene's. I need "jar", "keytool" and "jarsigner", too.
So, if these things are in the JDK, then so is javac and building this small
class works. If javac is not there, no JDK is there and the build aborts.
If someone has a doctored Java install, with javac but not these other
tools, they're on their own.
> Here's the fragment of UpLib's configure.in I use for Java configuation:
>
> # it would be nice to know where JAVA_HOME is
JAVA_HOME is returned by System.getProperty('java.home'). Java should know
best. If you can build and run that class, it means you have a JDK and you
can now ask it to tell you about itself.
Andi..
>
> AC_ARG_WITH(javahome, [ --with-javahome=JAVA_HOME_PATH], java_home=$with_javahome, java_home="")
> if test "x$java_home" != "x"; then
> AC_MSG_CHECKING(JAVA_HOME value)
> if test -d "$java_home"; then
> JAVAHOME=$java_home
> AC_SUBST(JAVAHOME)
> AC_MSG_RESULT([$JAVAHOME])
> else
> AC_MSG_ERROR([Invalid non-directory value specified for --with-javahome])
> fi
> fi
> if test "x$JAVAHOME" = "x"; then
> if test "$OS_TARGET" = "Linux"; then
> AC_MSG_CHECKING(for JAVA_HOME)
> JAVAHOME=`$PYTHON unix/linux/figure-linux-java.py`
> if test "$JAVAHOME" != ""; then
> AC_MSG_RESULT($JAVAHOME)
> else
> AC_MSG_ERROR(No java installation found on this machine.)
> fi
> elif test "$OS_TARGET" = "Darwin"; then
> if test -x /usr/libexec/java_home; then
> JAVAHOME=`/usr/libexec/java_home -v 1.5`
> else
> JAVAHOME=/Library/Java/Home
> fi
> elif test "$OS_TARGET" = "win32"; then
> AC_MSG_CHECKING(for JAVA_HOME)
> JAVAHOME=`"$PYTHON" win32/find-javahome.py`
> if test "$JAVAHOME" != ""; then
> AC_MSG_RESULT($JAVAHOME)
> else
> AC_MSG_ERROR(No java installation found on this machine.)
> fi
> else
> AC_PATH_PROG(JAVAC, "javac")
> AC_PATH_PROG(JAVA, "java")
> if test "x$JAVAC" = "x" -o "x$JAVA" = "x"; then
> AC_ERROR([No value for Java home, and either "java" or "javac" can't be found on the path.])
> fi
> AC_MSG_CHECKING(for JAVA_HOME)
> result=`["$JAVAC" -classpath ./java ./java/testProperty.java; "$JAVA" -classpath ./java testProperty home.java]`
> if test -d "$result"; then
> JAVAHOME=$result
> AC_MSG_RESULT([$JAVAHOME])
> else
> AC_MSG_ERROR([Can't find JAVA_HOME; use --with-javahome=PATH to specify the path for JAVA_HOME])
> fi
> fi
> fi
> AC_PATH_PROG(JAVA, "java", , [ "$JAVAHOME/jre/bin" "$JAVAHOME/bin" $PATH ])
> AC_PATH_PROG(JAVAC, "javac", , [ "$JAVAHOME/bin" $PATH ])
> AC_PATH_PROG(JAR, "jar", , [ "$JAVAHOME/bin" $PATH ])
> AC_PATH_PROG(KEYTOOL, "keytool", , [ "$JAVAHOME/jre/bin" "$JAVAHOME/bin" $PATH ])
> AC_PATH_PROG(JARSIGNER, "jarsigner", , [ "$JAVAHOME/jre/bin" "$JAVAHOME/bin" $PATH ])
>
> # what version of java?
> java_version=`"$JAVA" -version 2>&1 | head -1 | sed -e 's/java version //g' -e 's/"//g'`
> AC_SUBST(JAVA_MAJOR_VERSION)
> AC_SUBST(JAVA_MINOR_VERSION)
> AC_SUBST(JAVA_MICRO_VERSION)
> AC_MSG_RESULT([looking at Java version $java_version...])
> JAVA_MAJOR_VERSION=[`"$PYTHON" -c "\
> import sys, re
> print re.split('[\.\_]', '$java_version')[0]"`]
> JAVA_MINOR_VERSION=[`"$PYTHON" -c "\
> import sys, re
> print re.split('[\.\_]', '$java_version')[1]"`]
> JAVA_MICRO_VERSION=[`"$PYTHON" -c "\
> import sys, re
> print re.split('[\.\_]', '$java_version')[2]"`]
> JAVA_BUILD_VERSION=[`"$PYTHON" -c "\
> import sys, re
> splits=re.split('[\.\_]', '$java_version')
> print ((len(splits) > 3) and splits[3]) or 5"`]
> AC_SUBST(JAVA_HOTSPOT_FLAGS)
> JAVA_HOTSPOT_FLAGS=""
> if test $JAVA_MAJOR_VERSION -eq 1 -a $JAVA_MINOR_VERSION -eq 6 -a $JAVA_MICRO_VERSION -eq 0 -a $JAVA_BUILD_VERSION -gt 3 -a $JAVA_BUILD_VERSION -lt 11 ; then
> JAVA_HOTSPOT_FLAGS="-Xint"
> AC_MSG_RESULT([This version of Java ($java_version) contains a Hotspot bug which causes corrupt Lucene indices. JIT compilation will be disabled.])
> fi
> AC_SUBST(JAVA_COMPAT_FLAG)
> AC_SUBST(JAVA_HAS_COOKIE_HANDLING)
> JAVA_COMPAT_FLAG=""
> JAVA_HAS_COOKIE_HANDLING=yes
> if test $JAVA_MAJOR_VERSION -ge 1 -a $JAVA_MINOR_VERSION -gt 4 ; then
> if test "$need1dot4" = "yes" ; then
> JAVA_COMPAT_FLAG="-source 1.4 -target 1.4"
> JAVA_HAS_COOKIE_HANDLING=no
> AC_MSG_RESULT(Java version is $java_version; using JAVA_COMPAT_FLAG of "$JAVA_COMPAT_FLAG")
> else
> AC_MSG_RESULT(Java version is $java_version; no JAVA_COMPAT_FLAG needed)
> fi
> elif test $JAVA_MAJOR_VERSION -eq 1 -a $JAVA_MINOR_VERSION -lt 4; then
> AC_MSG_ERROR(Java version is $java_version; we need at least 1.4.2.)
> elif test $JAVA_MAJOR_VERSION -eq 1 -a $JAVA_MINOR_VERSION -eq 4 -a $JAVA_MICRO_VERSION -lt 2; then
> AC_MSG_ERROR(Java version is $java_version; we need at least 1.4.2.)
> else
> if test $JAVA_MINOR_VERSION -lt 5; then
> JAVA_HAS_COOKIE_HANDLING=no
> fi
> AC_MSG_RESULT(Java version is $java_version; no JAVA_COMPAT_FLAG needed)
> fi
> if test "$JAVA_HAS_COOKIE_HANDLING" = "no"; then
> AC_MSG_RESULT([No cookie handling in Java clients; password must be passed on each call])
> fi
>
> # check for Java debug flags
> AC_MSG_CHECKING(for Java debug)
> AC_ARG_ENABLE(java-debug, [ --enable-java-debug], JAVADEBUGFLAGS="$enableval", JAVADEBUGFLAGS="-g")
> AC_SUBST(JAVADEBUGFLAGS)
> if test "$JAVADEBUGFLAGS" = "no"; then
> AC_MSG_RESULT(no)
> JAVADEBUGFLAGS=""
> elif test "$JAVADEBUGFLAGS" = "yes"; then
> JAVADEBUGFLAGS="-g"
> AC_MSG_RESULT(yes: $JAVADEBUGFLAGS)
> else
> if test $JAVA_MAJOR_VERSION -eq 1 -a $JAVA_MINOR_VERSION -eq 4; then
> JAVADEBUGFLAGS="$JAVADEBUGFLAGS -deprecation"
> fi
> AC_MSG_RESULT(yes: $JAVADEBUGFLAGS)
> fi
>
> AC_MSG_CHECKING(for Java classpath separator character)
> AC_SUBST(JAVACLASSPATHSEP)
> if test "$OS_TARGET" = "win32"; then
> JAVACLASSPATHSEP=";"
> else
> JAVACLASSPATHSEP=":"
> fi
> AC_MSG_RESULT($JAVACLASSPATHSEP)
>
Re: finding Java on Linux
Posted by Bill Janssen <ja...@parc.com>.
Andi Vajda <va...@apache.org> wrote:
> On Wed, 14 Oct 2009, Bill Janssen wrote:
>
> > Andi Vajda <va...@apache.org> wrote:
> >
> >> The same approach could be used for figuring out the Java stuff. Have
> >> a small class running in Java tell us.
> >
> > You would think, wouldn't you? But then you'll often end up with gcj.
>
> And it would tell you by looking at System.getProperties(), no ?
Sure. But what do you do then?
> > The JDK/JRE distinction is another killer.
>
> Indeed but then trying to compile that small class would fail telling
> us that there is no JDK.
Maybe I'm just dense, but my requirements may be more extreme than
PyLucene's. I need "jar", "keytool" and "jarsigner", too.
Here's the fragment of UpLib's configure.in I use for Java configuation:
# it would be nice to know where JAVA_HOME is
AC_ARG_WITH(javahome, [ --with-javahome=JAVA_HOME_PATH], java_home=$with_javahome, java_home="")
if test "x$java_home" != "x"; then
AC_MSG_CHECKING(JAVA_HOME value)
if test -d "$java_home"; then
JAVAHOME=$java_home
AC_SUBST(JAVAHOME)
AC_MSG_RESULT([$JAVAHOME])
else
AC_MSG_ERROR([Invalid non-directory value specified for --with-javahome])
fi
fi
if test "x$JAVAHOME" = "x"; then
if test "$OS_TARGET" = "Linux"; then
AC_MSG_CHECKING(for JAVA_HOME)
JAVAHOME=`$PYTHON unix/linux/figure-linux-java.py`
if test "$JAVAHOME" != ""; then
AC_MSG_RESULT($JAVAHOME)
else
AC_MSG_ERROR(No java installation found on this machine.)
fi
elif test "$OS_TARGET" = "Darwin"; then
if test -x /usr/libexec/java_home; then
JAVAHOME=`/usr/libexec/java_home -v 1.5`
else
JAVAHOME=/Library/Java/Home
fi
elif test "$OS_TARGET" = "win32"; then
AC_MSG_CHECKING(for JAVA_HOME)
JAVAHOME=`"$PYTHON" win32/find-javahome.py`
if test "$JAVAHOME" != ""; then
AC_MSG_RESULT($JAVAHOME)
else
AC_MSG_ERROR(No java installation found on this machine.)
fi
else
AC_PATH_PROG(JAVAC, "javac")
AC_PATH_PROG(JAVA, "java")
if test "x$JAVAC" = "x" -o "x$JAVA" = "x"; then
AC_ERROR([No value for Java home, and either "java" or "javac" can't be found on the path.])
fi
AC_MSG_CHECKING(for JAVA_HOME)
result=`["$JAVAC" -classpath ./java ./java/testProperty.java; "$JAVA" -classpath ./java testProperty home.java]`
if test -d "$result"; then
JAVAHOME=$result
AC_MSG_RESULT([$JAVAHOME])
else
AC_MSG_ERROR([Can't find JAVA_HOME; use --with-javahome=PATH to specify the path for JAVA_HOME])
fi
fi
fi
AC_PATH_PROG(JAVA, "java", , [ "$JAVAHOME/jre/bin" "$JAVAHOME/bin" $PATH ])
AC_PATH_PROG(JAVAC, "javac", , [ "$JAVAHOME/bin" $PATH ])
AC_PATH_PROG(JAR, "jar", , [ "$JAVAHOME/bin" $PATH ])
AC_PATH_PROG(KEYTOOL, "keytool", , [ "$JAVAHOME/jre/bin" "$JAVAHOME/bin" $PATH ])
AC_PATH_PROG(JARSIGNER, "jarsigner", , [ "$JAVAHOME/jre/bin" "$JAVAHOME/bin" $PATH ])
# what version of java?
java_version=`"$JAVA" -version 2>&1 | head -1 | sed -e 's/java version //g' -e 's/"//g'`
AC_SUBST(JAVA_MAJOR_VERSION)
AC_SUBST(JAVA_MINOR_VERSION)
AC_SUBST(JAVA_MICRO_VERSION)
AC_MSG_RESULT([looking at Java version $java_version...])
JAVA_MAJOR_VERSION=[`"$PYTHON" -c "\
import sys, re
print re.split('[\.\_]', '$java_version')[0]"`]
JAVA_MINOR_VERSION=[`"$PYTHON" -c "\
import sys, re
print re.split('[\.\_]', '$java_version')[1]"`]
JAVA_MICRO_VERSION=[`"$PYTHON" -c "\
import sys, re
print re.split('[\.\_]', '$java_version')[2]"`]
JAVA_BUILD_VERSION=[`"$PYTHON" -c "\
import sys, re
splits=re.split('[\.\_]', '$java_version')
print ((len(splits) > 3) and splits[3]) or 5"`]
AC_SUBST(JAVA_HOTSPOT_FLAGS)
JAVA_HOTSPOT_FLAGS=""
if test $JAVA_MAJOR_VERSION -eq 1 -a $JAVA_MINOR_VERSION -eq 6 -a $JAVA_MICRO_VERSION -eq 0 -a $JAVA_BUILD_VERSION -gt 3 -a $JAVA_BUILD_VERSION -lt 11 ; then
JAVA_HOTSPOT_FLAGS="-Xint"
AC_MSG_RESULT([This version of Java ($java_version) contains a Hotspot bug which causes corrupt Lucene indices. JIT compilation will be disabled.])
fi
AC_SUBST(JAVA_COMPAT_FLAG)
AC_SUBST(JAVA_HAS_COOKIE_HANDLING)
JAVA_COMPAT_FLAG=""
JAVA_HAS_COOKIE_HANDLING=yes
if test $JAVA_MAJOR_VERSION -ge 1 -a $JAVA_MINOR_VERSION -gt 4 ; then
if test "$need1dot4" = "yes" ; then
JAVA_COMPAT_FLAG="-source 1.4 -target 1.4"
JAVA_HAS_COOKIE_HANDLING=no
AC_MSG_RESULT(Java version is $java_version; using JAVA_COMPAT_FLAG of "$JAVA_COMPAT_FLAG")
else
AC_MSG_RESULT(Java version is $java_version; no JAVA_COMPAT_FLAG needed)
fi
elif test $JAVA_MAJOR_VERSION -eq 1 -a $JAVA_MINOR_VERSION -lt 4; then
AC_MSG_ERROR(Java version is $java_version; we need at least 1.4.2.)
elif test $JAVA_MAJOR_VERSION -eq 1 -a $JAVA_MINOR_VERSION -eq 4 -a $JAVA_MICRO_VERSION -lt 2; then
AC_MSG_ERROR(Java version is $java_version; we need at least 1.4.2.)
else
if test $JAVA_MINOR_VERSION -lt 5; then
JAVA_HAS_COOKIE_HANDLING=no
fi
AC_MSG_RESULT(Java version is $java_version; no JAVA_COMPAT_FLAG needed)
fi
if test "$JAVA_HAS_COOKIE_HANDLING" = "no"; then
AC_MSG_RESULT([No cookie handling in Java clients; password must be passed on each call])
fi
# check for Java debug flags
AC_MSG_CHECKING(for Java debug)
AC_ARG_ENABLE(java-debug, [ --enable-java-debug], JAVADEBUGFLAGS="$enableval", JAVADEBUGFLAGS="-g")
AC_SUBST(JAVADEBUGFLAGS)
if test "$JAVADEBUGFLAGS" = "no"; then
AC_MSG_RESULT(no)
JAVADEBUGFLAGS=""
elif test "$JAVADEBUGFLAGS" = "yes"; then
JAVADEBUGFLAGS="-g"
AC_MSG_RESULT(yes: $JAVADEBUGFLAGS)
else
if test $JAVA_MAJOR_VERSION -eq 1 -a $JAVA_MINOR_VERSION -eq 4; then
JAVADEBUGFLAGS="$JAVADEBUGFLAGS -deprecation"
fi
AC_MSG_RESULT(yes: $JAVADEBUGFLAGS)
fi
AC_MSG_CHECKING(for Java classpath separator character)
AC_SUBST(JAVACLASSPATHSEP)
if test "$OS_TARGET" = "win32"; then
JAVACLASSPATHSEP=";"
else
JAVACLASSPATHSEP=":"
fi
AC_MSG_RESULT($JAVACLASSPATHSEP)
Re: finding Java on Linux
Posted by Andi Vajda <va...@apache.org>.
On Wed, 14 Oct 2009, Bill Janssen wrote:
> Andi Vajda <va...@apache.org> wrote:
>
>> The same approach could be used for figuring out the Java stuff. Have
>> a small class running in Java tell us.
>
> You would think, wouldn't you? But then you'll often end up with gcj.
And it would tell you by looking at System.getProperties(), no ?
> The JDK/JRE distinction is another killer.
Indeed but then trying to compile that small class would fail telling us
that there is no JDK.
Andi..
finding Java on Linux
Posted by Bill Janssen <ja...@parc.com>.
Andi Vajda <va...@apache.org> wrote:
> The same approach could be used for figuring out the Java stuff. Have
> a small class running in Java tell us.
You would think, wouldn't you? But then you'll often end up with gcj.
The JDK/JRE distinction is another killer.
> On Linux, every distro has its own, incompatible, way of telling where
> java is. I just experienced this going from Gentoo to Fedora Core 11.
Oh, yeah, I've got another script, figure-linux-java.py, that locates
the Java SDK on Linux boxes. If you're curious, you can pull it out of
one of the UpLib tarballs at http://uplib.parc.com/. (Just updated it
today to handle the latest Ubuntu...)
Bill
Re: [ANNOUNCE] Apache PyLucene 2.9.0
Posted by Andi Vajda <va...@apache.org>.
On Wed, 14 Oct 2009, Bill Janssen wrote:
> 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.
Hey, it looks like we have a budding configure script in the making here :)
Care to go all the way and contribute it ?
I see you're installing the Lucene jars some place. JCC normally copies them
into the lucene egg it creates...
Still, I think that a setup.py based approach would have the benefit of
telling us where Python is since it would be running already. All the logic
to figure out Java location etc... can also be driven from Python, solving
the other half of the problem. The same approach could be used for figuring
out the Java stuff. Have a small class running in Java tell us.
On Linux, every distro has its own, incompatible, way of telling where java
is. I just experienced this going from Gentoo to Fedora Core 11.
Andi..
> -----------------------------------------------------------
>
> # 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
>
Re: [ANNOUNCE] Apache PyLucene 2.9.0
Posted by Bill Janssen <ja...@parc.com>.
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
Re: [ANNOUNCE] Apache PyLucene 2.9.0
Posted by Christian Heimes <li...@cheimes.de>.
Andi Vajda wrote:
> Hmm, that's an idea...
>
> It is my understanding that for a package to 'work' in PyPI it needs to have
> some setup.py support, right ? JCC, for example, is already on PyPI since
> it's entirely built with setup.py.
>
> PyLucene, on the other hand, does not have a setup.py file, it relies on JCC
> and 'make' to provide this functionality. If JCC became a
> distutils/setuptools 'compiler', using setup.py to do a PyLucene build might
> become easier.
As far as I know -- and I'm pretty sure -- PyPI doesn't enforce any
rules how a package is installed. As long as its related to Python it's
just fine. Setup.py is the canonical way to install Python packages but
I know of no rule that forbids Makefile based installation routines. The
current build system could be improved but it's not a show stopper for
PyPI.
> Even in a distribution that included binaries, setup.py would be needed to
> install them. For Windows binaries this would be most welcome for many
> reasons. For other systems, in particular those where the path to the libjcc
> shared library (shared mode) is linked into the executables depending on
> it (using -rpath or -R), such a binary install might become more
> problematic.
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. Just Windows is a pain in the ....
I had to install Python 2.4 + 2.5 + 2.6, setuptools for every Python
version, JDK, ant, MSys, MinGW, svn command line tools, VS 7.1 and VS
9.0 just to build the binaries. My build.bat sets several environment
variables and some of the are really tricky, for example backslashes
don't work for the Apache Ant path as argument for make.
> But maybe I'm misunderstanding how this works. Do you already have
> easy_install'able binary distributions for PyLucene on Windows ?
> With setup.py ?
>
> If so, are they dependent on another binary distribution of JCC itself which
> PyLucene depends on but includes in its sources ? I'd imagine that in a PyPI
> distribution scenario, PyLucene would _not_ include JCC but would list it as
> a dependency instead.
>
> As a matter of fact, we could experiment with this right away with JCC since
> it is already listed on PyPI (in source only).
> What do I need to do to give you upload permissions ? What's your account on
> PyPI ?
I haven't tried to install my packages with easy install yet. I'll do so
tomorrow. I believe that it should just work, though. For now users
would have to install JCC first because JCC isn't listed as dependency
for PyLucene or any other distribution created with JCC. Also it
wouldn't be possible to create new packages with the easy installed JCC
because the config files reflects my local settings. I guess most people
can either live with the fact or build JCC on their own.
I like to provide wininst installer (.exe files), too. It looks like JCC
already supports bdist_wininst but PyLucene's Makefiles doesn't expose it.
My account name on PyPI is 'tiran'. The maintainer role should be
sufficient to upload new files. Are you creating the pylucene package?
Apropos Windows, a ZIP file that already contains a svn export of lucene
and all jars (make jars) would spare Windows users some pain. They
wouldn't have to install a tool to extract tar.gz as well as Apache Ant
and a svn command line interface. The rest of the build process could be
automated with a small Python script, too, and spare users the
installation of MSys or Cygwin.
Christian
Re: [ANNOUNCE] Apache PyLucene 2.9.0
Posted by Andi Vajda <va...@apache.org>.
On Wed, 14 Oct 2009, Christian Heimes wrote:
> Andi Vajda wrote:
>> That's great !
>> I'm not sure what the policy is for posting links to external binaries
>> on the site but if you send these links to the list, at least people
>> would be able to find them.
>
> How about you register "pylucene" on PyPI and give me upload permission?
> You'd be the owner of the package on the package index but I can provide
> the binaries on an official and easy_install-able site.
Hmm, that's an idea...
It is my understanding that for a package to 'work' in PyPI it needs to have
some setup.py support, right ? JCC, for example, is already on PyPI since
it's entirely built with setup.py.
PyLucene, on the other hand, does not have a setup.py file, it relies on JCC
and 'make' to provide this functionality. If JCC became a
distutils/setuptools 'compiler', using setup.py to do a PyLucene build might
become easier.
Even in a distribution that included binaries, setup.py would be needed to
install them. For Windows binaries this would be most welcome for many
reasons. For other systems, in particular those where the path to the libjcc
shared library (shared mode) is linked into the executables depending on
it (using -rpath or -R), such a binary install might become more
problematic.
But maybe I'm misunderstanding how this works. Do you already have
easy_install'able binary distributions for PyLucene on Windows ?
With setup.py ?
If so, are they dependent on another binary distribution of JCC itself which
PyLucene depends on but includes in its sources ? I'd imagine that in a PyPI
distribution scenario, PyLucene would _not_ include JCC but would list it as
a dependency instead.
As a matter of fact, we could experiment with this right away with JCC since
it is already listed on PyPI (in source only).
What do I need to do to give you upload permissions ? What's your account on
PyPI ?
Thanks !
Andi..
Re: [ANNOUNCE] Apache PyLucene 2.9.0
Posted by Christian Heimes <li...@cheimes.de>.
Andi Vajda wrote:
> That's great !
> I'm not sure what the policy is for posting links to external binaries
> on the site but if you send these links to the list, at least people
> would be able to find them.
How about you register "pylucene" on PyPI and give me upload permission?
You'd be the owner of the package on the package index but I can provide
the binaries on an official and easy_install-able site.
Christian
Re: [ANNOUNCE] Apache PyLucene 2.9.0
Posted by Andi Vajda <va...@apache.org>.
On Oct 13, 2009, at 23:46, Christian Heimes <li...@cheimes.de> wrote:
> Andi Vajda wrote:
>> I am pleased to announce the availability of Apache PyLucene 2.9.0.
>
> Thank you very much!
>
> I've created Windows 32bit binaries of JCC and PyLucene 2.9.0 for
> Python
> 2.4, 2.5 and 2.6 build with VS 7.1 and VS 9.0. I'm happy to share them
> with the rest of the world. They should put a stop to all the support
> mails regarding the build process on Windows.
That's great !
I'm not sure what the policy is for posting links to external binaries
on the site but if you send these links to the list, at least people
would be able to find them.
Thanks !
Andi..
>
>
> HTH
> Christian
Re: [ANNOUNCE] Apache PyLucene 2.9.0
Posted by Christian Heimes <li...@cheimes.de>.
Andi Vajda wrote:
> I am pleased to announce the availability of Apache PyLucene 2.9.0.
Thank you very much!
I've created Windows 32bit binaries of JCC and PyLucene 2.9.0 for Python
2.4, 2.5 and 2.6 build with VS 7.1 and VS 9.0. I'm happy to share them
with the rest of the world. They should put a stop to all the support
mails regarding the build process on Windows.
HTH
Christian