%define	add_japo	1

Summary:	gnome panel applet to select and tile windows
Summary(ja): 	ウィンドウを整列させる Gnome パネルアプレット
Name:		x-tile
Version:	1.8.6
Release: 	1%{?_dist_release}
Source0:	http://www.giuspen.com/software/%{name}-%{version}.tar.gz
%if %{add_japo}
Source1:	x-tile-1.8.6-1-ja.po
%endif
Patch0:		x-tile_1.8.6-ja.patch
License:	GPLv2
Group:		User Interface/Desktops
URL:		http://www.giuspen.com/x-tile/

Requires:	python, pygtk2, gnome-python-applet
Requires(post):  desktop-file-utils
Requires(postun):desktop-file-utils

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

Packager:       kazutaka, iwaim

%description
X-tile is a gnome applet for your panel (or optionally a standalone
application, working with kde as well) that allows you to select
a number of windows and tile them in different ways.

This is especially useful for comparing products in separate
web pages, or for programmers refering to documentation as they
are programming.

%description -l ja
X-tile は指定したウィンドウを様々なレイアウトで整列させられる
Gnome パネルアプレットです。
(*また単独のアプリケーションとしても使用できますし、KDE 上で
  も問題なく動作します。)

このアプレットは、(例えば)複数のウェブページを比較したり、ド
キュメントを参照しながらプログラミングをしたり、といった場面
で役に立ちます。


%prep
%setup -q -n %{name}_%{version}
%patch0 -p1

%build
# install japanese translation
%if %{add_japo}
%{__mkdir_p} locale/ja/LC_MESSAGES
msgfmt %{SOURCE1} -o locale/ja/LC_MESSAGES/%{name}.mo
%endif

%install
%{__rm} -rf $RPM_BUILD_ROOT

%{__mkdir_p} %{buildroot}/%{_bindir}
%{__cp} %{name} %{buildroot}/%{_bindir}/

%{__mkdir_p} %{buildroot}/%{_prefix}/lib/bonobo/servers
%{__cp} linux/%{name}.server %{buildroot}/%{_prefix}/lib/bonobo/servers
%{__mkdir_p} %{buildroot}/%{_datadir}/applications
%{__cp} linux/%{name}.desktop %{buildroot}/%{_datadir}/applications/
%{__mkdir_p} %{buildroot}/%{_datadir}/pixmaps
%{__cp} linux/%{name}.svg %{buildroot}/%{_datadir}/pixmaps/
%{__mkdir_p} %{buildroot}/%{_datadir}/%{name}/glade
%{__cp} glade/* %{buildroot}/%{_datadir}/%{name}/glade
%{__mkdir_p} %{buildroot}/%{_datadir}/%{name}/modules
%{__cp} modules/* %{buildroot}/%{_datadir}/%{name}/modules

%{__mkdir_p} %{buildroot}/%{_localedir}
for dirname in locale/*
do
   if [ -d $dirname ]; then
      %{__cp} -r $dirname %{buildroot}/%{_localedir}
   fi
done

%find_lang %{name}

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

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


%clean
%{__rm} -rf $RPM_BUILD_ROOT


%files -f %{name}.lang
%defattr(-,root,root)
%doc license 
%{_bindir}/%{name}
%{_prefix}/lib/bonobo/servers/%{name}.server
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.svg
%{_datadir}/%{name}


%changelog
* Thu Mar 31 2011 IWAI, Masaharu <iwai@alib.jp> 1.8.6-1
- new upstream release
- add ja.po (Source1)
- add ja patch (Patch0)

* Fri Jul 23 2010 Kazutaka HARADA <kazutaka@vinelinux.org> 1.6.1-1
- new upstream release
- drop Source1(ja.po), merged into upstream

* Mon Jul 19 2010 Kazutaka HARADA <kazutaka@vinelinux.org> 1.6-2
- add Source1: japanese translation (thanks iwai-san)

* Fri Jul 16 2010 Kazutaka HARADA <kazutaka@vinelinux.org> 1.6-1
- initial build for Vine Linux
