%define gtk2_version 2.10.0
%define glib2_version 2.10.0
%define libxml_version 2.4.4
%define libgnome_version 2.6.0
%define libgnomeui_version 2.6.0
%define libgnomecanvas_version 2.6.0
%define libgnomevfs_version 2.6.0
%define libglade_version 2.4.0
%define libgnomeprint_version 2.6.0
%define libgnomeprintui_version 2.6.0
%define libbonobo_version 2.6.0
%define libbonoboui_version 2.6.0
%define libexif_version 0.6.13
%define desktop_file_utils_version 0.3
%define gnome_doc_utils_version 0.3.2

Summary: Image viewer, editor, organizer
Summary(ja): 画像閲覧、編集、管理ツール
Name: gthumb
Version: 2.10.11
Release: 1%{?_dist_release}
URL: http://gthumb.sourceforge.net/
Source0: http://ftp.gnome.org/pub/gnome/sources/%{name}/2.10/%{name}-%{version}.tar.bz2
License: GPL
Group: Applications/Multimedia
BuildRoot: %{_tmppath}/%{name}-%{version}-root

BuildRequires: gtk2-devel >= %{gtk2_version}
BuildRequires: glib2-devel >= %{glib2_version}
BuildRequires: libgnome-devel >= %{libgnome_version}
BuildRequires: libgnomeui-devel >= %{libgnomeui_version}
BuildRequires: libgnomecanvas-devel >= %{libgnomecanvas_version}
BuildRequires: gnome-vfs2-devel >= %{libgnomevfs_version}
BuildRequires: libxml2-devel >= %{libxml_version}
BuildRequires: libglade2-devel >= %{libglade_version}
BuildRequires: libgnomeprint-devel >= %{libgnomeprint_version}
BuildRequires: libgnomeprintui-devel >= %{libgnomeprintui_version}
BuildRequires: libbonobo-devel >= %{libbonobo_version}
BuildRequires: libbonoboui-devel >= %{libbonoboui_version}
BuildRequires: libpng-devel, libjpeg-devel, libtiff-devel
BuildRequires: libexif-devel >= %{libexif_version}
BuildRequires: gphoto2-devel
BuildRequires: desktop-file-utils >= %{desktop_file_utils_version}
BuildRequires: gnome-doc-utils >= %{gnome_doc_utils_version}
BuildRequires: libSM-devel
#BuildRequires: automake17, autoconf, libtool

Requires(post):   scrollkeeper, GConf2
#Requires(post):   desktop-file-utils >= %{desktop_file_utils_version}
Requires(preun):  GConf2
Requires(postun): scrollkeeper
#Requires(postun): desktop-file-utils >= %{desktop_file_utils_version}

%description
gthumb is an application for viewing, editing, and organizing 
collections of images.

%description -l ja
gthumb は画像ファイル集の閲覧、編集、管理をするためのアプリケーションです。

%prep
%setup -q

%build
%configure --disable-scrollkeeper --disable-schemas-install
make

%install
rm -rf $RPM_BUILD_ROOT

#export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1
%makeinstall
#unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL

rm -rf $RPM_BUILD_ROOT%{_localstatedir}/scrollkeeper
rm -f $RPM_BUILD_ROOT%{_libdir}/lib*.*a
rm -f $RPM_BUILD_ROOT%{_libdir}/gthumb/modules/lib*.*a
rm -f $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/icon-theme.cache

#desktop-file-install --vendor gnome --delete-original      \
#  --dir $RPM_BUILD_ROOT%{_datadir}/applications            \
#  $RPM_BUILD_ROOT%{_datadir}/applications/*

%find_lang %{name}

%clean
rm -rf $RPM_BUILD_ROOT

%post
scrollkeeper-update -q ||:
update-desktop-database -q ||:
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
SCHEMAS="gthumb.schemas"
for S in $SCHEMAS; do
  gconftool-2 --makefile-install-rule %{_sysconfdir}/gconf/schemas/$S > /dev/null ||:
done

%preun
if [ "$1" -gt 0 ] ; then
  export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
  SCHEMAS="gthumb.schemas"
  for S in $SCHEMAS; do
    gconftool-2 --makefile-uninstall-rule %{_sysconfdir}/gconf/schemas/$S > /dev/null ||:
  done
fi

%postun
scrollkeeper-update -q ||:
update-desktop-database -q ||:

%files -f %{name}.lang
%defattr(-,root,root)

%{_bindir}/*
%{_sysconfdir}/gconf/schemas/*
%{_libdir}/lib*.so
%{_libdir}/bonobo/servers/*.server
%{_libdir}/gthumb/modules/*
%{_datadir}/applications/*.desktop
%{_datadir}/gnome/help/gthumb
%{_datadir}/gthumb
%{_datadir}/icons/*
%{_datadir}/omf/gthumb
%{_mandir}/man1/*

%changelog
* Sun Jan 17 2010 Yoji TOYODA <bsyamato@sea.plala.ro.jp> 2.10.11-1
- new upstream release

* Fri Aug 15 2008 Shu KONNO <owa@bg.wakwak.com> 2.10.8-1vl5
- applied new versioning policy, spec in utf-8

* Sun Jan 13 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.10.8-0vl1
- new upstream release

* Sun Aug  5 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.10.5-0vl1
- new upstream release

* Sat Dec 23 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 2.6.9-0vl3
- fix dependencies:
  - add BuildRequires:
    - libgnome{,ui}-devel
    - libgnomecanvas-devel
    - gnome-vfs2-devel
    - libxml2-devel
    - libglade2-devel
    - libgnomeprint{,ui}-devel instead of libgnomeprint{,ui}
    - libbonobo{,ui}-devel
    - libpng-devel, libjpeg-devel, libtiff-devel, libexif-devel
  - drop BuildRequires: nautilus
  - drop Requires: scrollkeeper
  - add Requires(post): scrollkeeper, GConf2, desktop-file-utils
  - add Requires(pre): GConf2
  - add Requires(postun): scrollkeeper, desktop-file-utils
- fix scripts:
  - run scrollkeeper-update with '-q' at %%post,postun
  - run gconftool-2 --makefile-uninstall-rule at %%preun
  - run destop-database-update -q at %%post,postun

* Thu Aug 31 2006 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 2.6.9-0vl2
- rebuilt without gphoto2-devel

* Thu Mar 09 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 2.6.9-0vl1
- new upstream release

* Thu Oct 06 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 2.6.8-0vl1
- new upstream release

* Mon Nov 22 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 2.6.1-0vl1
- new upstream release

* Sun Jul 11 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 2.4.1-0vl1
- new upstream release

* Thu Apr  1 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 2.2.1-0vl1
- new upstream release

* Fri Dec 26 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 2.2.0-0vl1
- new upstream release

* Tue Jan 28 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0.1-0vl1
- new upstream release

* Tue Jan 21 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0.0-0vl1
- new upstream release
- build for Vine Linux
- add patch0 to use libgnomeprint-2.2

* Tue Jan  7 2003 Havoc Pennington <hp@redhat.com>
- 1.108
- disable schema install during makeinstall

* Thu Jan 02 2003 Florian La Roche <Florian.LaRoche@redhat.de>
- require scrollkeeper

* Mon Dec 16 2002 Havoc Pennington <hp@redhat.com>
- rebuild

* Thu Dec 12 2002 Havoc Pennington <hp@redhat.com>
- Initial build.


