Name: clucene-core
Summary: A C++ port of Lucene
Version: 2.3.3.4
Release: 2%{?_dist_release}

License: LGPLv2+ or ASL 2.0
Group: System Environment/Libraries
URL: http://sourceforge.net/projects/clucene

Source: %{name}-%{version}.tar.gz

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: cmake
BuildRequires: gawk
BuildRequires: libboost-devel
BuildRequires: zlib-devel

%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 devel
Summary: Headers for developing programs that will use %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description devel
This package contains the static libraries and header files needed for
developing with clucene

%prep
%setup -q 

%build
mkdir -p %{_target_platform}
pushd %{_target_platform}
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
export FFLAGS="%{optflags}"
%ifarch x86_64 ppc64
%define lib_suffix 64
%else
%define lib_suffix %{nil}
%endif
%cmake \
    -DCMAKE_INSTALL_PREFIX=%{_prefix}				\
    -DLIB_DESTINATION=%{_libdir}  -DLIB_SUFFIX=%{lib_suffix}	\
    -DLUCENE_SYS_INCLUDES=%{_libdir}				\
    ..
popd

make VERBOSE=1 %{?_smp_mflags} -C %{_target_platform}

%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install -C %{_target_platform}

rm -rf $RPM_BUILD_ROOT%{_libdir}/CLuceneConfig.cmake
#rm -rf $RPM_BUILD_ROOT%{_libdir}/*.la

#check
#cd %{_target_platform}
#make cl_test
#make test

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc APACHE.license AUTHORS ChangeLog COPYING LGPL.license README
%{_libdir}/libclucene*.so.*

%files devel
%defattr(-,root,root)
%dir %{_includedir}/CLucene
%dir %{_libdir}/CLucene
%{_includedir}/CLucene/*
%{_includedir}/CLucene.h
%{_libdir}/libclucene*.so
%{_libdir}/CLucene/clucene-config.h
%{_libdir}/CLucene/CLuceneConfig.cmake
%{_libdir}/pkgconfig/libclucene-core.pc

%changelog
* Sun Jul 10 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.3.3.4-2
- rebuild with gcc-5.4.0

* Sat Sep 24 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.3.3.4-1
- new upstream release

* Mon Oct 19 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.9.21b-2
- run make check at %%check

* Tue Dec  9 2008 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 0.9.21b-1
- new upstream release

* Sat Mar 29 2008 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 0.9.20-1
- fix release

* Mon Nov 19 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 0.9.20-0vl2
- stop moving clucene-config.h from %%{_libdir}/CLucene

* Thu Oct 11 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 0.9.20-0vl1
- new upstream release

* Sat Jul 28 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 0.9.19-0vl1
- new upstream release

* Mon May 14 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 0.9.16a-0vl1
- initial release
