Name:           shotwell
Version:        0.22.0
Release:        1%{?_dist_release}
Summary:        A photo manager for the GNOME desktop
Summary(ja):    GNOME デスクトップ向けの写真管理ツール

Group:          Applications/Graphics
# LGPLv2+ for the code
# CC-BY-SA for some of the icons
License:        LGPLv2+ and CC-BY-SA
URL:            http://www.yorba.org/shotwell/

Source0:        http://www.yorba.org/download/shotwell/stable/shotwell-%{version}.tar.xz
# http://trac.yorba.org/ticket/3379
Source1:        shotwell-icons.tar.bz2

# http://redmine.yorba.org/issues/5181
Patch0:         shotwell-usrmove.patch

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

BuildRequires:  GConf2-devel
BuildRequires:  LibRaw-devel
BuildRequires:  LibRaw-static
BuildRequires:  WebKit3-gtk-devel
BuildRequires:  dbus-glib-devel
BuildRequires:  desktop-file-utils
BuildRequires:  gettext
BuildRequires:  gtk3-devel
#BuildRequires:  gstreamer-devel
#BuildRequires:  gstreamer-plugins-base-devel
BuildRequires:  gstreamer1-devel
BuildRequires:  gstreamer1-plugins-base-devel
BuildRequires:  json-glib-devel
BuildRequires:  libexif-devel
BuildRequires:  libgee-devel
BuildRequires:  libgee-vala
BuildRequires:  libgphoto2-devel
BuildRequires:  eudev-libgudev1-devel
BuildRequires:  libgexiv2-devel >= 0.2.0
BuildRequires:  libsoup-devel
BuildRequires:  libxml2-devel
BuildRequires:  lcms2-devel
BuildRequires:  sqlite3-devel
BuildRequires:  unique3-devel
BuildRequires:  vala-devel >= 0.9.5
BuildRequires:  rest-devel
BuildRequires:  gnome-doc-utils

# used by shotwell-settings-migrator
Requires: dconf

Vendor: Project Vine
Distribution: Vine Linux
Packager: kudoh

%description
Shotwell is a new open source photo manager designed for the GNOME desktop
environment. It allows you to import photos from your camera, view and edit
them, and share them with others.

%description -l ja
Shotwell は GNOME デスクトップ環境用に設計された新しいオープンソースの
画像管理ツールです。
あなたのカメラから写真を取り込んだり、それらを表示・編集したり、
他の人々と共有するなどができます。

%prep
%setup -q -n %{name}-%{version}
%patch0 -p1 -b .usrmove

%build
# We can't use the configure macro: it's not a standard autotools configure script
export CFLAGS="%{optflags}"
export LIB=%{_lib}

# HACK: Remove fatal-warnings to succeed build with vala 0.13.
#sed -i "s:--fatal-warnings ::g" Makefile plugins/Makefile.plugin.mk
./configure --prefix=%{_prefix} --lib=%{_lib} --disable-schemas-install 
#sed -i -e 's/\\n/\n/g' configure.mk
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1
export XDG_DISABLE_MAKEFILE_UPDATES=1
# otherwise gettext always returns English text regardless of LANGUAGE asked
export LANG=en_US.utf8
make install DESTDIR=$RPM_BUILD_ROOT

desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/shotwell.desktop
desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/shotwell-viewer.desktop

# put hi-res icons in place
(
  cd $RPM_BUILD_ROOT%{_datadir}/icons/hicolor
  rm -rf 16x16 24x24 scalable
  tar xf %{SOURCE1}
)

%find_lang %{name} --all-name

%clean
rm -rf $RPM_BUILD_ROOT

%post
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
update-desktop-database &> /dev/null || :

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

%posttrans
gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor &>/dev/null || :
glib-compile-schemas %{_datadir}/glib-2.0/schemas ||:

