Name:             xapian-core
Version:          1.4.23
Release:          1
Summary:          An Open Source Probabilistic Information Retrieval Library
License:          GPLv2+
URL:              http://www.xapian.org/
Source0:          http://www.oligarchy.co.uk/xapian/%{version}/%{name}-%{version}.tar.xz

BuildRequires:    gcc-c++ libuuid-devel zlib-devel
%ifarch %{valgrind_arches}
BuildRequires: valgrind-devel
%endif
Provides:         %{name}-libs = %{version}-%{release}
Obsoletes:        %{name}-libs < %{version}-%{release}

%description
Xapian is an Open Source Search Engine Library, released under the GPL v2+.
It is a highly adaptable toolkit which allows developers to easily add advanced
indexing and search facilities to their own applications. It has built-in
support for several families of weighting models and also supports a rich set
of boolean query operators.

%package help
Summary:        Help documentation for the %{name}

%description help
Help documentation for the %{name}.

%package devel
Summary:          Files needed for building packages which use Xapian
Requires:         %{name} = %{version}-%{release}
Requires:         libuuid-devel

%description devel
Xapian is an Open Source Search Engine Library, released under the GPL v2+.
It is a highly adaptable toolkit which allows developers to easily add advanced
indexing and search facilities to their own applications. It has built-in
support for several families of weighting models and also supports a rich set
of boolean query operators.This package provides the files needed for building
packages which use Xapian.

%prep
%autosetup -p1

%build
%configure --disable-static \
%ifnarch x86_64
--disable-sse
%endif

sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
%make_build V=1

%install
%make_install
%delete_la
rm -rf %{buildroot}%{_datadir}/doc/%{name}

%post
/sbin/ldconfig

%postun
/sbin/ldconfig

%files
%doc AUTHORS COPYING
%{_bindir}/*
%{_datadir}/xapian-core/
%{_libdir}/libxapian.so.*


%files devel
%doc HACKING PLATFORMS docs/*html docs/apidoc
%{_libdir}/libxapian.so
%{_libdir}/cmake/xapian
%{_libdir}/pkgconfig/xapian-core.pc
%{_datadir}/aclocal/xapian.m4
%{_includedir}/xapian*

%files help
%doc NEWS README
%{_mandir}/man1/*


%changelog
* Fri Oct 20 2023 Ge Wang <wang__ge@126.com> - 1.4.23-1
- Update to version 1.4.23

* Fri Jul 14 2023 xu_ping <707078654@qq.com> - 1.4.9-4
- Fix compilation failure caused by gcc12

* Wed Aug 26 2020 whoisxxx <zhangxuzhou4@huawei.com> - 1.4.9-3
- Judge arch before use valgrind

* Thu Dec 12 2019 likexin <likexin4@huawei.com> - 1.4.9-2
- package init
