%define build_vine5 0
%define build_vine6 0

%if "%{?_dist_release}" == "vl5"
%define build_vine5 1
%endif
%if "%{?_dist_release}" == "vl6"
%define build_vine6 1
%endif

Summary:	HTML pages thumbnailer
Summary(ja):	HTML ページのサムネール作成ツール
Name:		gnome-web-photo
Version:	0.9
Release:	4%{?_dist_release}
License:	LGPLv2+
Group:		Applications/Internet
URL:		http://ftp.gnome.org/pub/GNOME/sources/gnome-web-photo/%{version}/
Source0:	http://ftp.gnome.org/pub/GNOME/sources/gnome-web-photo/%{version}/%{name}-%{version}.tar.bz2
Patch0:		gnome-web-photo-xulrunner192.patch

BuildRoot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Requires(post):	GConf2
Requires(preun):GConf2
Requires:	gecko-libs >= 1.9
BuildRequires:	gtk2-devel >= 2.10.0
BuildRequires:	libxml2-devel
BuildRequires:	gnome-vfs2-devel
BuildRequires:	gecko-devel >= 1.9
BuildRequires:	gecko-devel-unstable >= 1.9
BuildRequires:	libjpeg-devel
BuildRequires:	gettext intltool

Packager:	kazutaka

%description
gnome-web-photo contains a thumbnailer that will be used by 
GNOME applications, including the file manager, to generate
screenshots of web pages.

%prep
%setup -q

%if %{build_vine6}
%patch0 -p1 -b .xulrunner192
%endif

%build
%configure
%{__make} %{?_smp_mflags}

%install
%{__rm} -rf $RPM_BUILD_ROOT
export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1
%{__make} DESTDIR=$RPM_BUILD_ROOT install
unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL

%{__mv} $RPM_BUILD_ROOT/%{_sysconfdir}/gconf/schemas/thumbnailer.schemas \
	$RPM_BUILD_ROOT/%{_sysconfdir}/gconf/schemas/gnome-web-photo.schemas

%find_lang %{name}

%post
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-install-rule \
	%{_sysconfdir}/gconf/schemas/gnome-web-photo.schemas >& /dev/null

%pre
if [ "$1" -gt 1 ]; then
    export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
    gconftool-2 --makefile-uninstall-rule 				\
	%{_sysconfdir}/gconf/schemas/gnome-web-photo.schemas 		\
	>& /dev/null || :
fi

%preun
if [ "$1" -eq 0 ]; then
    export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
    gconftool-2 --makefile-uninstall-rule \
      %{_sysconfdir}/gconf/schemas/gnome-web-photo.schemas >& /dev/null
fi

%clean
%{__rm} -rf $RPM_BUILD_ROOT

%files -f %{name}.lang
%defattr(-,root,root,-)
%doc ChangeLog AUTHORS README TODO COPYING.README
%{_sysconfdir}/gconf/schemas/gnome-web-photo.schemas
%{_bindir}/gnome-web-photo
%{_bindir}/gnome-web-print
%{_bindir}/gnome-web-thumbnail
%{_datadir}/gnome-web-photo

%changelog
* Sat Apr 17 2010 Kazutaka HARADA <kazutaka@vinelinux.org> 0.9-4
- remove %%{gecko_version} macro and specify explicit minimum version 

* Sat Mar 06 2010 Kazutaka HARADA <kazutaka@vinelinux.org> 0.9-3
- rebuild with xulrunner-%{gecko_version}

* Wed Jan 27 2010 Kazutaka HARADA <kazutaka@vinelinux.org> 0.9-2
- rebuild with xulrunner-%{gecko_version}
- add Patch0 to fix xulrunner-1.9.2 build

* Fri Jan 15 2010 Kazutaka HARADA <kazutaka@vinelinux.org> 0.9-1
- new upstream release
- build with xulrunner-1.9.1.7 (gecko-libs)

* Thu Nov 05 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.8-1
- initial build for Vine Linux based on fedora development

* Fri Sep 11 2009 Jan Horak <jhorak@redhat.com> - 0.8-6
- Rebuild against newer gecko

* Thu Aug 06 2009 Jan Horak <jhorak@redhat.com> - 0.8-5
- Rebuild against newer gecko

* Tue Aug 04 2009 Jan Horak <jhorak@redhat.com> - 0.8-4
- Rebuild against newer gecko

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Mon Jul 20 2009 Jan Horak <jhorak@redhat.com> - 0.8-2
- Rebuild against newer gecko

* Tue Jun 30 2009 Matthias Clasen <mclasen@redhat.com> - 0.8-1
- Update to 0.8

* Mon Apr 27 2009 Christopher Aillon <caillon@redhat.com> - 0.7-2
- Rebuild against newer gecko

* Mon Apr 13 2009 Matthias Clasen <mclasen@redhat.com> - 0.7-1
- Update to 0.7

* Tue Mar 24 2009 Jan Horak <jhorak@redhat.com> - 0.6-2
- Fix for rebuild against newer gecko

* Tue Mar 17 2009 Matthias Clasen <mclasen@redhat.com> - 0.6-1
- Update to 0.6

* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Tue Jan 06 2009 Christopher Aillon <caillon@redhat.com> - 0.3-13
- Rebuild against newer gecko

* Wed Nov 12 2008 Christopher Aillon <caillon@redhat.com> - 0.3-12
- Rebuild against newer gecko

* Wed Mar 12 2008 Marco Pesenti Gritti <mpg@redhat.com> - 0.3-11
- Better xulrunner-1.9 patch which also works with very long pages

* Fri Mar  7 2008 Marco Pesenti Gritti <mpg@redhat.com> - 0.3-10
- Add patch to make it work with xulrunner 1.9

* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 0.3-9
- Autorebuild for GCC 4.3

* Tue Nov 27 2007 Christopher Aillon <caillon@redhat.com> - 0.3-8
- Rebuild against newer gecko

* Fri Nov 23 2007 - Bastien Nocera <bnocera@redhat.com> - 0.3-7
- Rebuilding against xulrunner will require a lot of porting,
  disable for now

* Fri Nov 16 2007 - Bastien Nocera <bnocera@redhat.com> - 0.3-6
- Try to rebuild with xulrunner

* Thu Oct 25 2007 - Bastien Nocera <bnocera@redhat.com> - 0.3-5
- Rebuild for new Gecko, tighten dependencies

* Mon Sep 10 2007 - Bastien Nocera <bnocera@redhat.com> - 0.3-4
- Fix license, as mentioned by Kevin Fenzi

* Thu Sep 06 2007 - Bastien Nocera <bnocera@redhat.com> - 0.3-3
- Update following Matthias Clasen's comments

* Wed Sep 05 2007 - Bastien Nocera <bnocera@redhat.com> - 0.3-2
- Update following Peter Gordon's comments

* Tue Mar 20 2007 - Bastien Nocera <bnocera@redhat.com> - 0.3-1
- First post!

