From b9bb718041e17bc7538e2893aafb855b6ee50548 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Wed, 29 Apr 2015 10:36:53 -0500 Subject: [PATCH] 3.0.7 --- ...irectory-sync-to-sync-writes-to-disk.patch | 78 +++++++++++++++++++ ...ow-full-lines-to-be-input-to-demo-qu.patch | 25 ++++++ ...ooleanQuery-as-base-for-the-queue-si.patch | 25 ++++++ 0006-Fix-packageconfig-path.patch | 54 +++++++++++++ lucene++-3.0.6-fix_installing_headers.patch | 44 ----------- lucene++-3.0.6-multiarch.patch | 28 ------- lucene++-3.0.6-pc_files_fix.patch | 71 ----------------- lucene++.spec | 22 +++--- 8 files changed, 194 insertions(+), 153 deletions(-) create mode 100644 0001-Fix-FSDirectory-sync-to-sync-writes-to-disk.patch create mode 100644 0002-minor-fix-to-allow-full-lines-to-be-input-to-demo-qu.patch create mode 100644 0005-Use-maxSize-of-BooleanQuery-as-base-for-the-queue-si.patch create mode 100644 0006-Fix-packageconfig-path.patch delete mode 100644 lucene++-3.0.6-fix_installing_headers.patch delete mode 100644 lucene++-3.0.6-multiarch.patch delete mode 100644 lucene++-3.0.6-pc_files_fix.patch diff --git a/0001-Fix-FSDirectory-sync-to-sync-writes-to-disk.patch b/0001-Fix-FSDirectory-sync-to-sync-writes-to-disk.patch new file mode 100644 index 0000000..5da1f92 --- /dev/null +++ b/0001-Fix-FSDirectory-sync-to-sync-writes-to-disk.patch @@ -0,0 +1,78 @@ +From 972c9cb37457c70530610c22a5f3ff68adf3bd5b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Va=CC=81clav=20Slavi=CC=81k?= +Date: Tue, 3 Feb 2015 18:22:25 +0100 +Subject: [PATCH 1/6] Fix FSDirectory::sync() to sync writes to disk + +Contrary to the documentation, FSDirectory::sync() conversion to C++ +omitted the most important line of the Java original: actually fsyncing +the file descriptor. As the result, its current code amounts to little +more than a little nonsensical noop dance. + +Add the missing fsync() call. Use fsync() on Unix, its +FlushFileBuffers() equivalent on Windows, and F_FULLFSYNC on OS X where +fsync() is documented as not always sufficient. F_FULLFSYNC is more +expensive than fsync(), but guarantees physical write; SQLite uses it +too. +--- + src/core/store/FSDirectory.cpp | 25 +++++++++++++++++++++---- + 1 file changed, 21 insertions(+), 4 deletions(-) + +diff --git a/src/core/store/FSDirectory.cpp b/src/core/store/FSDirectory.cpp +index 82b5736..2cb257a 100644 +--- a/src/core/store/FSDirectory.cpp ++++ b/src/core/store/FSDirectory.cpp +@@ -5,7 +5,6 @@ + ///////////////////////////////////////////////////////////////////////////// + + #include "LuceneInc.h" +-#include + #include "FSDirectory.h" + #include "NativeFSLockFactory.h" + #include "SimpleFSDirectory.h" +@@ -14,6 +13,15 @@ + #include "FileUtils.h" + #include "StringUtils.h" + ++#if defined(_WIN32) ++ #include ++#elif defined(__APPLE__) ++ #include ++#else ++ #include ++#endif ++#include ++ + extern "C" + { + #include "../util/md5/md5.h" +@@ -148,15 +156,24 @@ void FSDirectory::sync(const String& name) { + bool success = false; + + for (int32_t retryCount = 0; retryCount < 5; ++retryCount) { +- boost::filesystem::ofstream syncFile; ++ boost::iostreams::file_descriptor syncFile; + try { +- syncFile.open(path, std::ios::binary | std::ios::in | std::ios::out); ++ syncFile.open(boost::filesystem::path(path)); + } catch (...) { + } + + if (syncFile.is_open()) { ++ boost::iostreams::file_descriptor::handle_type fd = syncFile.handle(); ++#if defined(_WIN32) ++ bool ok = ::FlushFileBuffers(fd) != 0; ++#elif defined(__APPLE__) ++ bool ok = fcntl(fd, F_FULLFSYNC) == 0; ++#else ++ bool ok = fsync(fd) == 0; ++#endif + syncFile.close(); +- success = true; ++ if (ok) ++ success = true; + break; + } + +-- +2.3.6 + diff --git a/0002-minor-fix-to-allow-full-lines-to-be-input-to-demo-qu.patch b/0002-minor-fix-to-allow-full-lines-to-be-input-to-demo-qu.patch new file mode 100644 index 0000000..7c4556c --- /dev/null +++ b/0002-minor-fix-to-allow-full-lines-to-be-input-to-demo-qu.patch @@ -0,0 +1,25 @@ +From a02e5b6d422191a3674b13f1becf9c2ec90e83a5 Mon Sep 17 00:00:00 2001 +From: gbjbaanb +Date: Tue, 24 Mar 2015 15:17:28 +0000 +Subject: [PATCH 2/6] minor fix to allow full lines to be input to demo queries + +--- + src/demo/searchfiles/main.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/demo/searchfiles/main.cpp b/src/demo/searchfiles/main.cpp +index de4d303..748003c 100644 +--- a/src/demo/searchfiles/main.cpp ++++ b/src/demo/searchfiles/main.cpp +@@ -265,7 +265,7 @@ int main(int argc, char* argv[]) { + } + } else { + std::wcout << L"Enter query: "; +- std::wcin >> line; ++ getline(std::wcin, line); + } + boost::trim(line); + +-- +2.3.6 + diff --git a/0005-Use-maxSize-of-BooleanQuery-as-base-for-the-queue-si.patch b/0005-Use-maxSize-of-BooleanQuery-as-base-for-the-queue-si.patch new file mode 100644 index 0000000..62d0633 --- /dev/null +++ b/0005-Use-maxSize-of-BooleanQuery-as-base-for-the-queue-si.patch @@ -0,0 +1,25 @@ +From 229f783749283d1ec2bed4593805f7a8458ab819 Mon Sep 17 00:00:00 2001 +From: "Uwe L. Korn" +Date: Mon, 6 Apr 2015 16:48:16 +0200 +Subject: [PATCH 5/6] Use maxSize of BooleanQuery as base for the queue size + +--- + src/core/search/FuzzyQuery.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/core/search/FuzzyQuery.cpp b/src/core/search/FuzzyQuery.cpp +index 5291995..38e1bf2 100644 +--- a/src/core/search/FuzzyQuery.cpp ++++ b/src/core/search/FuzzyQuery.cpp +@@ -83,7 +83,7 @@ QueryPtr FuzzyQuery::rewrite(const IndexReaderPtr& reader) { + } + + int32_t maxSize = BooleanQuery::getMaxClauseCount(); +- ScoreTermQueuePtr stQueue(newLucene(1024)); ++ ScoreTermQueuePtr stQueue(newLucene(maxSize + 1)); + FilteredTermEnumPtr enumerator(getEnum(reader)); + LuceneException finally; + try { +-- +2.3.6 + diff --git a/0006-Fix-packageconfig-path.patch b/0006-Fix-packageconfig-path.patch new file mode 100644 index 0000000..152a098 --- /dev/null +++ b/0006-Fix-packageconfig-path.patch @@ -0,0 +1,54 @@ +From dd6ba769ea8b411d6e09720dfe7f38d027d8f8fc Mon Sep 17 00:00:00 2001 +From: Gianfranco Costamagna +Date: Tue, 28 Apr 2015 09:31:35 +0200 +Subject: [PATCH 6/6] Fix packageconfig path. Rationale: LIB_DESTINATION is set + as CMAKE_INSTALL_FULL_LIBDIR. So repeating "{prefix}" results in a double + usr/usr inclusion + +--- + liblucene++-contrib.pc.cmake | 4 ++-- + liblucene++.pc.cmake | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/liblucene++-contrib.pc.cmake b/liblucene++-contrib.pc.cmake +index 98b6381..21026e0 100644 +--- a/liblucene++-contrib.pc.cmake ++++ b/liblucene++-contrib.pc.cmake +@@ -1,13 +1,13 @@ + prefix=@CMAKE_INSTALL_PREFIX@ + exec_prefix=${prefix}/bin +-libdir=${prefix}/@LIB_DESTINATION@ ++libdir=@LIB_DESTINATION@ + includedir=${prefix}/include/lucene++ + lib=lucene++-contrib + + Name: liblucene++-contrib + Description: Contributions for Lucene++ - a C++ search engine, ported from the popular Apache Lucene + Version: @lucene++_VERSION@ +-Libs: -L${prefix}/@LIB_DESTINATION@ -l${lib} ++Libs: -L@LIB_DESTINATION@ -l${lib} + Cflags: -I${includedir} + Requires: liblucene++ = @lucene++_VERSION@ + +diff --git a/liblucene++.pc.cmake b/liblucene++.pc.cmake +index c526d4a..32d16ad 100644 +--- a/liblucene++.pc.cmake ++++ b/liblucene++.pc.cmake +@@ -1,12 +1,12 @@ + prefix=@CMAKE_INSTALL_PREFIX@ + exec_prefix=${prefix}/bin +-libdir=${prefix}/@LIB_DESTINATION@ ++libdir=@LIB_DESTINATION@ + includedir=${prefix}/include/lucene++ + lib=lucene++ + + Name: liblucene++ + Description: Lucene++ - a C++ search engine, ported from the popular Apache Lucene + Version: @lucene++_VERSION@ +-Libs: -L${prefix}/@LIB_DESTINATION@ -l${lib} ++Libs: -L@LIB_DESTINATION@ -l${lib} + Cflags: -I${includedir} + +-- +2.3.6 + diff --git a/lucene++-3.0.6-fix_installing_headers.patch b/lucene++-3.0.6-fix_installing_headers.patch deleted file mode 100644 index 3f6557f..0000000 --- a/lucene++-3.0.6-fix_installing_headers.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 994f03cf736229044a168835ae7387696041658f Mon Sep 17 00:00:00 2001 -From: rezso -Date: Mon, 19 May 2014 09:20:40 +0100 -Subject: [PATCH] fix installing lucene++ headers in 3.0.6 -Upstream: committed -References: https://github.com/luceneplusplus/LucenePlusPlus/commit/994f03cf736229044a168835ae7387696041658f - ---- - CMakeLists.txt | 8 ++++++++ - src/core/CMakeLists.txt | 2 +- - 2 files changed, 9 insertions(+), 1 deletion(-) - -Index: LucenePlusPlus-rel_3.0.6/CMakeLists.txt -=================================================================== ---- LucenePlusPlus-rel_3.0.6.orig/CMakeLists.txt 2014-04-19 19:26:40.000000000 +0100 -+++ LucenePlusPlus-rel_3.0.6/CMakeLists.txt 2014-10-18 10:54:14.000000000 +0100 -@@ -138,6 +138,14 @@ if(NOT WIN32) - DESTINATION ${LIB_DESTINATION}/pkgconfig) - endif() - -+################################# -+# install Config.h -+################################# -+install( -+ FILES -+ "${CMAKE_CURRENT_BINARY_DIR}/include/Config.h" -+ DESTINATION include/lucene++) -+ - #################################### - # custom targets - #################################### -Index: LucenePlusPlus-rel_3.0.6/src/core/CMakeLists.txt -=================================================================== ---- LucenePlusPlus-rel_3.0.6.orig/src/core/CMakeLists.txt 2014-04-19 19:26:40.000000000 +0100 -+++ LucenePlusPlus-rel_3.0.6/src/core/CMakeLists.txt 2014-10-18 10:54:14.000000000 +0100 -@@ -20,7 +20,7 @@ file(GLOB_RECURSE lucene_internal_header - ) - - file(GLOB_RECURSE lucene_headers -- include/*.h -+ "${lucene++_SOURCE_DIR}/include/*.h" - ) - - add_definitions(-DLPP_BUILDING_LIB) diff --git a/lucene++-3.0.6-multiarch.patch b/lucene++-3.0.6-multiarch.patch deleted file mode 100644 index f6b6261..0000000 --- a/lucene++-3.0.6-multiarch.patch +++ /dev/null @@ -1,28 +0,0 @@ -From fcdcf1945f0325c8dfdcdfa03ae8af5247602e6e Mon Sep 17 00:00:00 2001 -From: Gianfranco Costamagna -Date: Wed, 2 Jul 2014 17:20:57 +0200 -Subject: [PATCH] enable multiarch lib location -References: https://github.com/luceneplusplus/LucenePlusPlus/commit/4c533e7f87ce6032284c44d12e022dc2498b49df -Uptream: committed - -Cherry picked from ubuntu lucene++ package ---- - CMakeLists.txt | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6ae96b7..4b74427 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -75,9 +75,10 @@ set(lucene_boost_libs - - include(Lucene++Docs) - include(TestCXXAcceptsFlag) -+include(GNUInstallDirs) - - set(LIB_DESTINATION -- "lib" CACHE STRING "Define lib output directory name" -+ "${CMAKE_INSTALL_FULL_LIBDIR}" CACHE STRING "Define lib output directory name" - ) - - if(ENABLE_CYCLIC_CHECK) diff --git a/lucene++-3.0.6-pc_files_fix.patch b/lucene++-3.0.6-pc_files_fix.patch deleted file mode 100644 index 032a264..0000000 --- a/lucene++-3.0.6-pc_files_fix.patch +++ /dev/null @@ -1,71 +0,0 @@ -From c5ed014df578f2be4c48ac8e6f09d6450d1a2a03 Mon Sep 17 00:00:00 2001 -From: rezso -Date: Mon, 19 May 2014 09:23:35 +0100 -Subject: [PATCH] lucene++ .pc files fix -Upstream: Committed: -References: https://github.com/luceneplusplus/LucenePlusPlus/commit/c5ed014df578f2be4c48ac8e6f09d6450d1a2a03 - -Without this patch, liblucene++-contrib.pc contains: -> Requires: liblucene++=3.0.6 - -Which breaks pkg-config: -> $ pkg-config --libs liblucene++-contrib -> Package liblucene++=3.0.6 was not found in the pkg-config search path. -> Perhaps you should add the directory containing `liblucene++=3.0.6.pc' -> to the PKG_CONFIG_PATH environment variable -> Package 'liblucene++=3.0.6', required by 'liblucene++-contrib', not found - -The correct line is: -> Requires: liblucene++ = 3.0.6 - -Which returns correctly: -> $ pkg-config --libs liblucene++-contrib -> -L/usr/lib/ -llucene++-contrib -llucene++ - ---- - liblucene++-contrib.pc.cmake | 7 +++---- - liblucene++.pc.cmake | 5 ++--- - 2 files changed, 5 insertions(+), 7 deletions(-) - -Index: LucenePlusPlus-rel_3.0.6/liblucene++-contrib.pc.cmake -=================================================================== ---- LucenePlusPlus-rel_3.0.6.orig/liblucene++-contrib.pc.cmake 2014-10-19 19:13:45.000000000 +0100 -+++ LucenePlusPlus-rel_3.0.6/liblucene++-contrib.pc.cmake 2014-10-19 19:18:37.000000000 +0100 -@@ -1,14 +1,13 @@ - prefix=@CMAKE_INSTALL_PREFIX@ - exec_prefix=${prefix}/bin --libdir=@LIB_DESTINATION@ -+libdir=@LIB_INSTALL_DIR@ - includedir=${prefix}/include/lucene++ - lib=lucene++-contrib - - Name: liblucene++-contrib - Description: Contributions for Lucene++ - a C++ search engine, ported from the popular Apache Lucene - Version: @lucene++_VERSION@ --Libs: -L@LIB_DESTINATION@/ -l${lib} -+Libs: -L@LIB_INSTALL_DIR@ -l${lib} - Cflags: -I${includedir} --Requires: liblucene++=@lucene++_VERSION@ --~ -+Requires: liblucene++ = @lucene++_VERSION@ - -Index: LucenePlusPlus-rel_3.0.6/liblucene++.pc.cmake -=================================================================== ---- LucenePlusPlus-rel_3.0.6.orig/liblucene++.pc.cmake 2014-10-19 19:13:45.000000000 +0100 -+++ LucenePlusPlus-rel_3.0.6/liblucene++.pc.cmake 2014-10-19 19:18:19.000000000 +0100 -@@ -1,13 +1,12 @@ - prefix=@CMAKE_INSTALL_PREFIX@ - exec_prefix=${prefix}/bin --libdir=@LIB_DESTINATION@ -+libdir=@LIB_INSTALL_DIR@ - includedir=${prefix}/include/lucene++ - lib=lucene++ - - Name: liblucene++ - Description: Lucene++ - a C++ search engine, ported from the popular Apache Lucene - Version: @lucene++_VERSION@ --Libs: -L@LIB_DESTINATION@ -l${lib} -+Libs: -L@LIB_INSTALL_DIR@ -l${lib} - Cflags: -I${includedir} --~ - diff --git a/lucene++.spec b/lucene++.spec index 5991a5d..bea73ab 100644 --- a/lucene++.spec +++ b/lucene++.spec @@ -1,16 +1,19 @@ Name: lucene++ Summary: A high-performance, full-featured text search engine written in C++ -Version: 3.0.6 -Release: 2%{?dist} +Version: 3.0.7 +Release: 1%{?dist} License: ASL 2.0 or LGPLv3+ Url: https://github.com/luceneplusplus/LucenePlusPlus Source: https://github.com/luceneplusplus/LucenePlusPlus/archive/rel_%{version}.tar.gz#/%{name}-%{version}.tar.gz -Patch1: lucene++-3.0.6-pc_files_fix.patch -Patch2: lucene++-3.0.6-fix_installing_headers.patch -Patch3: lucene++-3.0.6-multiarch.patch +## upstream patches +Patch1: 0001-Fix-FSDirectory-sync-to-sync-writes-to-disk.patch +Patch2: 0002-minor-fix-to-allow-full-lines-to-be-input-to-demo-qu.patch +Patch5: 0005-Use-maxSize-of-BooleanQuery-as-base-for-the-queue-si.patch +Patch6: 0006-Fix-packageconfig-path.patch + BuildRequires: boost-devel BuildRequires: cmake >= 2.8.6 @@ -28,11 +31,7 @@ Development files for lucene++, a high-performance, full-featured text search en %prep -%setup -q -n LucenePlusPlus-rel_%{version} - -%patch1 -p1 -b .pc_files_fix -%patch2 -p1 -b .fix_installing_headers -%patch3 -p1 -b .multiarch +%autosetup -p1 -n LucenePlusPlus-rel_%{version} %build @@ -69,6 +68,9 @@ make install/fast DESTDIR=%{buildroot} -C %{_target_platform} %changelog +* Wed Apr 29 2015 Rex Dieter 3.0.7-1 +- 3.0.7 + * Tue Jan 27 2015 Petr Machata - 3.0.6-2 - Rebuild for boost 1.57.0