Name:           libzeitgeist
Summary:        Client library for applications that want to interact with the Zeitgeist daemon
Version:        0.3.18
Release:        3%{?_dist_release}

Group:          System Environment/Libraries
License:        LGPLv3 and GPLv3
URL:            https://launchpad.net/libzeitgeist

Source0:        http://launchpad.net/%{name}/0.3/%{version}/+download/%{name}-%{version}.tar.gz
Patch0:		libzeitgeist-disable-log-test.patch

# https://bugzilla.gnome.org/show_bug.cgi?id=704593
Patch1:         %{name}-tests-glib-2.40-envnull.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-root
BuildRequires:  glib2-devel gtk-doc
# zeitgeist is just a runtime and the reason to install libzeitgeist
#Requires:       zeitgeist

Vendor: Project Vine
Distribution: Vine Linux

%description
This project provides a client library for applications that want to interact
with the Zeitgeist daemon. The library is written in C using glib and provides
an asynchronous GObject oriented API.

%package        devel
Summary:        Development files for %{name}
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}

%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.


%package        vala
Summary:        Vala bindings for %{name}
Summary(ja):    %{name} の Vala バインディング
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}
Requires:       vala

%description    vala
Vala bindings for %{name}.


%prep
%setup -q
%patch0 -p1
%patch1 -p1

%build
%configure --disable-static
make V=1 %{?_smp_mflags}


%check
make check


%install
make install DESTDIR=%{buildroot} INSTALL="install -p"
install -d -p -m 755 %{buildroot}%{_datadir}/vala/vapi
install -D -p -m 644 bindings/zeitgeist-1.0.{vapi,deps} %{buildroot}%{_datadir}/vala/vapi
find %{buildroot} -name '*.la' -exec rm -f {} ';'

# remove duplicate documentation
rm -fr %{buildroot}%{_defaultdocdir}/%{name}


%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%defattr(-,root,root,-)
# documentation
%doc COPYING COPYING.GPL README
# essential
%{_libdir}/*.so.*


%files devel
%defattr(-,root,root,-)
# Documentation
%doc AUTHORS ChangeLog COPYING COPYING.GPL MAINTAINERS NEWS 
%doc examples/*.vala examples/*.c
%{_datadir}/gtk-doc/html/zeitgeist-1.0/
# essential
%{_includedir}/zeitgeist-1.0/
%{_libdir}/pkgconfig/zeitgeist-1.0.pc
%{_libdir}/*.so

%files vala
%defattr(-,root,root,-)
%{_datadir}/vala/vapi/


%changelog
* Sun Jul 17 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 0.3.18-3
- create %%{name}-vala subpackage
- add Patch1 (libzeitgeist-tests-glib-2.40-envnull.patch) from fedora

* Sat Jan 04 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 0.3.18-2
- rebuild with VineSeed environment

* Sat Sep 29 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 0.3.18-1
- new upstream release
- replace Patch0 (libzeitgeist-disable-log-test.patch) from fedora

* Sun Nov 20 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 0.3.12-1
- Initial package for Vine Linux

* Wed Apr 06 2011 Renich Bon ciric <renich@woralelandia.com> - 0.3.10-1
- Updated to version 0.3.10
- Fixed bugs:
    https://bugs.launchpad.net/ubuntu/+source/libzeitgeist/+bug/742438
- Renamed log fix patch to something more appropriate

* Sat Apr 02 2011 Renich Bon Ciric <renich@woralelandia.com> - 0.3.6-4
- Added -p to install statements (forgot some)
- Moved README to the main package from devel

* Fri Mar 25 2011 Renich Bon Ciric <renich@woralelandia.com> - 0.3.6-3
- Removed Rubys geo2 dependency since is not needed; it's provided by glibc-devel

* Thu Mar 24 2011 Renich Bon Ciric <renich@woralelandia.com> - 0.3.6-2
- Log test failure repaired by patch from Mamoru Tasaka

* Mon Mar 21 2011 Renich Bon Ciric <renich@woralelandia.com> - 0.3.6-1
- Updated to 0.3.6
- Implemented the isa macro for the devel subpackage.
- Eliminated the doc macro from gtk-doc since it gets marked automatically

* Sat Mar 12 2011 Renich Bon Ciric <renich@woralelandia.com> - 0.3.4-3
- Removed mistaken isa macro from zeitgeist require

* Thu Mar 10 2011 Renich Bon Ciric <renich@woralelandia.com> - 0.3.4-2
- Cleaned up old stuff (BuildRoot, Clean and stuff of sorts)
    https://fedoraproject.org/wiki/Packaging/Guidelines#BuildRoot_tag
    https://fedoraproject.org/wiki/Packaging/Guidelines#.25clean
- Added glib2-devel and gtk-doc as a BuildRequires
- Added GPLv3 since it covers the documentation examples
- Updated Requires to use the new arch specification macro when accordingly
    https://fedoraproject.org/wiki/Packaging/Guidelines#Requires
- Configured install to preserve timestamps
- Added V=1 to the make flags for more verbosity on build
- Added a check section
- Removed disable-module from configure statement since it's not needed anymore: 
    https://bugs.launchpad.net/libzeitgeist/+bug/683805

* Thu Feb 24 2011 Renich Bon Ciric <renich@woralelandia.com> - 0.3.4-1
- updated to latest version

* Sun Feb 06 2011 Renich Bon Ciric <renich@woralelandia.com> - 0.3.2-3
- got rid of INSTALL from docs
- got rid ot dorcdir and used doc to include html docs

* Sat Feb 05 2011 Renich Bon Ciric <renich@woralelandia.com> - 0.3.2-2
- removed duplicate documentation
- added the use of macros for everything; including source and build dir.
- revised path syntax

* Thu Jan 27 2011 - Renich Bon Ciric <renich@woralelandia.com> - 0.3.2-1
- First buildName:           libzeitgeist
