%define wtver 0.9
Summary:   WineTools is a menu driven installer for installing Windows programs under Linux.
Summary(pt_BR): WineTools é menu interativo para instalação de programas para windows
Name:      winetools
Version:   0.9
Release:   3jo
Copyright: GPL
Url:       http://www.von-thadden.de/Joachim/WineTools/

Packager:  Joachim von Thadden <thadden@web.de>
Group:     Emulators
Group(pt_BR): Emuladores
Source:    %{name}-%{wtver}jo-III.tar.gz
BuildRoot: /tmp/%{name}-%{version}-rpmbuild/
Requires:  wget, wine
#Requires:  gettext >= 0.14

%description
WineTools is a menu driven installer for installing about 90 Windows programs under the x86 (Athlon or Intel PC)
processor architecture with the Linux operating system using Wine. This software lets you install the following
Windows software:

    * DCOM98
    * IE6
    * Windows Core Fonts
    * Windows System Software
    * Office & Office Viewer
    * Adobe Photoshop 7, Illustrator 9
    * many other programs

It also sets up your .wine directory in the correct way, downloads the files to install from the web (only the
free and shareware ones for sure), installs Windows fonts and lets you uninstall and configure your software.
And it does much more than Sidenet, although it uses a part of the configuration for IE6 (thanks for that!).

WineTools was initially written by Frank Hendriksen and was extended by me (Joachim von Thadden). It
is licensed under the GPL.

%description -l pt_BR
WineTools é menu assistente para a instalação de cerca de 90 programas Windows
sob processadores x86 (Athlon ou Intel PC)
oineTools is a menu driven installer for installing about 90 Windows programs under the x86 (Athlon or Intel PC) com sistema operacional Linux usando Wine.
Este programa deixa voce instalar os seguintes programas para Windows :

    * DCOM98
    * IE6
    * Windows Core Fonts
    * Windows System Software
    * Office & Office Viewer
    * Adobe Photoshop 7, Illustrator 9, Acrobat Reader 6
    * e muitos outros.

Ele tambem permite voce configurar o diretorio .wine de forma correta e fazer
downloads de programas diretamente da internet (somente softwares freeware e
shareware), Instala fontes Windows e deixa voce desinstalar e configurar seus
programas.
E muito mais do que o Sidenet, embora use parte da mesma configuração para
rodar o IE6 (obrigado por isso!)


WineTools foi escrito inicialmente por Frank Hendriksen e foi extendido por mim
(Joachim von Thadden). Ele esta licenciado sob a GPL.

%prep
%setup -q -n %{name}-%{wtver}jo-III
%build
%install
mkdir -p $RPM_BUILD_ROOT/usr/local/{winetools,bin}
cp -a $RPM_BUILD_DIR/%{name}-%{wtver}jo-III/* $RPM_BUILD_ROOT/usr/local/winetools
#mv $RPM_BUILD_ROOT/usr/local/winetools/Xdialog $RPM_BUILD_ROOT/usr/local/winetools/Xdialog.builtin
rm  $RPM_BUILD_ROOT/usr/local/winetools/Xdialog
ln -sf /usr/local/winetools/wt%{wtver}jo $RPM_BUILD_ROOT/usr/local/bin/wt
ln -sf /usr/local/winetools/wt%{wtver}jo $RPM_BUILD_ROOT/usr/local/bin/winetools
ln -sf /usr/local/winetools/findwine $RPM_BUILD_ROOT/usr/local/bin/findwine
cd $RPM_BUILD_ROOT/usr/local/winetools/po
for i in $( ls  *.po|cut -f1 -d.); do
	mkdir -p $RPM_BUILD_ROOT/usr/local/share/locale/$i/LC_MESSAGES
	msgfmt $i.po -o $RPM_BUILD_ROOT/usr/local/share/locale/$i/LC_MESSAGES/wt0.9.mo
        echo "Installed translations for $i to $RPM_BUILD_ROOT/usr/local/share/locale/$i/LC_MESSAGES/wt0.9.mo"
done

%clean
rm -rf $RPM_BUILD_ROOT/*
rm -rf $RPM_BUILD_DIR/%{name}-%{wtver}jo-III

%post
DIALOG="`which Xdialog`"
if [ "$?" = "0" ]; then
  ln -s $DIALOG /usr/local/winetools/Xdialog || echo "Could not link Xdialog to the WineTools directory. You have to do that manually for WineTools to work."
else
  ln -s /usr/local/winetools/Xdialog.builtin /usr/local/winetools/Xdialog || echo "Could not link Xdialog to the WineTools directory. You have to do that manually for WineTools to work."
fi

%preun
rm /usr/local/winetools/Xdialog

%files
%doc INSTALL.txt LICENSE.txt doc/*
/usr/local/winetools
/usr/local/share/locale
/usr/local/bin

%changelog
* Thu Dec 08 2005 Joachim von Thadden <thadden@web.de>
- version 0.9 III
* Sat Nov 19 2005 Joachim von Thadden <thadden@web.de>
- version 0.9 II
* Thu Nov 08 2005 Joachim von Thadden <thadden@web.de>
- version for 0.9
* Wed May 25 2005 Gladiston Santana <gladiston.santana@gmail.com>
- Updated to 2.1.2 and CL10 package compatible
