%define gimphelpver 2-6.0
%define gimpsubver 2.0

Summary: Help files for the GIMP.
Name: gimp-help
#Version: %(echo %gimphelpver|sed 's/-/.0./')
Version: 2.6.0
Release: 1%{?_dist_release}
License: GNU FDL
Group: Applications/Documentation
URL: http://wiki.gimp.org/gimp/GimpDocs
Source0: ftp://ftp.gimp.org/pub/gimp/help/gimp-help-%{version}-html-en.tar.bz2
Source1: ftp://ftp.gimp.org/pub/gimp/help/gimp-help-%{version}-html-ja.tar.bz2
Source2: ftp://ftp.gimp.org/pub/gimp/help/gimp-help-%{version}-html-de.tar.bz2
Source3: ftp://ftp.gimp.org/pub/gimp/help/gimp-help-%{version}-html-es.tar.bz2
Source4: ftp://ftp.gimp.org/pub/gimp/help/gimp-help-%{version}-html-fr.tar.bz2
Source5: ftp://ftp.gimp.org/pub/gimp/help/gimp-help-%{version}-html-it.tar.bz2
Source6: ftp://ftp.gimp.org/pub/gimp/help/gimp-help-%{version}-html-ko.tar.bz2
Source7: ftp://ftp.gimp.org/pub/gimp/help/gimp-help-%{version}-html-nl.tar.bz2
Source8: ftp://ftp.gimp.org/pub/gimp/help/gimp-help-%{version}-html-nn.tar.bz2
Source9: ftp://ftp.gimp.org/pub/gimp/help/gimp-help-%{version}-html-pl.tar.bz2
Source10: ftp://ftp.gimp.org/pub/gimp/help/gimp-help-%{version}-html-ru.tar.bz2
Source11: ftp://ftp.gimp.org/pub/gimp/help/gimp-help-%{version}-html-sv.tar.bz2
Source12: ftp://ftp.gimp.org/pub/gimp/help/gimp-help-%{version}-html-zh_CN.tar.bz2
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: libxslt
BuildRequires: docbook-style-xsl
BuildRequires: gimp-devel >= 2.6
Requires: gimp >= 2.6

%description
The GIMP User Manual is a newly written User Manual for the GIMP.

%package l10n
Summary: Localized documentation for gimp
Group: Applications/Documentation
Requires: %{name} = %{version}-%{release}

%description l10n
This package contains localized documentation for gimp.
(except for English and Japanese)

%prep
%setup -q -n gimp-help-2
for i in ja de es fr it ko nl nn pl ru sv zh_CN
do 
  mkdir $i
done
pushd ja
  tar xjf %{SOURCE1}
popd
pushd de 
  tar xjf %{SOURCE2}
popd
pushd es 
  tar xjf %{SOURCE3}
popd
pushd fr
  tar xjf %{SOURCE4}
popd
pushd it
  tar xjf %{SOURCE5}
popd
pushd ko
  tar xjf %{SOURCE6}
popd
pushd nl
  tar xjf %{SOURCE7}
popd
pushd nn
  tar xjf %{SOURCE8}
popd
pushd pl
  tar xjf %{SOURCE9}
popd
pushd ru
  tar xjf %{SOURCE10}
popd
pushd sv
  tar xjf %{SOURCE11}
popd
pushd zh_CN
  tar xjf %{SOURCE12}
popd

%install
rm -rf %buildroot
make install DESTDIR=$RPM_BUILD_ROOT
#makeinstall GIMP_DATADIR=%{buildroot}%{_datadir}/gimp/%{gimpsubver}

for i in ja de es fr it ko nl nn pl ru sv zh_CN
do 
  pushd $i/gimp-help-2
    make install DESTDIR=$RPM_BUILD_ROOT
  popd
done

%clean
rm -rf %buildroot

%files
%defattr (-, root, root)
%dir %{_datadir}/gimp
%dir %{_datadir}/gimp/%{gimpsubver}
%{_datadir}/gimp/%{gimpsubver}/help/en
%{_datadir}/gimp/%{gimpsubver}/help/ja

%files l10n
%defattr (-, root, root)
%{_datadir}/gimp/%{gimpsubver}/help
%exclude %{_datadir}/gimp/%{gimpsubver}/help/en
%exclude %{_datadir}/gimp/%{gimpsubver}/help/ja


%changelog
* Mon Feb 13 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.6.0-1
- update to 2.6.0
- create l10n sub package

* Tue Apr 14 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.4.2-1
- new upstream release
- applied new versioning policy
- changed Group to Applications/Documentation

* Wed Apr 11 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0.0.12-0vl1
- initial build for Vine Linux

* Thu Jan 04 2007 Nils Philippsen <nphilipp@redhat.com> - 2-0.1.0.11
- version 2-0.11
- add disttag

* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 2-0.1.0.10.1.1
- rebuild

* Mon Apr 24 2006 Nils Philippsen <nphilipp@redhat.com>
- version 2-0.10

* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
- rebuilt

* Fri Oct 21 2005 Nils Philippsen <nphilipp@redhat.com>
- version 2-0.9

* Wed Feb 23 2005 Nils Philippsen <nphilipp@redhat.com>
- version 2-0.7

* Sat Jan 15 2005 Nils Philippsen <nphilipp@redhat.com>
- version 2-0.6

* Fri Jul 02 2004 Nils Philippsen <nphilipp@redhat.com>
- version 2-0.3

* Tue Jun 15 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt

* Fri Apr 02 2004 Nils Philippsen <nphilipp@redhat.com>
- version 2-0.2

* Wed Mar 17 2004 Nils Philippsen <nphilipp@redhat.com>
- version 2-0.1
- initial build
