Name:           f-spot
Version:        0.8.2
Release:        2%{?_dist_release}
Summary:        Photo management application
Summary(ja):    写真管理アプリケーション

Group:          Applications/Multimedia
License:        GPLv2+ and LGPLv2+ and CPL and MIT
URL:            http://f-spot.org/
Source0:        http://ftp.gnome.org/pub/gnome/sources/f-spot/0.8/f-spot-%{version}.tar.bz2
Patch1:         f-spot-0.7.1-build-fixes.patch
# unmount cameras before importing
Patch3:         0002-enhance-the-f-spot-import-script.patch

# Patch from fedora
# two upstream patches to fix compile issue with Mono 2.8:
# http://git.gnome.org/browse/f-spot/commit/?id=9d6e8052b188c2b1cb310ef05842da74a730a39f
Patch13:         0001-PixbufLoader-from-gtk-sharp-master-does-not-have-a-C.patch

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

BuildRequires:  mono-devel mono-web mono-data mono-data-sqlite lcms-devel
BuildRequires:  libexif-devel gphoto2-devel >= 2.1.4
BuildRequires:  gtk-sharp2 libgnome-devel libgnomeui-devel
BuildRequires:  gtk2-devel mono-devel libjpeg-devel sqlite3-devel
BuildRequires:  gnome-sharp2 gnome-desktop-sharp2 gtk-sharp2-gapi
BuildRequires:  gconf-sharp2
BuildRequires:  gettext
BuildRequires:  autoconf, automake, libtool, intltool
BuildRequires:  perl-XML-Parser
BuildRequires:  gnome-doc-utils
BuildRequires:  ndesk-dbus-glib
BuildRequires:  mono-addins-devel >= 0.3
BuildRequires:  desktop-file-utils
BuildRequires:  gnome-keyring-sharp-devel
BuildRequires:  unique-devel
BuildRequires:  flickrnet-devel
BuildRequires:  libSM-devel
Requires:       sqlite3
Requires:       lcms
Requires:       dcraw
Requires:       hicolor-icon-theme 
Requires:       yelp
Requires(post): desktop-file-utils
Requires(postun): desktop-file-utils

# no mono available
ExcludeArch: sparc64

# Some compiler segfault on ia64:
ExcludeArch: ia64

# No libgphoto etc on s390
ExcludeArch: s390

Distribution: Vine Linux
Vendor: Project Vine

%description
F-Spot is an application designed to provide personal photo management
to the GNOME desktop. Features include import, export, printing and advanced
sorting and tagging of digital images. 

%package screensaver
Summary: F-Spot gnome-screensaver plugin
Summary(ja): F-Spot gnome-screensaver plugin
Group: Applications/Multimedia
Requires: %{name} = %{version}-%{release}
Requires: gnome-screensaver
Obsoletes: f-spot < 0.6.1.1

%description screensaver
F-Spot provides a plugin for gnome-screensaver which displays parts of the
photo collection in a slideshow as a screensaver.

%prep
%setup -q
#%patch1 -p1 -b .buildfix
%patch3 -p1 -b .gvfs-gphoto
%patch13 -p1 -b mono28-compile-fix


%build
intltoolize --force --copy
libtoolize --force --copy --automake
aclocal -I build/m4/f-spot -I build/m4/shamrock -I build/m4/shave
autoconf
autoheader
test -f config.h.in && touch config.h.in
automake --gnu --add-missing --force --copy -Wno-portability

export MONO_SHARED_DIR=%{_builddir}/%{?buildsubdir}
%configure --disable-scrollkeeper
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
export MONO_SHARED_DIR=%{_builddir}/%{?buildsubdir}
make install DESTDIR=$RPM_BUILD_ROOT

