Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37728006
en ru br
ALT Linux repos
S:3.0.8-alt2

Group :: System/Libraries
RPM: liblucene++

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: liblucene++-3.0.8-alt1.1.patch
Download


 .gear/rules                                        |  2 +
 .../tags/b36b4a98733bd6d006d6dc70073d0d537ff0e678  |  6 ++
 .gear/tags/list                                    |  1 +
 CMakeLists.txt                                     |  2 +-
 lucene++.spec                                      | 90 ++++++++++++++++++++++
 src/config/CMakeLists.txt                          | 12 +--
 src/config/contrib/CMakeLists.txt                  |  7 +-
 src/config/contrib/liblucene++-contrib.pc.in       |  4 +-
 .../contrib/liblucene++-contribConfig.cmake.in     |  6 +-
 src/config/core/CMakeLists.txt                     |  7 +-
 src/config/core/liblucene++.pc.in                  |  4 +-
 src/config/core/liblucene++Config.cmake.in         |  6 +-
 src/contrib/CMakeLists.txt                         |  2 +-
 .../analyzers/common/analysis/cn/ChineseFilter.cpp |  2 +-
 .../common/analysis/cn/ChineseTokenizer.cpp        | 22 +++++-
 15 files changed, 147 insertions(+), 26 deletions(-)
diff --git a/.gear/rules b/.gear/rules
new file mode 100644
index 0000000..7d16417
--- /dev/null
+++ b/.gear/rules
@@ -0,0 +1,2 @@
+tar: rel_@version@:.
+diff: rel_@version@:. .
diff --git a/.gear/tags/b36b4a98733bd6d006d6dc70073d0d537ff0e678 b/.gear/tags/b36b4a98733bd6d006d6dc70073d0d537ff0e678
new file mode 100644
index 0000000..cf9b076
--- /dev/null
+++ b/.gear/tags/b36b4a98733bd6d006d6dc70073d0d537ff0e678
@@ -0,0 +1,6 @@
+object df65bf5ff43cee1d79f37217bcbf423f89b07d97
+type commit
+tag rel_3.0.8
+tagger Alan Wright <alan@Alans-MacBook-Pro.local> 1609243890 +0000
+
+3.0.8
diff --git a/.gear/tags/list b/.gear/tags/list
new file mode 100644
index 0000000..96f3eac
--- /dev/null
+++ b/.gear/tags/list
@@ -0,0 +1 @@
+b36b4a98733bd6d006d6dc70073d0d537ff0e678 rel_3.0.8
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 41de688..71dbbd5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,7 +21,7 @@ if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
 endif()
 
 set(LIB_DESTINATION
-  "${CMAKE_INSTALL_FULL_LIBDIR}" CACHE STRING "Define lib output directory name")
+  "${CMAKE_INSTALL_LIBDIR}" CACHE STRING "Define lib output directory name")
 
 
 ####################################
