%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

Name:		mirage
Version:	1.0
Release:	4.svn400%{?_dist_release}
Summary:	A fast and simple image viewer
Summary(ja):	高速でシンプルな画像ビューア

Group:		Applications/Graphics
License:	GPLv3+
URL:		http://mirageiv.berlios.de/
Source0:	http://download.berlios.de/mirageiv/%{name}-%{version}-svn400.tar.bz2
Source1:	mirage_ja.po
Patch0:        setup.patch

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

BuildRequires: gettext
BuildRequires: libX11-devel
BuildRequires: python-devel
BuildRequires: desktop-file-utils

Requires:	pyexiv2
Requires:	pygtk2 >= 2.12.0
Requires:	gtk2 >= 2.10.0
Requires:	gnome-python

%description
Mirage is a fast and simple GTK+ image viewer. Because it 
depends only on PyGTK, Mirage is ideal for users who wish to 
keep their computers lean while still having a clean image viewer.

%description -l ja
Mirage は高速でシンプルな GTK+ の画像ビューアです。
PyGTK だけに依存するので、Mirage はコンピュータをスリムで
綺麗にしておきたいユーザーにとっては理想的な画像ビューアです。


%prep
%setup -qn %{name}
# Don't remove rebuilt files!
%patch0 -p1
#%{__sed} -i.build -e '/Cleanup/,$d' setup.py
%{__cp} -f %{SOURCE1} po/ja.po

%build
export CFLAGS="$RPM_OPT_FLAGS"
%{__python} setup.py build

%install
%{__rm} -rf $RPM_BUILD_ROOT

%{__mkdir_p} $RPM_BUILD_ROOT
%{__python} setup.py install --skip-build --prefix $RPM_BUILD_ROOT%{_prefix}

# remove document files
%{__rm} -f $RPM_BUILD_ROOT%{_datadir}/%{name}/[A-Z]*

# install desktop file
%{__sed} -i -e 's|%{name}.png|%{name}|' \
	$RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop
desktop-file-install \
	--delete-original \
	--remove-category 'Application' \
	--dir $RPM_BUILD_ROOT%{_datadir}/applications \
	--vendor vine \
	$RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop

# gettext files
%{find_lang} %{name}

%post
%{_bindir}/update-desktop-database &> /dev/null || :

%postun
%{_bindir}/update-desktop-database &> /dev/null || :

%clean
%{__rm} -rf $RPM_BUILD_ROOT

%files -f %{name}.lang
%defattr(-,root,root,-)
%doc CHANGELOG COPYING README TODO TRANSLATORS

%{_bindir}/%{name}
%{python_sitearch}/%{name}.py*
%{python_sitearch}/*.egg-info
%{python_sitearch}/*.so

%{_datadir}/%{name}/
%{_datadir}/pixmaps/*.png

%{_datadir}/applications/*%{name}.desktop

%changelog
* Sat Mar 30 2013 Toshiharu Kudoh <toshi.kd2@gmail.com> - 1.0-4.svn400
- new upstream snapshot
- updated Source1

* Fri Dec 14 2012 Toshiharu Kudoh <toshi.kd2@gmail.com> - 1.0-3.svn391
- new upstream snapshot
- updated Source1

* Sat Oct 20 2012 Toshiharu Kudoh <toshi.kd2@gmail.com> - 1.0-2.svn361
- new upstream snapshot
- updated Source1

* Sun Aug 12 2012 Toshiharu Kudoh <toshi.kd2@gmail.com> - 1.0-1.svn358
- new upstream snapshot
- added Source1 and Patch0 to enable Japanese translation
- added Requires: pyexiv2

* Mon Feb 14 2011 Toshiharu Kudoh <toshi.kd2@gmail.com> - 0.9.5.2-1
- new upstream release

* Sun Aug 1 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> - 0.9.5.1-1
- new upstream release

* Wed Jul 21 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> - 0.9.5-1
- new upstream release

* Sun Jul 4 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> - 0.9.4-1
- new upstream release
- changed Requires: pygtk2 >= 2.12.0, gtk2 >= 2.10.0

* Wed Feb 03 2010 Shu KONNO <owa@bg.wakwak.com> 0.9.3-2
- rebuilt with python-2.6.4

* Wed May 6 2009 Toshiharu Kudoh <toshi.kd2@gmail.com> - 0.9.3-1
- initial build for VineSeed

* Tue Feb 24 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 0.9.3-3
- F-11: Mass rebuild

* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 0.9.3-2
- Rebuild for Python 2.6

* Thu Mar 27 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 0.9.3-1
- 0.9.3

* Sat Feb  9 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp>
- Rebuild against gcc43 (F-9)

* Wed Jan 30 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 0.9.2-1
- 0.9.2

* Thu Jan 10 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 0.9.1-1
- 0.9.1

* Fri Jan  4 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 0.9-3
- Support python egginfo for F-9+

* Wed Dec  5 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 0.9-2
- Fix icon path in desktop file for desktop-file-utils 0.14+

* Fri Oct 19 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 0.9-1
- 0.9

* Wed Aug 22 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 0.8.3-2.dist.2
- Mass rebuild (buildID or binutils issue)

* Fri Aug  3 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 0.8.3-2.dist.1
- License update

* Fri Jun 15 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 0.8.3-2
- Remove Version= entry (on F-8+)

* Fri Jan 19 2007 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 0.8.3-1
- 0.8.3

* Sat Dec  9 2006 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 0.8.2-1
- 0.8.2

* Fri Dec  8 2006 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp>
- Rebuild against new python (only for devel)

* Sat Nov 18 2006 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 0.8.1-1
- Initial packaging to import to Fedora Extras.
