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

Name:		mirage
Version:	0.9.3
Release:	2%{?_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}.tar.bz2
BuildRoot:	%{_tmppath}/%{name}-%{version}-root

BuildRequires:	gettext
BuildRequires:	libX11-devel
BuildRequires:	python-devel
BuildRequires:	desktop-file-utils
Requires:	pygtk2 >= 2.6.0
Requires:	gtk2 >= 2.6.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 -q
# Don't remove rebuilt files!
%{__sed} -i.build -e '/Cleanup/,$d' setup.py

%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*
#%if 0%{?fedora} >= 9
%{python_sitearch}/*.egg-info
#%endif
%{python_sitearch}/*.so

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

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

%changelog
* 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.
