%bcond_with systemd

%define _unpackaged_files_terminate_build 1

Summary: An object database, tag/metadata database, search tool and indexer
Summary(ja): オブジェクト/タグ/メタデータデータベースおよび検索ツール
Name: tracker
Version: 3.1.1
Release: 1%{?_dist_release}%{?with_systemd:.systemd}
Group: desktop-gnome,accesories
Vendor: Project Vine
Distribution: Vine Linux

License: GPL
URL: https://gnome.pages.gitlab.gnome.org/tracker/
%define major_minor %(echo %{version} | cut -d . -f 1-2)
Source0: https://download.gnome.org/sources/tracker/%{major_minor}/tracker-%{version}.tar.xz

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires:  asciidoc
BuildRequires:  gettext
BuildRequires:  gtk-doc
BuildRequires:  meson
BuildRequires:  vala
BuildRequires:  dbus-devel
BuildRequires:  pkgconfig(gobject-introspection-1.0)
BuildRequires:  pkgconfig(icu-i18n)
BuildRequires:  pkgconfig(icu-uc)
BuildRequires:  pkgconfig(json-glib-1.0)
BuildRequires:  pkgconfig(libsoup-2.4)
BuildRequires:  pkgconfig(libxml-2.0)
BuildRequires:  pkgconfig(sqlite3)
BuildRequires:  /bin/dbus-run-session
%if %{with systemd}
BuildRequires:  systemd
%endif
%if %{with systemd}
%global systemd_units tracker-xdg-portal-3
%{?systemd_requires}
%endif

Obsoletes: %{name}-libs < 2.0.0
Obsoletes: %{name}-search-tool < 2.0.0
Provides: %{name}-libs = %{version}-%{release}
Provides: %{name}-search-tool = %{version}-%{release}

%description
Tracker is a powerful desktop-neutral first class object database,
tag/metadata database, search tool and indexer. 

It consists of a common object database that allows entities to have an
almost infinte number of properties, metadata (both embedded/harvested as
well as user definable), a comprehensive database of keywords/tags and
links to other entities.

It provides additional features for file based objects including context
linking and audit trails for a file object.

It has the ability to index, store, harvest metadata. retrieve and search  
all types of files and other first class objects

%package devel
Summary: Headers for developing programs that will use %{name}
Group: programming
Requires: %{name} = %{version}-%{release}

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


%package -n     libtracker-sparql
Summary:        Tracker SPARQL library
Group:          system
License:        LGPLv2+
Recommends:     %{name}%{?_isa} = %{version}-%{release}

%description -n libtracker-sparql
This package contains the libtracker-sparql library.


%package docs
Summary: Documentation for tracker
Group: documentation
BuildArch: noarch
Obsoletes: %{name}-doc < 0.15.0
Provides: %{name}-doc = 0.15.0

%description docs
This package contains documentation for tracker.


%debug_package


%prep
%setup -q


%build
%meson \
	-Dunicode_support=icu \
	-Dstemmer=disabled \
%if %{with systemd}
	-Dsystemd_user_services=true \
%else
	-Dsystemd_user_services=false \
%endif
	-Ddocs=true

%meson_build


%install
rm -rf %{buildroot}
export LANG=ja_JP.UTF-8
%meson_install

%find_lang %{name}3

%if !%{with systemd}
rm -rf %{buildroot}/usr/lib/systemd
%endif


%clean
rm -rf %{buildroot}


%if %{with systemd}
%post
%systemd_user_post %{systemd_units}
%endif

%if %{with systemd}
%preun
%systemd_user_preun %{systemd_units}
%endif
  
%if %{with systemd}
%postun
%systemd_user_postun_with_restart %{systemd_units}
%endif


%files -f %{name}3.lang
%defattr(-, root, root, -)
%license COPYING COPYING.LGPL
%doc AUTHORS NEWS README.md
%{_bindir}/tracker3
%{_libexecdir}/tracker3/
%{_libexecdir}/tracker-xdg-portal-3
%dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/tracker3
%{_datadir}/dbus-1/services/org.freedesktop.portal.Tracker.service
%{_mandir}/man1/tracker*.1*
%if %{with systemd}
%{_userunitdir}/tracker-xdg-portal-3.service
%endif

%files -n libtracker-sparql
%license COPYING COPYING.LGPL
%dir %{_libdir}/girepository-1.0
%{_libdir}/girepository-1.0/Tracker-3.0.typelib
%{_libdir}/libtracker-sparql-3.0.so.0*
%{_datadir}/tracker3/