diff --git a/lucene++.spec b/lucene++.spec
new file mode 100644
index 0000000..6330c73
--- /dev/null
+++ b/lucene++.spec
@@ -0,0 +1,90 @@
+%define _name lucene++
+%def_enable check
+
+Name: lib%_name
+Version: 3.0.8
+Release: alt1.1
+
+Summary: A high-performance, full-featured text search engine written in C++
+Group: System/Libraries
+License: Apache-2.0 or LGPL-3.0-or-later
+Url: https://github.com/luceneplusplus/LucenePlusPlus
+
+Source: https://github.com/luceneplusplus/LucenePlusPlus/archive/rel_%version.tar.gz#/%name-%version.tar
+Patch: %name-%version-%release.patch
+
+BuildRequires: cmake gcc-c++ zlib-devel
+BuildRequires: boost-devel boost-filesystem-devel boost-asio-devel boost-interprocess-devel
+%{?_enable_check:BuildRequires: libgmock-devel}
+
+%description
+An up to date C++ port of the popular Java Lucene library,
+a high-performance, full-featured text search engine.
+
+%package devel
+Summary: Development files for lucene++
+Group: Development/C++
+Requires: %name = %version-%release
+
+%description devel
+Development files for lucene++, a high-performance, full-featured text
+search engine written in C++
+
+%prep
+%setup
+%patch -p1
+
+%build
+%add_optflags %(getconf LFS_CFLAGS)
+%cmake \
+    -DCMAKE_BUILD_TYPE:STRING="Release" \
+    %{?_disable_check:-DENABLE_TEST=FALSE} \
+    -DBUILD_GMOCK=FALSE} \
+    -DINSTALL_GTEST=FALSE
+%nil
+%cmake_build -t %_name %_name-contrib
+
+%install
+%cmake_install
+
+%check
+#%%cmake_build -t test
+
+%files
+%_libdir/%name.so.*
+%_libdir/%name-contrib.so.*
+%doc COPYING AUTHORS README* REQUESTS
+
+%files devel
+%_includedir/%_name/
+%_libdir/%name.so
+%_libdir/%name-contrib.so
+%_pkgconfigdir/%name.pc
+%_pkgconfigdir/%name-contrib.pc
+%_libdir/cmake/%{name}*
+
+%changelog
+* Mon May 31 2021 Yuri N. Sedunov <aris@altlinux.org> 3.0.8-alt1.1
+- adapted to new cmake macros
+
+* Tue Jan 12 2021 Yuri N. Sedunov <aris@altlinux.org> 3.0.8-alt1
+- updated to rel_3.0.8-8-g8c2ce8d
+- fixed License tag
+
+* Fri Jun 01 2018 Yuri N. Sedunov <aris@altlinux.org> 3.0.7-alt5
+- rebuilt with boost-1.67
+
+* Wed Apr 18 2018 Yuri N. Sedunov <aris@altlinux.org> 3.0.7-alt4
+- rebuilt with boost-1.66
+
+* Wed Sep 13 2017 Yuri N. Sedunov <aris@altlinux.org> 3.0.7-alt3
+- rebuilt with boost-1.65
+
+* Tue Jan 17 2017 Yuri N. Sedunov <aris@altlinux.org> 3.0.7-alt2
+- updated to 3.0.7-7-gcf9b9d9
+
+* Thu Aug 06 2015 Yuri N. Sedunov <aris@altlinux.org> 3.0.7-alt1
+- first build for Sisyphus
+
+
+
diff --git a/src/config/CMakeLists.txt b/src/config/CMakeLists.txt
index e5e6624..fe8e8b8 100644
--- a/src/config/CMakeLists.txt
+++ b/src/config/CMakeLists.txt
@@ -1,16 +1,16 @@
 ####################################
 # Set config vars
 ####################################
-set(core_libname, "lucene++")
-set(contrib_libname, "lucene++-contrib")
+set(core_libname "lucene++")
+set(contrib_libname "lucene++-contrib")
 
 set(
-    PACKAGE_CMAKE_INSTALL_INCLUDEDIR,
-    "${lucene++_INCLUDE_DIR}/lucene++/")
+    PACKAGE_CMAKE_INSTALL_INCLUDEDIR
+    "${CMAKE_INSTALL_INCLUDEDIR}/lucene++/")
 
 set(
-    PACKAGE_CMAKE_INSTALL_LIBDIR,
-    "${LIB_INSTALL_DIR}/cmake")
+    PACKAGE_CMAKE_INSTALL_LIBDIR
+    "${LIB_DESTINATION}")
 
 
 ####################################
diff --git a/src/config/contrib/CMakeLists.txt b/src/config/contrib/CMakeLists.txt
index c0dd86f..b4a4391 100644
--- a/src/config/contrib/CMakeLists.txt
+++ b/src/config/contrib/CMakeLists.txt
@@ -9,7 +9,7 @@ if(NOT WIN32)
   install(
     FILES
       "${CMAKE_CURRENT_BINARY_DIR}/liblucene++-contrib.pc"
-    DESTINATION "include/pkgconfig")
+    DESTINATION "${LIB_DESTINATION}/pkgconfig")
 endif()
 
 
