%define _prefix /opt/freeware
%define _defaultdocdir %{_prefix}/doc

Name: 		intltool
Summary:	Utility for internationalizing various kinds of data files.
Version: 	0.25
Release: 	1
License: 	GPL
Group: 		Development/Tools
Source: 	%{name}-%{version}.tar.bz2

Patch0:		intltool-0.25-aix.patch
Patch1:		intltool-0.25-autotools.patch

URL: 		http://www.gnome.org
BuildRoot: 	%{_tmppath}/%{name}-%{version}-root
#Requires: 	patch
Obsoletes:      xml-i18n-tools
Provides: 	xml-i18n-tools = %{version}

%description
This tool automatically extracts translatable strings from oaf, glade,
bonobo ui, nautilus theme, .desktop, and other data files and puts
them in the po files.

%prep
%setup -q

if test x$PATCH = x ; then
  PATCH=patch ;
fi
$PATCH -p2 -s < %{_sourcedir}/intltool-0.25-aix.patch
$PATCH -p2 -s < %{_sourcedir}/intltool-0.25-autotools.patch


%build
PATH=%{_bindir}:$PATH ./configure --prefix=%{_prefix}

# The AIX make command don't know how to make these programs
# We just give it a hand
for file in intltool-update intltool-merge intltool-extract ; do
	sed -e "s:@INTLTOOL_PERL@:`which perl`:;" < $file.in > $file
done
make

%install
if test "%{buildroot}" != "/"; then
	rm -rf %{buildroot}
fi
mkdir -p %{buildroot}
make DESTDIR=%{buildroot} install-strip

# make links
cd %{buildroot}
for dir in bin
do
        mkdir -p usr/$dir
        cd usr/$dir
        ln -sf ../..%{_prefix}/$dir/* .
        cd -
done

%files
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog NEWS README
%{_bindir}/*
/usr/bin/*
%{_datadir}/intltool/*
%{_datadir}/aclocal/*
%{_mandir}/man*/*

