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

Name:           gnome-specimen
Version:        0.4
Release:        2%{?_dist_release}
Summary:        A simple tool to view and compare fonts installed on your system
Summary(ja):        システムにインストールされているフォントを閲覧・比較するシンプルなツール

Group:          Applications/System
License:        GPLv2+
URL:            http://uwstopia.nl/geek/projects/gnome-specimen/
Source0:        http://uwstopia.nl/geek/projects/gnome-specimen/releases/%{name}-%{version}.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root
BuildArch:      noarch

BuildRequires:  GConf2-devel
BuildRequires:  gnome-python
BuildRequires:  pygtk2-libglade
BuildRequires:  perl-XML-Parser
BuildRequires:  pkgconfig
BuildRequires:  gettext
BuildRequires:  desktop-file-utils
Requires(pre): GConf2
Requires(post): GConf2
Requires(preun): GConf2

%description
Gnome Specimen is a simple tool to view and compare fonts installed on 
your system

%description -l ja
Gnome Specimen はあなたのシステムにインストールされているフォントを
閲覧・比較するためのシンプルなツールです。

%prep
%setup -q


%build
%configure
%__make %{?_smp_mflags}


%install
%__rm -rf $RPM_BUILD_ROOT
export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1
## %__make install DESTDIR=$RPM_BUILD_ROOT
%__make install DESTDIR=$RPM_BUILD_ROOT pyexecdir=%{python_sitelib}

desktop-file-install --vendor="vine" --delete-original \
    --dir $RPM_BUILD_ROOT%{_datadir}/applications        \
    $RPM_BUILD_ROOT%{_datadir}/applications//%{name}.desktop


%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/%{name}.schemas >/dev/null || :
    killall -HUP gconfd-2 || :
fi

%post
touch --no-create %{_datadir}/icons/hicolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-install-rule \
  %{_sysconfdir}/gconf/schemas/%{name}.schemas > /dev/null || :
killall -HUP gconfd-2 || :

%postun
touch --no-create %{_datadir}/icons/hicolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :


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

%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING NEWS README
%{_bindir}/%{name}
%{python_sitelib}/specimen
%{_datadir}/%{name}
%{_datadir}/applications/*.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.*
%config(noreplace) %{_sysconfdir}/gconf/schemas/%{name}.schemas

%changelog
* Sun Feb 19 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.4-2
- rebuild with python-2.7.2

* Sun Mar 14 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.4-1
- new upstream release

* Thu Feb 04 2010 Shu KONNO <owa@bg.wakwak.com> 0.3-2
- rebuilt with python-2.6.4-3
- fixed install directory

* Sat Feb 14 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 0.3-1
- initial build

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

* Wed Jul 23 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 0.3-2
- fix license tag

* Wed Jul 18 2007 Damien Durand <splinux@fedoraproject.org> - 0.3-1
- Update to 0.3

* Wed Jul 11 2007 Damien Durand <splinux@fedoraproject.org> - 0.2-4
- Fix desktop-file section

* Wed Jun 27 2007 Damien Durand <splinux@fedoraproject.org> - 0.2-3
- Fix owned directories

* Fri Jun 09 2007 Damien Durand <splinux@fedoraproject.org> - 0.2-2
- Fix gconf shemas
- Set BuildArch to noarch
- Fix wrong entries from desktop file

* Fri Jun 08 2007 Damien Durand <splinux@fedoraproject.org> - 0.2-1
- Initial RPM release
