%global systemd_units tracker-extract-3.service tracker-miner-fs-3.service tracker-miner-fs-control-3.service tracker-writeback-3.service

Name:           tracker3-miners
Version:        3.0.5
Release:        3
Summary:        One of two parts of tracker mainly contains the indexer daemon and tools. 

License:        GPLv2+ and LGPLv2+
URL:            https://wiki.gnome.org/Projects/Tracker
Source0:        https://download.gnome.org/sources/tracker-miners/3.0/tracker-miners-%{version}.tar.xz
Source1: 	tracker3-miners.conf

BuildRequires:  asciidoc libxslt coreutils glib2 glib2-devel gcc giflib-devel meson systemd
BuildRequires:  pkgconfig(tracker-sparql-3.0) pkgconfig(tracker-testutils-3.0)
BuildRequires:	pkgconfig(dbus-1) pkgconfig(exempi-2.0)
BuildRequires:	pkgconfig(gexiv2) pkgconfig(gio-2.0) pkgconfig(gio-unix-2.0) pkgconfig(glib-2.0)
BuildRequires:	pkgconfig(gmodule-2.0) pkgconfig(gobject-2.0) pkgconfig(gstreamer-1.0)
BuildRequires:	pkgconfig(gstreamer-audio-1.0) pkgconfig(gstreamer-pbutils-1.0) pkgconfig(gstreamer-tag-1.0)
BuildRequires:	pkgconfig(gupnp-dlna-2.0) pkgconfig(gupnp-dlna-gst-2.0) pkgconfig(icu-i18n) pkgconfig(icu-uc)
BuildRequires:	pkgconfig(libexif) pkgconfig(libgsf-1) pkgconfig(libgxps) 
BuildRequires:	pkgconfig(libiptcdata) pkgconfig(libjpeg) pkgconfig(libosinfo-1.0) pkgconfig(libpng)
BuildRequires:	pkgconfig(libseccomp) pkgconfig(libtiff-4) pkgconfig(libxml-2.0) pkgconfig(poppler-glib)
BuildRequires:	pkgconfig(totem-plparser) pkgconfig(upower-glib) pkgconfig(libnm)
BuildRequires:	pkgconfig(enca) pkgconfig(systemd) chrpath

%{?systemd_requires}
Requires:       tracker3%{?_isa}

%description
Tracker is an efficient search engine and for desktop, embedded
and mobile.

tracker-miners contains the indexer daemon (*tracker-miner-fs*)
and tools to extract metadata from many different filetypes.

this is for version 3 series.

%prep
%autosetup -n tracker-miners-%{version} -p1

%build
%meson \
  -Dtracker_core=system \
  -Dcue=disabled \
  -Dminer_rss=false \
  -Dsystemd_user_services_dir=%{_userunitdir} \
  %{nil}

%meson_build

%install
%meson_install

%find_lang tracker3-miners
chrpath -d %{buildroot}%{_libexecdir}/tracker-*
chrpath -d %{buildroot}%{_libexecdir}/tracker3/*
chrpath -d %{buildroot}%{_libdir}/tracker-miners-3.0/libtracker-miner-3.0.so

install -d %{buildroot}%{_sysconfdir}/ld.so.conf.d
install -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf

%post
%systemd_user_post %{systemd_units}
/sbin/ldconfig

%preun
%systemd_user_preun %{systemd_units}

%postun
%systemd_user_postun_with_restart %{systemd_units}
/sbin/ldconfig

%files -f tracker3-miners.lang
%license COPYING*
%doc AUTHORS NEWS README.md
%config(noreplace) %{_sysconfdir}/xdg/autostart/tracker-miner-fs-3.desktop
%{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf
%{_libdir}/tracker-miners-3.0/
%{_libexecdir}/tracker*
%{_datadir}/dbus-1/interfaces/org.freedesktop.Tracker3.Miner*.xml
%{_datadir}/dbus-1/services/org.freedesktop.Tracker*
%{_datadir}/glib-2.0/schemas/*
%{_datadir}/tracker3-miners/
%{_mandir}/man1/tracker*.1*
%{_userunitdir}/tracker*.service


%changelog
* Thu Sep 23 2021 weijin deng <weijin.deng@turbolinux.com.cn> - 3.0.5-3
- Add dynamic library search path with file

* Thu Sep 09 2021 sunguoshuai <sunguoshuai@huawei.com> - 3.0.5-2
- del rpath in some binaries

* Thu Jun 17 2021 weijin deng <weijin.deng@turbolinux.com.cn> - 3.0.5-1
- Package init with version 3.0.5
