Name: baloo
Summary: The file indexing and file search framework for KDE.
Summary(ja): ファイルのインデックス作成及び検索のフレームワーク
Version: 4.14.3
Release: 2%{?_dist_release}

License: GPLv2
Group: System Environment/Libraries
URL: https://community.kde.org/Baloo

Source: ftp://ftp.kde.org/pub/kde/stable/%{version}/src/%{name}-%{version}.tar.xz

BuildRoot: %{_tmppath}/%{name}-%{version}-root

BuildRequires: kdelibs-devel
BuildRequires: kdepimlibs-devel
BuildRequires: qjson-devel
BuildRequires: kfilemetadata-devel
BuildRequires: xapian-core-devel
BuildRequires: akonadi-devel

Vendor: Project Vine
Distribution: Vine Linux
Packager: Takemikaduchi

%description
Baloo is the file indexing and file search framework for KDE.
Baloo focuses on providing a very small memory footprint along with
with extremely fast searching. It internally uses a mixture of sqlite
along with Xapian to store the file index. 

%package libs
Summary: %{name} runtime libraries
Summary(ja): %{name} のラインタイムライブラリ
Group:   System Environment/Libraries
Requires: kdelibs >= %{version}

%description libs
%{summary}.

%package devel
Summary: Development files for kdepim
Summary(ja): %{name} の開発用ファイル
Group: Development/Libraries
Requires: %{name}-libs = %{version}-%{release}
Requires: kdelibs-devel

%description devel
Development files for %{name}.
Install %{name}-devel if you want to write or compile %{name} plugins.

%package akonadi
Summary: Akonadi runtime support for %{name}
Summary(ja): %{name} の Akonadi サポート
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
Requires: akonadi

%description akonadi
%{summary}.

%prep
%setup -q

%build
mkdir -p %{_target_platform}
pushd %{_target_platform}
%cmake \
    -DCMAKE_BUILD_TYPE=release \
    -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \
    -DDATA_INSTALL_DIR:PATH=%{_datadir}/kde4/apps \
    -DINCLUDE_INSTALL_DIR:PATH=%{_includedir}/kde4 \
    -DLIB_INSTALL_DIR:PATH=%{_libdir} \
    -DLIBEXEC_INSTALL_DIR:PATH=%{_libexecdir}/kde4 \
    -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \
    -DKDEPIM_BUILD_MOBILE:BOOL=OFF \
    ..
popd

make %{?_smp_mflags} -C %{_target_platform}

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

%post
touch --no-create %{_datadir}/icons/hicolor &> /dev/null ||:

%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &> /dev/null ||:

%postun
if [ $1 -eq 0 ] ; then
  touch --no-create %{_datadir}/icons/hicolor &> /dev/null ||:
  gtk-update-icon-cache %{_datadir}/icons/hicolor &> /dev/null ||:
fi

%post libs -p /sbin/ldconfig

%postun libs -p /sbin/ldconfig

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%doc COPYING COPYING.LIB
%config %{_sysconfdir}/dbus-1/system.d/org.kde.baloo.filewatch.conf
%{_bindir}/baloo_file
%{_bindir}/baloo_file_cleaner
%{_bindir}/baloo_file_extractor
%{_bindir}/balooctl
%{_bindir}/baloosearch
%{_bindir}/balooshow
%{_libdir}/kde4/*.so
%{_libexecdir}/kde4/kde_baloo_filewatch_raiselimit
%{_datadir}/autostart/baloo_file.desktop
%{_datadir}/dbus-1/interfaces/org.kde.baloo.file.indexer.xml
%{_datadir}/dbus-1/system-services/org.kde.baloo.filewatch.service
%{_datadir}/icons/hicolor/*/*/*
%{_datadir}/kde4/services/*
%{_datadir}/kde4/servicetypes/*
%{_datadir}/polkit-1/actions/*.policy

%files libs
%defattr(-,root,root,-)
%{_libdir}/lib*.so.*

%files devel
%defattr(-,root,root,-)
%{_includedir}/kde4/%{name}
%{_libdir}/lib*.so
%{_libdir}/cmake/Baloo/*.cmake

%files akonadi
%defattr(-,root,root,-)
%{_bindir}/akonadi_baloo_indexer
%{_libdir}/kde4/akonadi/akonadi_baloo_searchplugin.so
%{_libdir}/kde4/akonadi/akonadibaloosearchplugin.desktop
%{_datadir}/akonadi/agents/akonadibalooindexingagent.desktop

%changelog
* Mon Jul 04 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 4.14.3-2
- rebuild with gcc-5.4.0

* Thu Jan 01 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 4.14.3-1
- initial build 
