[mingw-clucene] Initial import. (#825557)

Greg Hellings greghellings at fedoraproject.org
Sun Nov 18 00:37:29 UTC 2012


commit 424f9727f5d8e169c41ce2a6454eee2cb39e5983
Author: Greg Hellings <greg.hellings at gmail.com>
Date:   Sat Nov 17 18:35:48 2012 -0600

    Initial import. (#825557)

 .gitignore                                      |    1 +
 clucene-core-2.3.3.4-install_contribs_lib.patch |   42 ++++++
 clucene-core-2.3.3.4-pkgconfig.patch            |   12 ++
 mingw-clucene-core-2.3.3.4-fix-threads.patch    |   66 +++++++++
 mingw-clucene.spec                              |  161 +++++++++++++++++++++++
 sources                                         |    1 +
 6 files changed, 283 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..79c6eee 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/clucene-core-2.3.3.4.tar.gz
diff --git a/clucene-core-2.3.3.4-install_contribs_lib.patch b/clucene-core-2.3.3.4-install_contribs_lib.patch
new file mode 100644
index 0000000..8fbb3c7
--- /dev/null
+++ b/clucene-core-2.3.3.4-install_contribs_lib.patch
@@ -0,0 +1,42 @@
+diff -NaurpBb clucene-core-2.3.3.4/CMakeLists.txt clucene-core-2.3.3.4-mod/CMakeLists.txt
+--- clucene-core-2.3.3.4/CMakeLists.txt	2011-03-17 03:21:07.000000000 +0300
++++ clucene-core-2.3.3.4-mod/CMakeLists.txt	2011-08-16 16:56:55.968268152 +0400
+@@ -163,7 +163,7 @@ IF ( BUILD_CONTRIBS )
+   SET(BUILD_CONTRIBS_LIB 1)
+ ENDIF ( BUILD_CONTRIBS )
+ IF ( BUILD_CONTRIBS_LIB )
+-  ADD_SUBDIRECTORY (src/contribs-lib EXCLUDE_FROM_ALL)
++  ADD_SUBDIRECTORY (src/contribs-lib)
+ ENDIF ( BUILD_CONTRIBS_LIB )
+ 
+ 
+diff -NaurpBb clucene-core-2.3.3.4/src/contribs-lib/CMakeLists.txt clucene-core-2.3.3.4-mod/src/contribs-lib/CMakeLists.txt
+--- clucene-core-2.3.3.4/src/contribs-lib/CMakeLists.txt	2011-03-17 03:21:07.000000000 +0300
++++ clucene-core-2.3.3.4-mod/src/contribs-lib/CMakeLists.txt	2011-08-16 17:14:13.499275499 +0400
+@@ -106,9 +106,26 @@ add_library(clucene-contribs-lib SHARED
+ )
+ TARGET_LINK_LIBRARIES(clucene-contribs-lib ${clucene_contrib_extra_libs})
+ 
++#install public headers.
++FOREACH(file ${HEADERS})
++	get_filename_component(apath ${file} PATH)
++	get_filename_component(aname ${file} NAME)
++	file(RELATIVE_PATH relpath ${CMAKE_SOURCE_DIR}/src/contribs-lib ${apath})
++	IF ( NOT aname MATCHES "^_.*" )
++		install(FILES ${file} 
++		        DESTINATION include/${relpath}
++		        COMPONENT development)
++	ENDIF ( NOT aname MATCHES "^_.*" )
++ENDFOREACH(file)
++
+ #set properties on the libraries
+ SET_TARGET_PROPERTIES(clucene-contribs-lib PROPERTIES
+     VERSION ${CLUCENE_VERSION}
+     SOVERSION ${CLUCENE_SOVERSION}
+     COMPILE_DEFINITIONS_DEBUG _DEBUG
+ )
++
++#and install library
++install(TARGETS clucene-contribs-lib 
++        DESTINATION ${LIB_DESTINATION}  
++        COMPONENT runtime )
diff --git a/clucene-core-2.3.3.4-pkgconfig.patch b/clucene-core-2.3.3.4-pkgconfig.patch
new file mode 100644
index 0000000..aff20d7
--- /dev/null
+++ b/clucene-core-2.3.3.4-pkgconfig.patch
@@ -0,0 +1,12 @@
+diff -up clucene-core-2.3.3.4/src/core/libclucene-core.pc.cmake.pkgconfig_sys_includes clucene-core-2.3.3.4/src/core/libclucene-core.pc.cmake
+--- clucene-core-2.3.3.4/src/core/libclucene-core.pc.cmake.pkgconfig_sys_includes	2011-03-16 19:21:07.000000000 -0500
++++ clucene-core-2.3.3.4/src/core/libclucene-core.pc.cmake	2012-03-19 09:01:00.689263954 -0500
+@@ -6,6 +6,6 @@ includedir=${prefix}/include:${prefix}/i
+ Name: libclucene
+ Description: CLucene - a C++ search engine, ported from the popular Apache Lucene
+ Version: @CLUCENE_VERSION_MAJOR at .@CLUCENE_VERSION_MINOR at .@CLUCENE_VERSION_REVISION at .@CLUCENE_VERSION_PATCH@
+-Libs: -L${prefix}/@LIB_DESTINATION@/ -lclucene-core
+-Cflags: -I${prefix}/include -I${prefix}/include/CLucene/ext
++Libs: -L${prefix}/@LIB_DESTINATION@/ -lclucene-core -lclucene-shared
++Cflags: -I${prefix}/include -I${prefix}/include/CLucene/ext -I at LUCENE_SYS_INCLUDES@
+ ~
diff --git a/mingw-clucene-core-2.3.3.4-fix-threads.patch b/mingw-clucene-core-2.3.3.4-fix-threads.patch
new file mode 100644
index 0000000..192f3f0
--- /dev/null
+++ b/mingw-clucene-core-2.3.3.4-fix-threads.patch
@@ -0,0 +1,66 @@
+Added a little patch to fix up some compile problems related to threads
+on Win64 targets.
+--- a/src/shared/CLucene/LuceneThreads.h
++++ b/src/shared/CLucene/LuceneThreads.h
+@@ -30,6 +30,9 @@
+   #define _LUCENE_ATOMIC_INC(theInteger) (++(*theInteger))
+   #define _LUCENE_ATOMIC_DEC(theInteger) (--(*theInteger))
+   #define _LUCENE_ATOMIC_INT int
++  
++  	#define _LUCENE_ATOMIC_INT_SET(x, v) x=v
++  	#define _LUCENE_ATOMIC_INT_GET(x) x
+ #else
+ 	#if defined(_LUCENE_DONTIMPLEMENT_THREADMUTEX)
+ 		//do nothing
+--- a/src/core/CLucene/store/FSDirectory.cpp
++++ b/src/core/CLucene/store/FSDirectory.cpp
+@@ -582,7 +582,9 @@
+   void FSDirectory::close(){
+     SCOPED_LOCK_MUTEX(DIRECTORIES_LOCK)
+     {
++#if !defined(_CL_DISABLE_MULTITHREADING)
+ 	    THIS_LOCK.lock();
++#endif
+ 
+ 	    CND_PRECONDITION(directory[0]!=0,"directory is not open");
+ 
+@@ -595,7 +597,9 @@
+ 	            return;
+ 	        }
+ 	    }
++#if !defined(_CL_DISABLE_MULTITHREADING)
+ 	    THIS_LOCK.unlock();  
++#endif
+ 	  }
+    }
+ 
+--- a/src/shared/CLucene/util/Misc.cpp
++++ b/src/shared/CLucene/util/Misc.cpp
+@@ -474,6 +474,7 @@
+   }
+   return toString(ids[value]);
+ }
++#if !defined(_CL_DISABLE_MULTITHREADING)
+ std::string Misc::toString(const int32_t value){
+   char buf[20];
+   TCHAR tbuf[20];
+@@ -481,6 +482,7 @@
+   STRCPY_TtoA(buf,tbuf,20);
+   return buf;
+ }
++#endif
+ std::string Misc::toString(const int64_t value){
+   char buf[20];
+   TCHAR tbuf[20];
+--- a/src/shared/CLucene/util/Misc.h
++++ b/src/shared/CLucene/util/Misc.h
+@@ -67,7 +67,9 @@
+ 
+   static std::string toString(const int32_t value);
+   static std::string toString(const int64_t value);
++#if !defined(_CL_DISABLE_MULTITHREADING)
+   static std::string toString(const _LUCENE_THREADID_TYPE value);
++#endif
+   static std::string toString(const bool value);
+   static std::string toString(const float_t value);
+   static std::string toString(const TCHAR* s, int32_t len=-1);
diff --git a/mingw-clucene.spec b/mingw-clucene.spec
new file mode 100644
index 0000000..e45c6ef
--- /dev/null
+++ b/mingw-clucene.spec
@@ -0,0 +1,161 @@
+%{?mingw_package_header}
+
+%global _pkg_name clucene
+
+Summary:	MinGW build of a C++ port of Lucene
+Name:		mingw-%{_pkg_name}
+Version:	2.3.3.4
+Release:	5%{?dist}
+License:	LGPLv2+ or ASL 2.0
+URL:		http://www.sourceforge.net/projects/clucene
+Source0:	http://downloads.sourceforge.net/clucene/clucene-core-%{version}.tar.gz
+BuildRequires:	gawk cmake 
+BuildRequires:	mingw32-zlib mingw64-zlib
+BuildRequires:	mingw32-boost mingw64-boost
+BuildRequires:	mingw32-gcc-c++ mingw64-gcc-c++
+BuildRequires:	mingw32-filesystem >= 95
+BuildRequires:	mingw64-filesystem >= 95
+
+BuildArch:	noarch
+
+## upstreamable patches
+# include LUCENE_SYS_INCLUDES in pkgconfig --cflags output
+# https://bugzilla.redhat.com/748196
+# and
+# https://sourceforge.net/tracker/?func=detail&aid=3461512&group_id=80013&atid=558446
+# pkgconfig file is missing clucene-shared
+Patch50: clucene-core-2.3.3.4-pkgconfig.patch
+# https://bugzilla.redhat.com/794795
+# https://sourceforge.net/tracker/index.php?func=detail&aid=3392466&group_id=80013&atid=558446
+# contribs-lib is not built and installed even with config
+Patch51: clucene-core-2.3.3.4-install_contribs_lib.patch  
+Patch52: mingw-clucene-core-2.3.3.4-fix-threads.patch
+
+%description
+CLucene is a C++ port of the popular Apache Lucene search engine
+(http://lucene.apache.org/java). 
+CLucene aims to be a high-speed alternative to Java Lucene, its API is very
+similar to that of the Java version. CLucene has recently been brought up to
+date with Lucene 2.3.2. It contains most of the same functionality as the
+Java version.
+
+%package -n mingw32-%{_pkg_name}
+Summary:	%{summary}
+
+%description -n mingw32-%{_pkg_name}
+CLucene is a C++ port of the popular Apache Lucene search engine
+(http://lucene.apache.org/java). 
+CLucene aims to be a high-speed alternative to Java Lucene, its API is very
+similar to that of the Java version. CLucene has recently been brought up to
+date with Lucene 2.3.2. It contains most of the same functionality as the
+Java version.
+
+%package -n mingw64-%{_pkg_name}
+Summary:	%{summary}
+
+%description -n mingw64-%{_pkg_name}
+CLucene is a C++ port of the popular Apache Lucene search engine
+(http://lucene.apache.org/java). 
+CLucene aims to be a high-speed alternative to Java Lucene, its API is very
+similar to that of the Java version. CLucene has recently been brought up to
+date with Lucene 2.3.2. It contains most of the same functionality as the
+Java version.
+
+
+%{?mingw_debug_package}
+
+
+%prep
+%setup -qn %{_pkg_name}-core-%{version}
+
+%patch50 -p1 -b .pkgconfig
+%patch51 -p1 -b .install_contribs_lib
+%patch52 -p1 -b .threads
+
+rm -rf src/ext/{boost,zlib}
+
+%build
+# Also for 64-bit
+MINGW32_CMAKE_ARGS="
+	-DLIB_DESTINATION:PATH=%{mingw32_libdir}"
+	
+MINGW64_CMAKE_ARGS="
+	-DLIB_DESTINATION:PATH=%{mingw64_libdir}
+	-DDISABLE_MULTITHREADING:BOOL=ON"
+	
+%mingw_cmake -DBUILD_STATIC_LIBRARIES:BOOLEAN=FALSE \
+	-D_CL_HAVE_GCC_ATOMIC_FUNCTIONS_EXITCODE=0 \
+	-D_CL_HAVE_TRY_BLOCKS_EXITCODE=0 \
+	-D_CL_HAVE_NAMESPACES_EXITCODE=0 \
+	-D_CL_HAVE_NO_SNWPRINTF_BUG_EXITCODE=0 \
+	-DLUCENE_STATIC_CONSTANT_SYNTAX_EXITCODE=1 \
+	-D_CL_HAVE_GCCVISIBILITYPATCH=0 \
+	-D_CL_HAVE_FUNCTION_SNPRINTF:INTERNAL=0
+
+%mingw_make %{?_smp_mflags}
+
+
+%install
+%mingw_make install/fast DESTDIR=$RPM_BUILD_ROOT
+
+rm -rf $RPM_BUILD_ROOT%{mingw32_libdir}/CLuceneConfig.cmake
+rm -rf $RPM_BUILD_ROOT%{mingw64_libdir}/CLuceneConfig.cmake
+
+mkdir -p $RPM_BUILD_ROOT%{mingw32_bindir}
+mv $RPM_BUILD_ROOT%{mingw32_libdir}/libclucene-core.dll \
+   $RPM_BUILD_ROOT%{mingw32_libdir}/libclucene-shared.dll \
+   $RPM_BUILD_ROOT%{mingw32_bindir}
+
+mkdir -p $RPM_BUILD_ROOT%{mingw64_bindir}
+mv $RPM_BUILD_ROOT%{mingw64_libdir}/libclucene-core.dll \
+   $RPM_BUILD_ROOT%{mingw64_libdir}/libclucene-shared.dll \
+   $RPM_BUILD_ROOT%{mingw64_bindir}
+
+%files -n mingw32-%{_pkg_name}
+%doc APACHE.license AUTHORS ChangeLog COPYING LGPL.license README
+%{mingw32_libdir}/libclucene-core.dll.a
+%{mingw32_bindir}/libclucene-core.dll
+%{mingw32_libdir}/libclucene-shared.dll.a
+%{mingw32_bindir}/libclucene-shared.dll
+%{mingw32_includedir}/CLucene/
+%{mingw32_includedir}/CLucene.h
+
+%files -n mingw64-%{_pkg_name}
+%doc APACHE.license AUTHORS ChangeLog COPYING LGPL.license README
+%{mingw64_libdir}/libclucene-core.dll.a
+%{mingw64_bindir}/libclucene-core.dll
+%{mingw64_libdir}/libclucene-shared.dll.a
+%{mingw64_bindir}/libclucene-shared.dll
+%{mingw64_includedir}/CLucene/
+%{mingw64_includedir}/CLucene.h
+
+%changelog
+* Fri Nov 16 2012 Greg Hellings <greg.hellings at gmail.com> 2.3.3.4-5
+- Fixed remaining Summary values
+
+* Fri Nov 16 2012 Greg Hellings <greg.hellings at gmail.com> 2.3.3.4-4
+- Added back boost dependency
+- Removed bundled library copies
+- Removed extraneous Provides lines
+- Eliminated length warnings on descriptions from rpmlint
+- Eliminated "setup not quiet" warning from rpmlint
+- Removed unused "Group:" directives
+
+* Wed Nov 14 2012 Greg Hellings <greg.hellings at gmail.com> 2.3.3.4-3
+- Renamed packages to avoid unnecessary confusion
+- Removed unused BuildRequires
+- Removed conflicting dependency on pthreads in favor of native Win32 threading
+- Removed duplicate configure flags
+- Eliminated unsupported configure flags
+
+* Wed Aug 08 2012 Greg Hellings <greg.hellings at gmail.com> 2.3.3.4-2
+- Bumped version as requested
+- Updated file lists from review request feedback
+
+* Fri Jul 06 2012 Greg Hellings <greg.hellings at gmail.com> 2.3.3.4-1
+- Removed redundant files
+- Removed extra files yielding warnings
+- Removed clean section which is superfluous.
+
+* Fri May 25 2012 Greg Hellings <greg.hellings at gmail.com> 2.3.3.4-0
+- Initial package for MinGW
diff --git a/sources b/sources
index e69de29..e1e0cf0 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+48d647fbd8ef8889e5a7f422c1bfda94  clucene-core-2.3.3.4.tar.gz


More information about the scm-commits mailing list