@@ -19,7 +19,8 @@ endif()
 configure_package_config_file(
   "${CMAKE_CURRENT_SOURCE_DIR}/liblucene++-contribConfig.cmake.in"
   "${CMAKE_CURRENT_BINARY_DIR}/liblucene++-contribConfig.cmake"
-  INSTALL_DESTINATION "${LIB_DESTINATION}/cmake")
+  INSTALL_DESTINATION "${LIB_DESTINATION}/cmake/liblucene++-contrib"
+  PATH_VARS contrib_libname PACKAGE_CMAKE_INSTALL_INCLUDEDIR PACKAGE_CMAKE_INSTALL_LIBDIR)
 
 write_basic_package_version_file(
   "${CMAKE_CURRENT_BINARY_DIR}/liblucene++-contribConfigVersion.cmake"
@@ -30,4 +31,4 @@ install(
   FILES
     "${CMAKE_CURRENT_BINARY_DIR}/liblucene++-contribConfig.cmake"
     "${CMAKE_CURRENT_BINARY_DIR}/liblucene++-contribConfigVersion.cmake"
-  DESTINATION "include/cmake")
+  DESTINATION "${LIB_DESTINATION}/cmake/liblucene++-contrib")
diff --git a/src/config/contrib/liblucene++-contrib.pc.in b/src/config/contrib/liblucene++-contrib.pc.in
index 21026e0..64c3aca 100644
--- a/src/config/contrib/liblucene++-contrib.pc.in
+++ b/src/config/contrib/liblucene++-contrib.pc.in
@@ -1,13 +1,13 @@
 prefix=@CMAKE_INSTALL_PREFIX@
 exec_prefix=${prefix}/bin
-libdir=@LIB_DESTINATION@
+libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
 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${libdir} -l${lib}
 Cflags: -I${includedir}
 Requires: liblucene++ = @lucene++_VERSION@
 
diff --git a/src/config/contrib/liblucene++-contribConfig.cmake.in b/src/config/contrib/liblucene++-contribConfig.cmake.in
index f92f683..85fdfd2 100644
--- a/src/config/contrib/liblucene++-contribConfig.cmake.in
+++ b/src/config/contrib/liblucene++-contribConfig.cmake.in
@@ -20,6 +20,6 @@ if (NOT DEFINED set_and_check)
 endif()
 
 
-set_and_check(liblucene++-contrib_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@/@contrib_libname@")
-set_and_check(liblucene++-contrib_LIBRARY_DIRS "@PACKAGE_CMAKE_INSTALL_LIBDIR@")
-set(liblucene++-contrib_LIBRARIES "@PACKAGE_CMAKE_INSTALL_LIBDIR@/@contrib_libname@")
+set_and_check(liblucene++-contrib_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
+set_and_check(liblucene++-contrib_LIBRARY_DIRS "${PACKAGE_PREFIX_DIR}/@PACKAGE_CMAKE_INSTALL_LIBDIR@")
+set(liblucene++-contrib_LIBRARIES "@contrib_libname@")
diff --git a/src/config/core/CMakeLists.txt b/src/config/core/CMakeLists.txt
index a3eb17a..65376f5 100644
--- a/src/config/core/CMakeLists.txt
+++ b/src/config/core/CMakeLists.txt
@@ -9,7 +9,7 @@ if(NOT WIN32)
   install(
     FILES
       "${CMAKE_CURRENT_BINARY_DIR}/liblucene++.pc"
-    DESTINATION "include/pkgconfig")
+    DESTINATION "${LIB_DESTINATION}/pkgconfig")
 endif()
 
 
@@ -19,7 +19,8 @@ endif()
 configure_package_config_file(
   "${CMAKE_CURRENT_SOURCE_DIR}/liblucene++Config.cmake.in"
   "${CMAKE_CURRENT_BINARY_DIR}/liblucene++Config.cmake"
-  INSTALL_DESTINATION "${LIB_DESTINATION}/cmake")
+  INSTALL_DESTINATION "${LIB_DESTINATION}/cmake/liblucene++"
+  PATH_VARS core_libname PACKAGE_CMAKE_INSTALL_INCLUDEDIR PACKAGE_CMAKE_INSTALL_LIBDIR)
 
 write_basic_package_version_file(
   ${CMAKE_CURRENT_BINARY_DIR}/liblucene++ConfigVersion.cmake
@@ -30,4 +31,4 @@ install(
   FILES
     "${CMAKE_CURRENT_BINARY_DIR}/liblucene++Config.cmake"
     "${CMAKE_CURRENT_BINARY_DIR}/liblucene++ConfigVersion.cmake"
-  DESTINATION "include/cmake")
+  DESTINATION "${LIB_DESTINATION}/cmake/liblucene++")
diff --git a/src/config/core/liblucene++.pc.in b/src/config/core/liblucene++.pc.in
index 32d16ad..690f7d2 100644
--- a/src/config/core/liblucene++.pc.in
+++ b/src/config/core/liblucene++.pc.in
@@ -1,12 +1,12 @@
 prefix=@CMAKE_INSTALL_PREFIX@
 exec_prefix=${prefix}/bin