%files -f %{name}.lang
%defattr(-,root,root,-)
%doc README COPYING MAINTAINERS NEWS THANKS AUTHORS
%{_bindir}/shotwell
%{_libexecdir}/shotwell/shotwell-settings-migrator
%{_libexecdir}/shotwell/shotwell-video-thumbnailer
%{_libdir}/shotwell/plugins/builtin
%{_datadir}/GConf/gsettings/shotwell.convert
%{_datadir}/glib-2.0/schemas/org.yorba.shotwell-extras.gschema.xml
%{_datadir}/glib-2.0/schemas/org.yorba.shotwell.gschema.xml
%{_datadir}/gnome/help/
%{_datadir}/shotwell
%{_datadir}/appdata/shotwell.appdata.xml
%{_datadir}/applications/shotwell.desktop
%{_datadir}/applications/shotwell-viewer.desktop
%{_datadir}/icons/hicolor/*
%exclude %{_datadir}/icons/hicolor/icon-theme.cache
%exclude %{_datadir}/glib-2.0/schemas/gschemas.compiled


%changelog
* Sun Mar 29 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 0.22.0-1
- new upstream release

* Mon Feb 09 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 0.20.2-2
- rebuild with libgphoto2-2.5.7

* Mon Nov 03 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 0.20.2-1
- new upstream release

* Thu Jul 03 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 0.18.1-1
- new upstream release
- change BuildRequires: eudev-libgudev1-devel instead of libgudev1-devel

* Sun Mar 30 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 0.18.0-1
- new upstream release
- add BuildRequires: gnome-doc-utils

* Sun Feb 09 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 0.15.1-4
- rebuild with LibRaw-0.16.0

* Sun Jan 19 2014 Toshiharu Kudoh <toshi.kd2@gmail.com> - 0.15.1-3
- rebuilt with LibRaw-0.15.4

* Wed Dec 11 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 0.15.1-2
- rebuild with exiv2-0.24

* Sat Nov 30 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 0.15.1-1
- new upstream release
- remove Patch1 (0001-Port-to-GStreamer-1.0.patch)
- change BuildRequires: libgee-devel instead of libgee06-devel
- add BuildRequires: libgee-vala

* Fri Jan 11 2013 IWAI, Masaharu <iwai@alib.jp> - 0.13.1-2
- build with libgphoto2 2.5.0-1

* Sat Oct 20 2012 Toshiharu Kudoh <toshi.kd2@gmail.com> - 0.13.1-1
- new upstream release
- changed archive typr to xz
- changed BuildRequires: libgee-devel to libgee06-devel
- changed BuildRequires: gstreamer-devel and gstreamer-plugins-base-devel to
  gstreamer1-devel and gstreamer1-plugins-base-devel
- added Requires: dconf
- added Patch0,1 from Fedora

* Sun Jul 29 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 0.12.3-2
- rebuild with exiv2-0.23

* Thu May 10 2012 Toshiharu Kudoh <toshi.kd2@gmail.com> - 0.12.3-1
- new upstream release
- dropt Source2

* Sun Apr 22 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 0.12.2-1
- new upstream release
- remove Patch0
- change BuildRequires: gtk3-devel instead of gtk2-devel
- change BuildRequires: WebKit3-gtk-devel instead of WebKit-gtk-devel
- change BuildRequires: unique3-devel instead of unique-devel
- remove BuildRequires: hal-devel
- add BuildRequires: rest-devel, lcms2-devel

* Sun Nov 13 2011 Toshiharu Kudoh <toshi.kd2@gmail.com> - 0.11.6-1
- new upstream release

* Thu Oct 20 2011 Toshiharu Kudoh <toshi.kd2@gmail.com> - 0.11.5-1
- new upstream release

* Fri Oct 14 2011 Toshiharu Kudoh <toshi.kd2@gmail.com> - 0.11.4-1
- new upstream release

* Fri Sep 23 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.11.2-1
- new upstream release
- add Patch0 (shotwell-0.11.1-vala-0.14.patch)
- add BuildRequires: gstreamer-plugins-base-devel

* Sat Aug 27 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.10.1-2
- rebuilt with libgexiv2-0.2.2-2

* Wed Aug 17 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.10.1-1
- new upstream release

* Sat Jun 18 2011 IWAI, Masaharu <iwai@alib.jp> 0.8.1-5
- add ja.po (Source2): fix <BTS:VineLinux:1142>
- update Summary and description

* Fri Jun 10 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.1-4
- add hi-res icons (SOURCE1)
- add LANG=en_US.utf8 to get gettext to actually generate translated strings

* Sat Jun 04 2011 Toshiharu Kudoh <toshi.kd2@gmail.com> - 0.8.1-3
- dropt Patch0
- added BuildRequires: LibRaw-static

* Sun Apr 03 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 0.8.1-2
- add Patch1 (shotwell-0.8.1-vala.patch)

* Wed Jan 12 2011 Toshiharu Kudoh <toshi.kd2@gmail.com> - 0.8.1-1
- new upstream release
- added BuildRequires: gstreamer-devel, json-glib-devel, libsoup-devel, libxml2-devel

* Tue Sep 28 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> - 0.7.2-2
- rebuilt with rpm-4.8.1 for pkg-config
- fixed %%changelog in Tue Sep 14 2010

* Tue Sep 14 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> - 0.7.2-1
- new upstream release
- changed source URL
- added Patch0 to work around desktop file incorrect comment
- changed BuildRequires: vala-devel >= 0.9.5

* Fri Aug 27 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> - 0.7.1-1
- new upstream release

* Sat Aug 21 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> - 0.7.0-1
- new upstream release
- changed BuildRequires: libgexiv2-devel >= 0.2.0

* Thu Jul 22 2010 Shu KONNO <owa@bg.wakwak.com> - 0.6.1-2
- fixed LIB_DIRS in libraw-config (for lib64)

* Wed Jul 14 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> - 0.6.1-1
- new upstream release
- added BuildRequires: LibRaw-devel, libgexiv2-devel

* Wed May 12 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> - 0.5.2-1
- new upstream release

* Sat Mar 13 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> - 0.5.0-1
- new upstream release
- added BuildRequires:  libgudev1-devel
- applied new naming policy to spec

* Wed Jan 20 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> - 0.4.3-1
- new upstream release
- proved Japanese description

* Thu Jan 7 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> - 0.4.2-1
- new upstrema release

* Wed Dec 30 2009 Toshiharu Kudoh <toshi.kd2@gmail.com> - 0.4.1-1
- intial build for VineSeed

* Fri Dec 18 2009 Matthias Clasen <mclasen@redhat.com> - 0.4.0-0.1.20091218svn
* Thu Nov 12 2009 Matthias Clasen <mclasen@redhat.com> - 0.3.2-1
- Update to 0.3.2

* Tue Nov  3 2009 Matthias Clasen <mclasen@redhat.com> - 0.3.0-1
- Version 0.3.0

* Thu Aug 20 2009 Michel Salim <salimma@fedoraproject.org> - 0.2.0-3
- Rebuild against new libgee

* Wed Aug 12 2009  Matthias Clasen <mclasen@redhat.com> - 0.2.0-2.fc12
- Bring icon cache handling in sync with current guidelines

* Sun Aug  9 2009  Matthias Clasen <mclasen@redhat.com> - 0.2.0-1.fc12
- Initial packaging