rm $RPM_BUILD_ROOT%{_libdir}/%{name}/*.a
rm $RPM_BUILD_ROOT%{_libdir}/%{name}/*.la
rm $RPM_BUILD_ROOT%{_libdir}/pkgconfig/f-spot.pc

# only files marked executable are used to auto-generate the
# requires/provides of the package
find $RPM_BUILD_ROOT \( -name '*.exe' -or -name '*.dll' \) \
     -exec chmod a+x {} \;

for file in $RPM_BUILD_ROOT%{_datadir}/applications/*.desktop
do
   desktop-file-validate $file
done

%find_lang %name

%clean
rm -rf $RPM_BUILD_ROOT

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

%post
update-desktop-database &> /dev/null ||:
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-install-rule %{_sysconfdir}/gconf/schemas/f-spot.schemas > /dev/null || :

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

%postun
update-desktop-database &> /dev/null ||:
if [ $1 -eq 0 ] ; then
    touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi

%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :

%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS COPYING README NEWS
%{_sysconfdir}/gconf/schemas/*
%{_datadir}/applications/*.desktop
%{_datadir}/gnome/help/f-spot/
%{_datadir}/icons/hicolor/*/*/*.png
%{_datadir}/f-spot/
%dir %{_libdir}/f-spot/
%{_libdir}/f-spot/*.dll
%{_libdir}/f-spot/*.exe
%{_libdir}/f-spot/*.addins
%{_libdir}/f-spot/*.config
%{_libdir}/f-spot/*.mdb
%{_libdir}/f-spot/*.so
%{_libdir}/f-spot/*.so.*
%exclude %{_libdir}/f-spot/Extensions/FSpot.Tools.ScreensaverConfig.dll*
%{_libdir}/f-spot/Extensions/
%{_bindir}/f-spot
%{_bindir}/f-spot-import
%{_bindir}/f-spot-sqlite-upgrade

%files screensaver
%defattr(-,root,root,-)
%{_libdir}/f-spot/Extensions/FSpot.Tools.ScreensaverConfig.dll
%{_prefix}/libexec/gnome-screensaver/f-spot-screensaver
%{_datadir}/applications/screensavers/f-spot-screensaver.desktop

%changelog
* Sun Dec 30 2012 IWAI, Masaharu <iwai@alib.jp> 0.8.2-2vl7
- build with mono-addins 0.6.2-2
- add BuildRequires: mono-addins-devel >= 0.3
- add Vendor and Distribution tags

* Sat Dec 25 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.8.2-1
- new upstream release
- delete Patch11,12

* Sat Dec 18 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.8.0-1
- new upstream release
- drop Patch1
- add Patch11,12,13 from fedora
- add BuildRequires: libSM-devel

* Thu Aug 05 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.1-1
- new upstream release
- add patch1 to support parallel builds
- add BR: unique-devel, flickrnet-devel

* Sun May 02 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 0.6.1.5-1
- initial build for Vine Linux

* Mon Dec 14 2009 Christian Krause <chkr@fedoraproject.org> - 0.6.1.5-2
- Corrected the permission fix for all .exe and .dll files in order
  to generate the dependencies correctly (BZ 547063)

* Sun Nov 08 2009 Christian Krause <chkr@fedoraproject.org> - 0.6.1.5-1
- Update to 0.6.1.5 (BZ 531955)
- Build f-spot against system gnome-keyring-sharp library (BZ 442343)
- Make all .dll and .exe files executable so that they are respected
  by the find-requires/find-provides scripts
- Remove upstreamed patch

* Mon Oct 26 2009 Dennis Gilmore <dennis@ausil.us> - 0.6.1.3-2
- ExcludeArch sparc64

* Sun Oct 04 2009 Christian Krause <chkr@fedoraproject.org> - 0.6.1.3-1
- Update to 0.6.1.3 (BZ 526217)
- Remove two upstreamed patches
- Use a slightly different fix for the cairo-devel dependency 
  (suggested by upstream)

* Wed Sep 30 2009 Christian Krause <chkr@fedoraproject.org> - 0.6.1.2-3
- Add patch to fix f-spot crash when using "soft focus" and cairo-devel
  was not installed (BZ 526563)
- Minor spec file beautification

* Tue Sep 22 2009 Christian Krause <chkr@fedoraproject.org> - 0.6.1.2-2
- Add upstream patches (
  commit b87604bc9782bf92f053aaf3ceb739a32f44ea13
  commit 807dab4344ecdadc7e46793369821de8b49692e5 )
  to fix crash in facebook exporter (BZ 524860)

* Thu Sep 17 2009 Christian Krause <chkr@fedoraproject.org> - 0.6.1.2-1
- Update to 0.6.1.2 (BZ 519290)

* Fri Aug 28 2009 Christian Krause <chkr@fedoraproject.org> - 0.6.1.1-2
- Move the screensaver plugin into a sub-package (BZ 519640)
- Let f-spot-screensaver obsolete older f-spot version so that it
  is pulled in during update (fresh installations of f-spot will not
  pull in gnome-screensaver)

* Wed Aug 26 2009 Christian Krause <chkr@fedoraproject.org> - 0.6.1.1-1
- Update to 0.6.1.1
- Remove upstreamed patch
- Updated use-system-Mono.Addins-if-available patch
- Add a patch to enable parallel build 

* Sun Aug 09 2009 Christian Krause <chkr@fedoraproject.org> - 0.6.0.0-3
- Build arch ppc64.

* Sun Aug 09 2009 Christian Krause <chkr@fedoraproject.org> - 0.6.0.0-2
- Fix Icon Cache script in %%post section

* Sun Aug 09 2009 Christian Krause <chkr@fedoraproject.org> - 0.6.0.0-1
- Update to new upstream version 0.6.0.0
- Cleanup spec file

* Sat Jul 25 2009 Christian Krause <chkr@fedoraproject.org> - 0.5.0.3-9
- Avoid showing f-spot twice for photo imports
- Make f-spot-import work with gvfs
- Minor indentation fix

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

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

* Sun Feb  8 2009 Alex Lancaster <alexlan[AT]fedoraproject org> - 0.5.0.3-6
- Rebuild against new mono stack to fix broken deps

* Thu Dec  4 2008 Matthias Clasen <mclasen@redhat.com> - 0.5.0.3-5
- Update to 0.5.0.3

* Fri Nov 21 2008 Matthias Clasen <mclasen@redhat.com> - 0.4.4-8
- Better URL
- Tweak %%description

* Tue Oct 28 2008 Orion Poplawski <orion@cora.nwra.com.com> - 0.4.4-7
- Run desktop-file-validate against desktop files

* Mon Oct 27 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 0.4.4-6
- rebuild against new gnome-sharp

* Thu Oct  2 2008 Matthias Clasen <mclasen@redhat.com> - 0.4.4-5
- Use a standard icon name instead of a non-existing one

* Mon Jul 14 2008 Nigel Jones <dev@nigelj.com> - 0.4.4-4
- Remove Tom's patch in -2, there is a gtk-sharp 2.12.1, just nobody bothered
  packaging it.
- Patch Makefile{.in,am} to use DESTDIR for the gio-sharp.dll, this is
  effectively a backport of r4010 Upstream.
- Patch libfspot/Makefile{.in,am} to remove -DGTK_DISABLE_DEPRECATED per
  recommendation of upstream.
- Re-add patch to use system mono-addins
- Include GIO stuff for now (until it appears in gtk-sharp)

* Wed Jul  5 2008 Alex Lancaster <alexlan[AT] fedoraproject org> - 0.4.4-3
- gtkhtml dependency now provided by gnome-desktop-sharp-devel
  rather than gnome-sharp-devel, so add as BuildRequires

* Wed Jun  4 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 0.4.4-2
- Fix it to not look for non-existant glib-sharp-2.12.1

* Wed Jun  4 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 0.4.4-1
- update to 0.4.4
- fix license tag

* Tue May 13 2008 Matthias Clasen <mclasne@redhat.com> - 0.4.3.1-1
- Update to 0.4.3.1

* Tue Apr 15 2008 Alex Lancaster <alexlan[AT]fedoraproject org> - 0.4.2-5
- Add patch from Debian to use system mono-addins (from #442343)

* Sat Mar  1 2008 Christopher Aillon <caillon@redhat.com> - 0.4.2-4
- Require dcraw

* Fri Feb 29 2008 Christopher Aillon <caillon@redhat.com> - 0.4.2-3
- Fix the build

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

* Thu Feb 14 2008 Matthias Clasen <mclasen@redhat.com> - 0.4.2-1
- Update to 0.4.2

* Fri Jan 18 2008 Matthias Clasen <mclasen@redhat.com> - 0.4.1-2
- Add support for content-types

* Thu Dec  6 2007 Matthias Clasen <mclasen@redhat.com> - 0.4.1-1
- Update to 0.4.1

* Sat Nov 17 2007 Matthias Clasen <mclasen@redhat.com> - 0.4.0-4
- Remove comments from ExclusiveArch line (#388581)

* Tue Oct  2 2007 Matthias Clasen <mclasen@redhat.com> - 0.4.0-3
- Add alpha to ExclusiveArch

* Fri Aug 24 2007 Adam Jackson <ajax@redhat.com> - 0.4.0-2
- Rebuild for build ID

* Sat Aug  4 2007 Matthis Clasen <mclasen@redhat.com> - 0.4.0-1
- Update to 0.4.0

* Mon Jul  2 2007 Christopher Aillon <caillon@redhat.com> - 0.3.5-3
- Hack to get screensavers to work again (#221546)

* Fri Apr 13 2007 Christopher Aillon <caillon@redhat.com> - 0.3.5-2
- Now with validated desktop files!

* Wed Mar  7 2007 Christopher Aillon <caillon@redhat.com> - 0.3.5-1
- Update to 0.3.5

* Wed Feb 28 2007 Matthias Clasen <mclasen@redhat.com> - 0.3.4-1
- Update to 0.3.4

* Tue Feb 13 2007 Matthias Clasen <mclasen@redhat.com> - 0.3.3-1
- Update to 0.3.3

* Tue Jan 23 2007 Matthias Clasen <mclasen@redhat.com> - 0.3.2-1
- Update to 0.3.2

* Fri Oct 20 2006 Christopher Aillon <caillon@redhat.com> - 0.2.2-1
- Update to 0.2.2

* Mon Oct 16 2006 Matthias Clasen <mclasen@redhat.com> - 0.2.1-2
- Fix a directory ownership issue (#211009)

* Wed Sep 13 2006 Christopher Aillon <caillon@redhat.com> - 0.2.1-1
- Update to 0.2.1

* Tue Sep 12 2006 Matthias Clasen <mclasen@redhat.com> - 0.2.0-2
- Add libgphoto2_port version to dll config (#205302)

* Mon Sep  4 2006 Christopher Aillon <caillon@redhat.com> - 0.2.0-1
- Update to 0.2.0

* Fri Aug 18 2006 Alexander Larsson <alexl@redhat.com> - 0.1.11-5
- Rebuild with new mono and gtk-sharp2

* Thu Jul 27 2006 Matthias Clasen <mclasen@redhat.com> - 0.1.11-4
- Fix dbus-sharp BR

* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 0.1.11-3.1
- rebuild

* Sun Jun 24 2006 Jesse Keating <jkeating@redhat.com> 0.1.11-3
- Add missing BR gettext

* Wed May 31 2006 Alexander Larsson <alexl@redhat.com> 0.1.11-2
- Rebuild for gmime update

* Fri Mar 17 2006 Christopher Aillon <caillon@redhat.com> 0.1.11-1
- Update to 0.1.11

* Fri Feb 24 2006 Christopher Aillon <caillon@redhat.com> 0.1.10-1
- Update to 0.1.10

* Tue Feb 21 2006 Karsten Hopp <karsten@redhat.de> 0.1.9-2
- add BuildRequires  libgnome-devel libgnomeui-devel
  gtk2-devel mono-devel libjpeg-devel sqlite-devel

* Fri Feb 17 2006 Christopher Aillon <caillon@redhat.com> - 0.1.9-1
- Update to 0.1.9

* Sun Feb 12 2006 Christopher Aillon <caillon@redhat.com> - 0.1.8-3
- Rebuild

* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 0.1.8-2.1
- rebuilt for new gcc4.1 snapshot and glibc changes

* Wed Feb  1 2006 Christopher Aillon <caillon@redhat.com> - 0.1.8-2
- Add sqlite3.patch to ensure that sqlite3 is used if both
  sqlite2 and sqlite3 are installed.

* Tue Jan 31 2006 Christopher Aillon <caillon@redhat.com> - 0.1.8-1
- Update to 0.1.8
- Use sqlite3 instead of sqlite2

* Tue Jan 31 2006 Ray Strode <rstrode@redhat.com> - 0.1.5-3
- don't blindly run f-spot from current working directory
  (bug 177407)

* Tue Jan 10 2006 Alexander Larsson <alexl@redhat.com> - 0.1.5-2
- Add lcms depencency

* Mon Jan  9 2006 Alexander Larsson <alexl@redhat.com> - 0.1.5-1
- Update to 0.1.5

* Thu Dec  8 2005 Alexander Larsson <alexl@redhat.com> 0.1.3-3
- Use sqlite2 to avoid problems with beagle

* Fri Nov 18 2005 Alexander Larsson <alexl@redhat.com> 0.1.3-2
- Make exes and dlls executable to pick up dependencies
- Remove .a and .la files

* Wed Nov 16 2005 Alexander Larsson <alexl@redhat.com> - 0.1.3-1
- Initial version