-libdir=@LIB_DESTINATION@
+libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
 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${libdir} -l${lib}
 Cflags: -I${includedir}
 
diff --git a/src/config/core/liblucene++Config.cmake.in b/src/config/core/liblucene++Config.cmake.in
index 89b48a3..574f812 100644
--- a/src/config/core/liblucene++Config.cmake.in
+++ b/src/config/core/liblucene++Config.cmake.in
@@ -20,8 +20,8 @@ if (NOT DEFINED set_and_check)
 endif()
 
 
-set_and_check(liblucene++_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@/@core_libname@")
-set_and_check(liblucene++_LIBRARY_DIRS "@PACKAGE_CMAKE_INSTALL_LIBDIR@")
-set(liblucene++_LIBRARIES "@PACKAGE_CMAKE_INSTALL_LIBDIR@/@core_libname@")
+set_and_check(liblucene++_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
+set_and_check(liblucene++_LIBRARY_DIRS "${PACKAGE_PREFIX_DIR}/@PACKAGE_CMAKE_INSTALL_LIBDIR@")
+set(liblucene++_LIBRARIES "@core_libname@")
 
 
diff --git a/src/contrib/CMakeLists.txt b/src/contrib/CMakeLists.txt
index 46ed8a2..afeccb4 100644
--- a/src/contrib/CMakeLists.txt
+++ b/src/contrib/CMakeLists.txt
@@ -77,7 +77,7 @@ endif()
 ####################################
 target_compile_options(lucene++-contrib PRIVATE -DLPP_BUILDING_LIB)
 
-set_target_properties(lucene++
+set_target_properties(lucene++-contrib
   PROPERTIES
     COTIRE_CXX_PREFIX_HEADER_INIT "include/ContribInc.h"
     CXX_VISIBILITY_PRESET hidden
diff --git a/src/contrib/analyzers/common/analysis/cn/ChineseFilter.cpp b/src/contrib/analyzers/common/analysis/cn/ChineseFilter.cpp
index d2a19f3..8313445 100644
--- a/src/contrib/analyzers/common/analysis/cn/ChineseFilter.cpp
+++ b/src/contrib/analyzers/common/analysis/cn/ChineseFilter.cpp
@@ -38,7 +38,7 @@ bool ChineseFilter::incrementToken() {
                 if (text.length() > 1) {
                     return true;
                 }
-            } else if (UnicodeUtil::isOther(text[0])) {
+            } else if (UnicodeUtil::isOther(text[0]) || UnicodeUtil::isDigit(text[0])) {
                 // One Chinese character as one Chinese word.
                 // Chinese word extraction to be added later here.
                 return true;
diff --git a/src/contrib/analyzers/common/analysis/cn/ChineseTokenizer.cpp b/src/contrib/analyzers/common/analysis/cn/ChineseTokenizer.cpp
index 38bf987..3b4de74 100644
--- a/src/contrib/analyzers/common/analysis/cn/ChineseTokenizer.cpp
+++ b/src/contrib/analyzers/common/analysis/cn/ChineseTokenizer.cpp
@@ -65,6 +65,7 @@ bool ChineseTokenizer::incrementToken() {
 
     length = 0;
     start = offset;
+    bool last_is_en = false, last_is_num = false;
 
     while (true) {
         wchar_t c;
@@ -82,11 +83,30 @@ bool ChineseTokenizer::incrementToken() {
             c = ioBuffer[bufferIndex++];
         }
 
-        if (UnicodeUtil::isDigit(c) || UnicodeUtil::isLower(c) || UnicodeUtil::isUpper(c)) {
+        if (UnicodeUtil::isLower(c) || UnicodeUtil::isUpper(c)) {
+            if (last_is_num) {
+                --bufferIndex;
+                --offset;
+                return flush();
+            }
+
+            push(c);
+            if (length == MAX_WORD_LEN) {
+                return flush();
+            }
+            last_is_en = true;
+        } else if (UnicodeUtil::isDigit(c)) {
+            if (last_is_en) {
+                --bufferIndex;
+                --offset;
+                return flush();
+            }
+
             push(c);
             if (length == MAX_WORD_LEN) {
                 return flush();
             }
+            last_is_num = true;
         } else if (UnicodeUtil::isOther(c)) {
             if (length > 0) {
                 --bufferIndex;
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin