Use clucene-core 2.x.
Use our own libtool.
This commit is contained in:
parent
22cbbcfd96
commit
29dcc6bf56
@ -1,4 +1,4 @@
|
||||
# $OpenBSD: Makefile,v 1.137 2012/08/30 14:28:22 ajacoutot Exp $
|
||||
# $OpenBSD: Makefile,v 1.138 2012/08/30 18:42:26 ajacoutot Exp $
|
||||
|
||||
COMMENT-main= MS Exchange groupware suite replacement
|
||||
COMMENT-web= zarafa webaccess frontend and MAPI extensions for PHP
|
||||
@ -7,6 +7,9 @@ PKGNAME= zarafa-${V}
|
||||
PKGNAME-main= zarafa-${V}
|
||||
PKGNAME-web= zarafa-webaccess-${V}
|
||||
|
||||
REVISION-main= 0
|
||||
REVISION-web= 0
|
||||
|
||||
CATEGORIES= mail www productivity
|
||||
|
||||
SHARED_LIBS += common_util 2.0 # .0.0
|
||||
@ -33,54 +36,50 @@ MODPHP_DO_SAMPLE=mapi
|
||||
MESSAGE-main= # empty
|
||||
UNMESSAGE-main= # empty
|
||||
|
||||
BUILD_DEPENDS= textproc/xmlto \
|
||||
net/curl \
|
||||
devel/boost \
|
||||
textproc/clucene
|
||||
BUILD_DEPENDS= textproc/xmlto
|
||||
|
||||
# libcurl is searched by configure but unused
|
||||
BUILD_DEPENDS += net/curl
|
||||
|
||||
WANTLIB += ${MODGETTEXT_WANTLIB}
|
||||
WANTLIB += m pthread stdc++ z vmime
|
||||
WANTLIB += execinfo icudata icui18n icuuc uuid
|
||||
WANTLIB += m pthread stdc++ z vmime execinfo icudata icui18n icuuc uuid
|
||||
WANTLIB += boost_filesystem-mt boost_system-mt
|
||||
|
||||
WANTLIB-main += ${WANTLIB} ${MODPY_WANTLIB}
|
||||
WANTLIB-main += asn1 boost_filesystem-mt boost_system-mt c com_err
|
||||
WANTLIB-main += crypto gssapi ical icalss krb5 lber ldap mysqlclient
|
||||
WANTLIB-main += ncursesw sasl2 ssl util uuid xml2 kyotocabinet
|
||||
WANTLIB-main += asn1 c com_err crypto gssapi ical icalss krb5 lber-2.4 ldap-2.4
|
||||
WANTLIB-main += mysqlclient ncursesw sasl2 ssl util uuid xml2 kyotocabinet
|
||||
WANTLIB-main += clucene-core clucene-shared
|
||||
|
||||
RUN_DEPENDS-main=${MODGETTEXT_RUN_DEPENDS} \
|
||||
${MODPY_RUN_DEPENDS} \
|
||||
textproc/catdoc
|
||||
LIB_DEPENDS-main= ${MODGETTEXT_LIB_DEPENDS} \
|
||||
textproc/libxml \
|
||||
databases/kyotocabinet \
|
||||
databases/mysql \
|
||||
databases/openldap \
|
||||
devel/uuid \
|
||||
devel/boost \
|
||||
devel/libexecinfo \
|
||||
devel/libvmime>=0.9.2p1 \
|
||||
textproc/libical \
|
||||
devel/uuid \
|
||||
textproc/clucene>=2.3.3.4 \
|
||||
textproc/icu4c \
|
||||
devel/boost
|
||||
textproc/libical \
|
||||
textproc/libxml
|
||||
|
||||
WANTLIB-web += ${WANTLIB}
|
||||
WANTLIB-web += boost_filesystem-mt boost_system-mt common_mapi common_util
|
||||
WANTLIB-web += freebusy ical icalmapi icalss inetmapi mapi
|
||||
WANTLIB-web += common_util freebusy ical icalmapi icalss inetmapi mapi
|
||||
WANTLIB-web += common_mapi
|
||||
|
||||
LIB_DEPENDS-web= ${BASE_PKGPATH}>=${V}
|
||||
RUN_DEPENDS-web= ${MODPHP_RUN_DEPENDS} \
|
||||
${MODGETTEXT_RUN_DEPENDS}
|
||||
|
||||
# XXX ../../common/.libs/libcommon_mapi.so.1.0: undefined reference to
|
||||
# `MAPILogonEx', `zarafa_dcgettext_wide' (and more)
|
||||
# see patch-provider_server_Makefile_in
|
||||
# patch-ECtools_zarafa-cfgchecker_Makefile_in
|
||||
# patch-ECtools_zarafa-cfgchecker_Makefile_in
|
||||
USE_LIBTOOL= gnu
|
||||
LIBTOOL_FLAGS= --tag=disable-static
|
||||
|
||||
USE_LIBTOOL= yes
|
||||
USE_GMAKE= Yes
|
||||
USE_GROFF = Yes
|
||||
|
||||
LIBTOOL_FLAGS= --tag=disable-static
|
||||
|
||||
MODPY_ADJ_FILES=tools/python-scripts/optimize-imap.py \
|
||||
tools/python-scripts/update-resource-recipients \
|
||||
installer/linux/zarafa7-upgrade \
|
||||
@ -124,6 +123,11 @@ CONFIGURE_ARGS= ${CONFIGURE_SHARED} \
|
||||
# XXX in-tree heimdal does not provide krb5_free_unparsed_name()
|
||||
CONFIGURE_ARGS+= --with-krb5-config=/usr/bin/true
|
||||
|
||||
# force build with clucene >= 2.x
|
||||
CONFIGURE_ENV +=ac_cv_lib_clucene__ZN6lucene5index11IndexReader4openEPKc=yes
|
||||
MAKE_FLAGS += CLUCENE_CFLAGS="$$(pkg-config --cflags libclucene-core)" \
|
||||
CLUCENE_LIBS="$$(pkg-config --libs libclucene-core)"
|
||||
|
||||
FAKE_FLAGS= sysconfdir=${PREFIX}/share/examples \
|
||||
USERSCRIPTDIR=${PREFIX}/share/examples/zarafa/userscripts \
|
||||
QUOTATEMPLATEDIR=${PREFIX}/share/examples/zarafa/quotamail \
|
||||
|
@ -0,0 +1,54 @@
|
||||
$OpenBSD: patch-ECtools_zarafa-search_ECAnalyzers_cpp,v 1.1 2012/08/30 18:42:26 ajacoutot Exp $
|
||||
|
||||
Fix buil with clucene-core >= 2.x
|
||||
|
||||
--- ECtools/zarafa-search/ECAnalyzers.cpp.orig Wed Aug 8 17:14:58 2012
|
||||
+++ ECtools/zarafa-search/ECAnalyzers.cpp Thu Aug 30 16:38:06 2012
|
||||
@@ -78,24 +78,24 @@ EmailFilter::~EmailFilter() {
|
||||
* @param token Output token
|
||||
* @return false if no more token was available
|
||||
*/
|
||||
-bool EmailFilter::next(lucene::analysis::Token *token) {
|
||||
+lucene::analysis::Token *EmailFilter::next(lucene::analysis::Token *token) {
|
||||
// See if we had any stored tokens
|
||||
if(part < parts.size()) {
|
||||
token->set(parts[part].c_str(), 0, 0, _T("<EMAIL>"));
|
||||
token->setPositionIncrement(0);
|
||||
part++;
|
||||
- return true;
|
||||
+ return token;
|
||||
} else {
|
||||
// No more stored token, get a new one
|
||||
if(!input->next(token))
|
||||
- return false;
|
||||
+ return NULL;
|
||||
|
||||
// Split EMAIL tokens into the various parts
|
||||
if(wcscmp(token->type(), L"<EMAIL>") == 0) {
|
||||
// Split into user, domain, com
|
||||
- parts = tokenize((std::wstring)token->_termText, (std::wstring)L".@");
|
||||
+ parts = tokenize((std::wstring)token->termBuffer(), (std::wstring)L".@");
|
||||
// Split into user, domain.com
|
||||
- std::vector<std::wstring> moreparts = tokenize((std::wstring)token->_termText, (std::wstring)L"@");
|
||||
+ std::vector<std::wstring> moreparts = tokenize((std::wstring)token->termBuffer(), (std::wstring)L"@");
|
||||
parts.insert(parts.end(), moreparts.begin(), moreparts.end());
|
||||
|
||||
// Only add parts once (unique parts)
|
||||
@@ -105,7 +105,7 @@ bool EmailFilter::next(lucene::analysis::Token *token)
|
||||
part = 0;
|
||||
}
|
||||
|
||||
- return true;
|
||||
+ return token;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ ECAnalyzer::~ECAnalyzer()
|
||||
* @param reader Reader to read the bytestream to tokenize
|
||||
* @return A TokenStream outputting the tokens to be indexed
|
||||
*/
|
||||
-lucene::analysis::TokenStream* ECAnalyzer::tokenStream(const TCHAR* fieldName, lucene::util::Reader* reader)
|
||||
+lucene::analysis::TokenStream *ECAnalyzer::tokenStream(const TCHAR *fieldName, CL_NS(util)::BufferedReader *reader)
|
||||
{
|
||||
lucene::analysis::TokenStream* ret = _CLNEW lucene::analysis::standard::StandardTokenizer(reader);
|
||||
ret = _CLNEW lucene::analysis::standard::StandardFilter(ret,true);
|
@ -0,0 +1,32 @@
|
||||
$OpenBSD: patch-ECtools_zarafa-search_ECAnalyzers_h,v 1.1 2012/08/30 18:42:26 ajacoutot Exp $
|
||||
|
||||
Fix buil with clucene-core >= 2.x
|
||||
|
||||
--- ECtools/zarafa-search/ECAnalyzers.h.orig Wed Aug 8 17:14:58 2012
|
||||
+++ ECtools/zarafa-search/ECAnalyzers.h Thu Aug 30 16:38:06 2012
|
||||
@@ -50,7 +50,6 @@
|
||||
#ifndef ANALYZERS_H
|
||||
|
||||
#include "CLucene/StdHeader.h"
|
||||
-#include "CLucene/util/Reader.h"
|
||||
#include "CLucene/analysis/standard/StandardAnalyzer.h"
|
||||
#include "CLucene/analysis/AnalysisHeader.h"
|
||||
|
||||
@@ -68,7 +67,7 @@ class EmailFilter: public lucene::analysis::TokenFilte
|
||||
public:
|
||||
EmailFilter(lucene::analysis::TokenStream* in, bool deleteTokenStream);
|
||||
virtual ~EmailFilter();
|
||||
- bool next(lucene::analysis::Token* token);
|
||||
+ lucene::analysis::Token *next(lucene::analysis::Token *token);
|
||||
private:
|
||||
lucene::analysis::Token curtoken;
|
||||
|
||||
@@ -86,7 +85,7 @@ class ECAnalyzer : public lucene::analysis::standard::
|
||||
ECAnalyzer();
|
||||
virtual ~ECAnalyzer();
|
||||
|
||||
- virtual lucene::analysis::TokenStream* tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader);
|
||||
+ virtual lucene::analysis::TokenStream *tokenStream(const TCHAR *fieldName, CL_NS(util)::BufferedReader *reader);
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,24 @@
|
||||
$OpenBSD: patch-ECtools_zarafa-search_ECIndexDB_cpp,v 1.1 2012/08/30 18:42:26 ajacoutot Exp $
|
||||
|
||||
Fix buil with clucene-core >= 2.x
|
||||
|
||||
--- ECtools/zarafa-search/ECIndexDB.cpp.orig Wed Aug 8 17:14:58 2012
|
||||
+++ ECtools/zarafa-search/ECIndexDB.cpp Thu Aug 30 16:38:06 2012
|
||||
@@ -68,7 +68,7 @@
|
||||
#include <string>
|
||||
#include <algorithm>
|
||||
|
||||
-#include <CLucene/util/Reader.h>
|
||||
+#include <CLucene/util/CLStreams.h>
|
||||
|
||||
using namespace kyotocabinet;
|
||||
|
||||
@@ -290,7 +290,7 @@ HRESULT ECIndexDB::AddTerm(folderid_t folder, docid_t
|
||||
unsigned int len;
|
||||
unsigned int keylen;
|
||||
|
||||
- lucene::util::StringReader reader(wstrTerm.c_str());
|
||||
+ CL_NS(util)::StringReader reader(wstrTerm.c_str());
|
||||
|
||||
stream = m_lpAnalyzer->tokenStream(L"", &reader);
|
||||
|
@ -1,10 +1,26 @@
|
||||
$OpenBSD: patch-ECtools_zarafa-search_ECIndexImporterAttachments_cpp,v 1.1 2012/08/30 14:28:22 ajacoutot Exp $
|
||||
$OpenBSD: patch-ECtools_zarafa-search_ECIndexImporterAttachments_cpp,v 1.2 2012/08/30 18:42:26 ajacoutot Exp $
|
||||
|
||||
OpenBSD does not have RLIMIT_AS.
|
||||
|
||||
--- ECtools/zarafa-search/ECIndexImporterAttachments.cpp.orig Mon Aug 27 10:42:56 2012
|
||||
+++ ECtools/zarafa-search/ECIndexImporterAttachments.cpp Mon Aug 27 10:43:07 2012
|
||||
@@ -76,6 +76,10 @@
|
||||
ECIndexImporterAttachments.cpp:249:34: error: 'max' was not declared in this scope
|
||||
ECIndexImporterAttachments.cpp:440:3: error: 'string' was not declared in this scope
|
||||
ECIndexImporterAttachments.cpp:443:4: error: 'set' was not declared in this scope
|
||||
ECIndexImporterAttachments.cpp:602:46: error: 'min' was not declared in this scope
|
||||
|
||||
--- ECtools/zarafa-search/ECIndexImporterAttachments.cpp.orig Thu Aug 30 17:15:54 2012
|
||||
+++ ECtools/zarafa-search/ECIndexImporterAttachments.cpp Thu Aug 30 17:16:04 2012
|
||||
@@ -47,6 +47,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
+#include <algorithm>
|
||||
+#include <set>
|
||||
+#include <string>
|
||||
+
|
||||
#include <platform.h>
|
||||
|
||||
#include <mapi.h>
|
||||
@@ -76,6 +80,10 @@
|
||||
|
||||
#define STREAM_BUFFER ( 64*1024 )
|
||||
|
||||
@ -15,3 +31,80 @@ OpenBSD does not have RLIMIT_AS.
|
||||
ECIndexImporterAttachment::ECIndexImporterAttachment(ECThreadData *lpThreadData, ECIndexImporter *lpIndexer)
|
||||
{
|
||||
m_lpThreadData = lpThreadData;
|
||||
@@ -246,7 +254,7 @@ HRESULT ECIndexImporterAttachment::CopyStreamToParser(
|
||||
ULONG ulWriteData;
|
||||
fd_set rset, wset;
|
||||
int res;
|
||||
- int fd = max(ulFpWrite, ulFpRead);
|
||||
+ int fd = std::max(ulFpWrite, ulFpRead);
|
||||
struct timeval timeout;
|
||||
|
||||
|
||||
@@ -267,7 +275,7 @@ HRESULT ECIndexImporterAttachment::CopyStreamToParser(
|
||||
FD_ZERO(&wset);
|
||||
if (ulTotalWriteData) {
|
||||
FD_SET(ulFpWrite, &wset);
|
||||
- fd = max(ulFpWrite, ulFpRead);
|
||||
+ fd = std::max(ulFpWrite, ulFpRead);
|
||||
} else {
|
||||
fd = ulFpRead;
|
||||
}
|
||||
@@ -437,10 +445,10 @@ HRESULT ECIndexImporterAttachment::ParseValueAttachmen
|
||||
command.assign(m_strCommand + " ");
|
||||
|
||||
if (!strMimeTag.empty() && strMimeTag.compare(_T("application/octet-stream")) != 0) {
|
||||
- string tmp = trim(convert_to<string>(strMimeTag), "\r\n ");
|
||||
+ std::string tmp = trim(convert_to<std::string>(strMimeTag), "\r\n ");
|
||||
size_t pos = tmp.find_first_of('/');
|
||||
if (pos != std::string::npos) {
|
||||
- set<string, stricmp_comparison>::iterator i = m_lpThreadData->m_setMimeFilter.find(string(tmp,0,pos));
|
||||
+ std::set<std::string, stricmp_comparison>::iterator i = m_lpThreadData->m_setMimeFilter.find(std::string(tmp,0,pos));
|
||||
if (i != m_lpThreadData->m_setMimeFilter.end()) {
|
||||
m_lpThreadData->lpLogger->Log(EC_LOGLEVEL_DEBUG, "Skipping filtered attachment mimetype: %s for %ls", tmp.c_str(), strFilename.c_str());
|
||||
hr = MAPI_E_INVALID_OBJECT;
|
||||
@@ -452,8 +460,8 @@ HRESULT ECIndexImporterAttachment::ParseValueAttachmen
|
||||
command.append("'");
|
||||
} else if (!strExtension.empty()) {
|
||||
// this string mostly does not exist
|
||||
- string tmp = trim(convert_to<string>(strExtension), "\r\n ");
|
||||
- set<string, stricmp_comparison>::iterator i = m_lpThreadData->m_setExtFilter.find(string(tmp,1)); // skip dot in extension find
|
||||
+ std::string tmp = trim(convert_to<std::string>(strExtension), "\r\n ");
|
||||
+ std::set<std::string, stricmp_comparison>::iterator i = m_lpThreadData->m_setExtFilter.find(std::string(tmp,1)); // skip dot in extension find
|
||||
if (i != m_lpThreadData->m_setExtFilter.end()) {
|
||||
m_lpThreadData->lpLogger->Log(EC_LOGLEVEL_DEBUG, "Skipping filtered attachment extension: %s for %ls", tmp.c_str(), strFilename.c_str());
|
||||
hr = MAPI_E_INVALID_OBJECT;
|
||||
@@ -463,14 +471,14 @@ HRESULT ECIndexImporterAttachment::ParseValueAttachmen
|
||||
command.append(forcealnum(tmp, "."));
|
||||
command.append("'");
|
||||
} else if (!strFilename.empty()) {
|
||||
- std::string tmp = trim(convert_to<string>(strFilename), "\r\n ");
|
||||
+ std::string tmp = trim(convert_to<std::string>(strFilename), "\r\n ");
|
||||
size_t pos = tmp.find_last_of('.');
|
||||
if (pos == std::string::npos)
|
||||
goto exit;
|
||||
|
||||
|
||||
// skip dot in find
|
||||
- set<string, stricmp_comparison>::iterator i = m_lpThreadData->m_setExtFilter.find(string(tmp, pos+1));
|
||||
+ std::set<std::string, stricmp_comparison>::iterator i = m_lpThreadData->m_setExtFilter.find(std::string(tmp, pos+1));
|
||||
if (i != m_lpThreadData->m_setExtFilter.end()) {
|
||||
m_lpThreadData->lpLogger->Log(EC_LOGLEVEL_DEBUG, "Skipping filtered attachment extension: %ls", strFilename.c_str());
|
||||
hr = MAPI_E_INVALID_OBJECT;
|
||||
@@ -478,7 +486,7 @@ HRESULT ECIndexImporterAttachment::ParseValueAttachmen
|
||||
}
|
||||
|
||||
command.append("ext '");
|
||||
- command.append(forcealnum(string(tmp, pos), "."));
|
||||
+ command.append(forcealnum(std::string(tmp, pos), "."));
|
||||
command.append("'");
|
||||
} else {
|
||||
m_lpThreadData->lpLogger->Log(EC_LOGLEVEL_DEBUG, "Invalid attachment, no mimetag, extension or filename");
|
||||
@@ -599,7 +607,7 @@ HRESULT ECIndexImporterAttachment::ParseAttachment(fol
|
||||
if (ulAttachSize) {
|
||||
/* Copy attachment data into stream */
|
||||
while (TRUE) {
|
||||
- ULONG ulRead = min(m_ulCache, ulAttachSize);
|
||||
+ ULONG ulRead = std::min(m_ulCache, ulAttachSize);
|
||||
ULONG ulCopy = ulRead;
|
||||
ULONG ulWritten = 0;
|
||||
|
||||
|
@ -0,0 +1,23 @@
|
||||
$OpenBSD: patch-ECtools_zarafa-search_ECIndexImporter_cpp,v 1.1 2012/08/30 18:42:26 ajacoutot Exp $
|
||||
|
||||
ECIndexImporter.cpp:400:5: error: 'auto_ptr' was not declared in this scope
|
||||
|
||||
--- ECtools/zarafa-search/ECIndexImporter.cpp.orig Wed Aug 8 17:14:58 2012
|
||||
+++ ECtools/zarafa-search/ECIndexImporter.cpp Thu Aug 30 17:16:04 2012
|
||||
@@ -47,6 +47,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
+#include <memory>
|
||||
#include "platform.h"
|
||||
|
||||
#include "ECIndexImporter.h"
|
||||
@@ -433,7 +434,7 @@ HRESULT ECIndexImporter::ProcessThread()
|
||||
ECIndexDB *lpIndex = NULL;
|
||||
ECIndexDB *lpThisIndex = NULL;
|
||||
ArchiveItem *lpArchiveItem = NULL;
|
||||
- auto_ptr<ArchiveItem> lpStubTarget;
|
||||
+ std::auto_ptr<ArchiveItem> lpStubTarget;
|
||||
|
||||
m_lpLogger->Log(EC_LOGLEVEL_DEBUG, "Importer thread started");
|
||||
|
Loading…
Reference in New Issue
Block a user