Summary:	Simply a document viewer for MATE
Name:		mate-document-viewer
Version:	1.4.0
Release:	1%{?_dist_release}
Source0:	http://pub.mate-desktop.org/releases/1.4/%{name}-%{version}.tar.xz
License:	GPLv2
Group:		Applications/Publishing
URL:		http://mate-desktop.org/

BuildRequires:	mate-common
BuildRequires:	mate-doc-utils
BuildRequires:	mate-conf-devel
BuildRequires:	mate-icon-theme
BuildRequires:	mate-file-manager-devel
BuildRequires:	libmatekeyring-devel
BuildRequires:	gtk2-devel
BuildRequires:	libxml2-devel
BuildRequires:	libSM-devel
BuildRequires:	poppler-devel
BuildRequires:	libtiff-devel
BuildRequires:	djvulibre-devel
BuildRequires:	libspectre-devel
BuildRequires:	libkpathsea-devel
BuildRequires:	gtk-doc
BuildRequires:	autoconf
BuildRequires:	automake

Requires(post,pre,preun):	mate-conf
Requires(post,postun):	desktop-file-utils

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

Vendor:		Project Vine
Distribution:	Vine Linux
Packager:	Takemikaduchi


%description
he MATE Display Manager is a system service that is responsible for
providing graphical log-ins and managing local and remote displays.


%package	devel
Summary:        Development tools for mate-document-viewer
Summary(ja):    mate-document-viewer の開発環境
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}
Requires:       pkgconfig

%description	devel
Header files and libraries for building a extension library for the
mate-document-viewer.


%prep
%setup -q


%build
(if ! test -x configure; then NOCONFIGURE=1 ./autogen.sh; fi)
%configure \
	--libexecdir=%{_libexecdir}/mate \
	--disable-static \
	--disable-scrollkeeper

%{__make} %{?_smp_mflags}


%install
%{__rm} -rf ${RPM_BUILD_ROOT}

export MATECONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1
%{__make} install DESTDIR=${RPM_BUILD_ROOT}
unset MATECONF_DISABLE_MAKEFILE_SCHEMA_INSTALL

find $RPM_BUILD_ROOT -name '*.a' -exec rm -f {} \;
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} \;

%find_lang atril


%clean
%{__rm} -rf ${RPM_BUILD_ROOT}

%post
/sbin/ldconfig

export MATECONF_CONFIG_SOURCE=`mateconftool-2 --get-default-source`

SCHEMAS=" \
  atril-thumbnailer-comics.schemas \
  atril-thumbnailer-djvu.schemas \
  atril-thumbnailer-dvi.schemas \
  atril-thumbnailer-ps.schemas \
  atril-thumbnailer.schemas"
for S in $SCHEMAS; do
  echo %{_sysconfdir}/mateconf/schemas/$S; done \
  | xargs mateconftool-2 --makefile-install-rule >& /dev/null ||:

update-desktop-database %{_datadir}/applications >& /dev/null ||:
touch --no-create %{_datadir}/icons/hicolor
if [ -x /usr/bin/gtk-update-icon-cache ]; then
  /usr/bin/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor ||:
fi


%pre
if [ "$1" -gt 1 ]; then
  export MATECONF_CONFIG_SOURCE=`mateconftool-2 --get-default-source`

  SCHEMAS=" \
    atril-thumbnailer-comics.schemas \
    atril-thumbnailer-djvu.schemas \
    atril-thumbnailer-dvi.schemas \
    atril-thumbnailer-ps.schemas \
    atril-thumbnailer.schemas"
  for S in $SCHEMAS; do
    echo %{_sysconfdir}/mateconf/schemas/$S; done \
    | xargs mateconftool-2 --makefile-uninstall-rule >& /dev/null ||:
fi

%preun
if [ "$1" -eq 0 ]; then
  export MATECONF_CONFIG_SOURCE=`mateconftool-2 --get-default-source`

  SCHEMAS=" \
    atril-thumbnailer-comics.schemas \
    atril-thumbnailer-djvu.schemas \
    atril-thumbnailer-dvi.schemas \
    atril-thumbnailer-ps.schemas \
    atril-thumbnailer.schemas"
  for S in $SCHEMAS; do
    echo %{_sysconfdir}/mateconf/schemas/$S; done \
    | xargs mateconftool-2 --makefile-uninstall-rule >& /dev/null ||:
fi

%postun
/sbin/ldconfig
update-desktop-database %{_datadir}/applications >& /dev/null ||:
touch --no-create %{_datadir}/icons/hicolor
if [ -x /usr/bin/gtk-update-icon-cache ]; then
  /usr/bin/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor ||:
fi
if [ $1 -eq 0 ]; then
  glib-compile-schemas %{_datadir}/glib-2.0/schemas ||:
fi

%posttrans
glib-compile-schemas %{_datadir}/glib-2.0/schemas ||:


%files -f atril.lang
%defattr(-,root,root,-)
%doc COPYING ChangeLog NEWS README
%{_sysconfdir}/mateconf/schemas/atril-thumbnailer-comics.schemas
%{_sysconfdir}/mateconf/schemas/atril-thumbnailer-djvu.schemas
%{_sysconfdir}/mateconf/schemas/atril-thumbnailer-dvi.schemas
%{_sysconfdir}/mateconf/schemas/atril-thumbnailer-ps.schemas
%{_sysconfdir}/mateconf/schemas/atril-thumbnailer.schemas
%{_bindir}/atril
%{_bindir}/atril-previewer
%{_bindir}/atril-thumbnailer
%{_libdir}/libatrildocument.so.*
%{_libdir}/libatrilview.so.*
%{_libdir}/atril
%{_libdir}/caja/extensions-2.0/libatril-properties-page.so
%{_libexecdir}/mate/atril-convert-metadata
%{_libexecdir}/mate/atrild
%{_datadir}/MateConf/gsettings/atril.convert
%{_datadir}/applications/atril.desktop
%{_datadir}/atril
%{_datadir}/dbus-1/services/org.mate.atril.Daemon.service
%{_datadir}/glib-2.0/schemas/org.mate.Atril.gschema.xml
%{_datadir}/icons/hicolor/*/*/*
%{_datadir}/mate/help/atril
%{_datadir}/omf/atril
%{_mandir}/man1/atril.1.gz

%files devel
%defattr(-,root,root,-)
%{_includedir}/atril
%{_libdir}/libatrildocument.so
%{_libdir}/libatrilview.so
%{_libdir}/pkgconfig/atril-document-2.32.pc
%{_libdir}/pkgconfig/atril-view-2.32.pc


%changelog
* Thu Aug 02 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.4.0-1
- new upstream release

* Sat May 12 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.2.1-1
- new upstream release

* Fri Dec 23 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.1.0-2
- change category

* Fri Dec 23 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.1.0-1
- initial build for Vine Linux