%files devel
%defattr(-, root, root, -)
%{_includedir}/tracker-3.0/
%{_libdir}/libtracker-sparql-3.0.so
%{_libdir}/pkgconfig/*.pc
%dir %{_libdir}/tracker-3.0
%{_libdir}/tracker-3.0/trackertestutils/
%dir %{_datadir}/vala
%dir %{_datadir}/vala/vapi
%{_datadir}/vala/vapi/tracker-sparql-3.0.*
%dir %{_datadir}/gir-1.0
%{_datadir}/gir-1.0/Tracker-3.0.gir

%files docs
%license docs/reference/COPYING
%dir %{_datadir}/gtk-doc
%dir %{_datadir}/gtk-doc/html
%{_datadir}/gtk-doc/html/libtracker-sparql-3/
%{_datadir}/gtk-doc/html/ontology-3/


%changelog
* Fri Apr 09 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.1.1-1
- new upstream release.
- built with icu69.

* Mon Mar 29 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.1.0-1
- new upstream release.

* Fri Apr 24 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.3.4-1
- new upstream release.
- built with icu-67.

* Fri Mar 20 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.2.2-3
- rebuilt with icu-66.

* Sun Oct 13 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.2.2-2
- rebuilt with icu-65.

* Sun Sep 01 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.2.2-1
- new upstream release.
- dropped Patch0.

* Sat Dec 29 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.1.6-1
- new upstream release.
- dropped all patches.
- added Patch0.
- dropped subpackages "libs" and "search-tool".

* Mon Jan 08 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.12.4-1
- new upstream release.

* Sun Jul 17 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.8.0-1
- new upstream release

* Sat Dec 19 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.6.1-1
- new upstream release

* Sun Nov 01 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.6.0-1
- new upstream release

* Sun Aug 30 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.4.1-1
- new upstream release

* Sun May 10 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.4.0-2
- remove *.la files

* Sun Mar 29 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.4.0-1
- new upstream release
- add BuildRequires: libmediaart-devel, libvorbis-devel, flac-devel

* Mon Dec 22 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.2.5-1
- new upstream release

* Sun Nov 09 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.2.4-1
- new upstream release
- add Patch1 (tracker-1.2.3-revert-error_message.patch)

* Sun Sep 21 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.4-2
- rebuild with upower-0.99.1

* Sun Sep 14 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.4-1
- new upstream release

* Sun Aug 31 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.3-1
- new upstream release

* Tue Jul 08 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.1-3
- rebuild with poppler-0.26.2

* Sun Jul 06 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.1-2
- rebuild with libarchive-3.1.2

* Fri May 16 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.1-1
- new upstream release

* Sat May 03 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.0-2
- rebuild with poppler-0.24.5

* Sat Mar 29 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.0-1
- new upstream release

* Tue Dec 31 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.16.4-2
- rebuild with VineSeed environment

* Sun Nov 24 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.16.4-1
- new upstream release

* Sat Nov 09 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.16.3-1
- new upstream release

* Sat Oct 26 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.16.2-2
- rebuild with icu-51.2

* Sun Aug 11 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.16.2-1
- new upstream release

* Sun May 19 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.16.1-1
- new upstream release

* Sun Apr 21 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.16.0-1
- new upstream release
- remove BuildRequires: gnome-panel-devel, gnome-applets
- change BuildRequires: gstreamer1-devel instead of gstreamer-devel
- add BuildRequires: libjpeg-turbo-devel, giflib-devel, libtiff-devel, exempi-devel, enca-devel, taglib-devel, libgxps-devel
- change BuildRequires: gstreamer1-plugins-base-devel instead of gstreamer-plugins-base-devel
- change to %%{name}-docs subpackage from %%{name}-docs

* Sun Feb 17 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.14.5-1
- new upstream release

* Fri Nov 02 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.14.4-1
- new upstream release

* Fri Oct 26 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.14.3-1
- new upstream release

* Sat Sep 15 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.14.2-2
- create -libs subpackage
- add BuildRequires: firefox, thunderbird

* Sun Jul 08 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.14.2-1
- new upstream release

* Sun May 06 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.14.1-1
- new upstream release

* Wed Apr 18 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.14.0-1
- new upstream release

* Wed Dec 28 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.12.9-1
- new upstream release

* Thu Nov 03 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.12.7-1
- new upstream release

* Sat Oct 08 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.12.4-1
- new upstream release
- create %%{name}-doc sub package

* Fri Sep 30 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.12.3-1
- new upstream release
- add Patch0 (tracker-0.12.3-sched.patch)

* Fri Sep 23 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.12.2-1
- new upstream release
- add BuildRequires: gstreamer-devel, gstreamer-plugins-base-devel, NetworkManager-glib-devel
- drop Patch0

* Sat Sep 03 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.10.25-1
- new upstream release

* Sun Aug 21 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.10.23-1
- new upstream release

* Wed Jul 06 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.10.22-1
- new upstream release
- add BuildRequires: libicu-devel

* Thu May 05 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.8.18-1
- new upstream release
- add Patch0 (tracker-0.8.18-tracker_spawn.patch)
- delete Patch1

* Sat Mar 12 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.8.16-3
- rebuilt with poppler-0.16.3

* Sat Oct 09 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.8.16-2
- rebuild with poppler-0.14.2

* Sun Aug 22 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.8.16-1
- new upstream release
- add BuildRequires: glib2-devel, gtk2-devel, gnome-panel-devel, libgee-devel
- add configure option (--enable-tracker-search-bar)

* Sun Jul 18 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.8.15-1
- new upstream release

* Sat Jun 26 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.8.13-1
- new upstream release
- fix URL of Source0

* Mon Jun 21 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.8.12-1
- new upstream release

* Sun Jun 13 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.8.11-1
- new upstream release

* Sun May 30 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.8.9-1
- new upstream release
- fix %install and %files (make /etc/ld.so.conf.d/tracker-%{_arch}.conf)

* Sun May 16 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.8.6-1
- new upstream release

* Sun Apr 25 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.8.3-1
- new upstream release
- add BuildRequires: upower-devel, gnome-applets
- change BuildRequires: dbus-glib -> dbus-glib-devel

* Sun Mar 21 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.8.0-1
- new upstream release
- add BuildRequires: libgnome-devel, libgnomeui-devel, libSM-devel, libnotify-devel, libuuid-devel, libgee-devel
- fix BuildRequires: gmime-devel >= 2.4
- add configure option (--enable-tracker-search-tool)

* Mon Mar 23 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 0.6.91-1
- new upstream release

* Sun Dec 14 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.6.6-2
- rebuild with poppler-0.10.2
- spec in UTF-8

* Mon Mar 31 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.6.6-1
- new upstream release
- update Patch1
- drop Patch10 (no more necessary)
- add %%{_sysconfdir}/xdg/autostart/tracker-applet.desktop
- remove --enable-external-sqlite option (no more bundled sqlite exist)
- apply new versioning policy

* Mon Sep 10 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 0.6.2-0vl1
- new upstream release

* Sun Apr 29 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 0.5.4-0vl2
- add Patch10 to fix selecting video-extractor
- use external video extractor(totem) instead of gstreamer/xine

* Sun Apr 29 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 0.5.4-0vl1
- initial build for Vine Linux

* Fri Mar 30 2007 Deji Akingunola <dakingun@gmail.com> - 0.5.4-6
- Ship both autostart desktop files in the main package (BZ #233323)

* Tue Feb 13 2007 Deji Akingunola <dakingun@gmail.com> - 0.5.4-3
- Package the deskbar plugin properly (BZ #228308)

* Mon Jan 29 2007 Deji Akingunola <dakingun@gmail.com> - 0.5.4-2
- Split out tracker-search-tool sub-packages, for the GUI facility
- Add proper requires for the -devel subpackage
- Deal with the rpmlint complaints on rpath

* Sat Jan 27 2007 Deji Akingunola <dakingun@gmail.com> - 0.5.4-1
- Update to 0.5.4

* Tue Dec 26 2006 Deji Akingunola <dakingun@gmail.com> - 0.5.3-1
- Update to 0.5.3

* Mon Nov 27 2006 Deji Akingunola <dakingun@gmail.com> - 0.5.2-2
- Apply patch on Makefile.am instead of Makefile.in
- Add libtool to BR

* Mon Nov 06 2006 Deji Akingunola <dakingun@gmail.com> - 0.5.2-1
- Update to 0.5.2

* Mon Nov 06 2006 Deji Akingunola <dakingun@gmail.com> - 0.5.1-1
- Update to new version

* Mon Nov 06 2006 Deji Akingunola <dakingun@gmail.com> - 0.5.0-7
- Have the devel subpackage require pkgconfig
- Make the description field not have more than 76 characters on a line
- Fix up the RPM group

* Mon Nov 06 2006 Deji Akingunola <dakingun@gmail.com> - 0.5.0-6
- Explicitly require dbus-devel and dbus-glib (needed for FC < 6) 

* Sun Nov 05 2006 Deji Akingunola <dakingun@gmail.com> - 0.5.0-5
- Remove unneeded BRs (gnome-utils-devel and openssl-devel) 

* Sun Nov 05 2006 Deji Akingunola <dakingun@gmail.com> - 0.5.0-4
- Add autostart desktop file.
- Edit the package description as suggested in review

* Sat Nov 04 2006 Deji Akingunola <dakingun@gmail.com> - 0.5.0-3
- More cleaups to the spec file.

* Sat Nov 04 2006 Deji Akingunola <dakingun@gmail.com> - 0.5.0-2
- Add needed BRs

* Sat Nov 04 2006 Deji Akingunola <dakingun@gmail.com> - 0.5.0-1
- Initial packaging for Fedora Extras
