Jan Mikkelsen
2011-Dec-15 01:05 UTC
[Dovecot] Building 2.1.rc1 with cluence, but without libstemmer
Hi, I'm testing out 2.1.rc1, building against clucene 2.3.3.4. Without libstemmber, the build fails because it attempts to include SnowballAnalyzer.h which is not part of "core" clucene. Simple patch below to make dovecot 2.1.rc1 build with clucene but without libstemmer (or textcat). Looking at libstemmer itself, there are multiple versions. The version in clucene is put into libclucene-contribs-lib.so, but that version is older than libstemmer_c, which generates libstemmer.a, tested for in the dovecot 2.1.rc1 configure script. The dovecot code uses SnowballAnalyzer.h as a C++ wrapper around libstemmer. What versions of libstemmer, clucene and libtextcat is dovecot 2.1.rc1 intended to be used against? Is it worth bringing the wrapper class around libstemmer into dovecot to avoid funny dependencies against clucene and so that the -lstemmer test in configure is enough? For reference, I'm building on FreeBSD 9.0-RC3, system gcc. Regards, Jan Mikkelsen. diff -u -d -r dovecot-2.1.rc1/src/plugins/fts-lucene/lucene-wrapper.cc dovecot-2.1.rc1.patched/src/plugins/fts-lucene/lucene-wrapper.cc --- dovecot-2.1.rc1/src/plugins/fts-lucene/lucene-wrapper.cc 2011-11-09 08:45:26.000000000 +1100 +++ dovecot-2.1.rc1.patched/src/plugins/fts-lucene/lucene-wrapper.cc 2011-12-14 23:36:54.319796535 +1100 @@ -23,7 +23,9 @@ #include <CLucene.h> #include <CLucene/util/CLStreams.h> #include <CLucene/search/MultiPhraseQuery.h> +#if defined(HAVE_LUCENE_STEMMER) || defined(HAVE_LUCENE_TEXTCAT) #include "SnowballAnalyzer.h" +#endif /* Lucene's default is 10000. Use it here also.. */ #define MAX_TERMS_PER_DOCUMENT 10000
Timo Sirainen
2011-Dec-20 10:35 UTC
[Dovecot] Building 2.1.rc1 with cluence, but without libstemmer
On Thu, 2011-12-15 at 12:05 +1100, Jan Mikkelsen wrote:> I'm testing out 2.1.rc1, building against clucene 2.3.3.4. > > Without libstemmber, the build fails because it attempts to include SnowballAnalyzer.h which is not part of "core" clucene.It was actually supposed to be distributed with Dovecot, but it got left out from the tarball.> What versions of libstemmer,http://snowball.tartarus.org/ this one.> clucene2.3.3.4> and libtextcat is dovecot 2.1.rc1 intended to be used against?http://www.let.rug.nl/vannoord/TextCat/ probably.. Basically I've just used the libstemmer and libtextcat that are in Debian.> Is it worth bringing the wrapper class around libstemmer into dovecot > to avoid funny dependencies against clucene and so that the -lstemmer > test in configure is enough?I'm hoping for a new CLucene release where I don't need libstemmer anymore.