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

Summary:	Interfaces for accessibility support.
Name: 		atk
Version: 	1.10.3
Release: 	2 
License: 	LGPL
Group: 		System Environment/Libraries
Source: 	ftp://ftp.gtk.org/pub/gtk/v2.0/atk-%{version}.tar.bz2

Patch0:		atk-1.10.3-aix.patch
Patch1:		atk-1.10.3-autotools.patch

URL: 		http://developer.gnome.org/projects/gap/
BuildRoot: 	%{_tmppath}/atk-%{version}-root
BuildPreReq: glib2-devel >= %{glib2_version}
BuildPreReq: libtool
BuildPreReq: /usr/bin/autoconf
#BuildPreReq: /usr/bin/aclocal-1.4

%description
The ATK library provides a set of interfaces for adding accessibility
support to applications and graphical user interface toolkits. By
supporting the ATK interfaces, an application or toolkit can be used
with tools such as screen readers, magnifiers, and alternative input
devices.

%package devel
Summary: 	Accessibility Toolkit development files.
Group: Development/Libraries
Requires: atk = %{PACKAGE_VERSION}
Requires: glib2-devel >= %{glib2_version}

%description devel
The atk-devel package includes the static libraries, header files, and
developer docs for the atk package.

Install atk-devel if you want to develop programs which will use ATK.

%prep
%setup -q

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


%build
PATH=%{_bindir}:$PATH ./configure --prefix=%{_prefix} --disable-gtk-doc
PATH=%{_bindir}:$PATH 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 lib include share
do
        mkdir -p usr/$dir
        cd usr/$dir
        ln -sf ../..%{_prefix}/$dir/* .
        cd -
done

%post
# Prototype support gtk 64 bit
mkdir -p /opt/freeware/64/lib
cd /opt/freeware/64/lib
ln -sf /opt/freeware/lib/libatk-1.0.a .

%files
%defattr(-, root, system)
%doc README AUTHORS COPYING ChangeLog
%{_prefix}/lib/libatk*.a
%{_datadir}/locale/*/LC_MESSAGES/*.mo
/usr/lib/libatk*.a
/usr/share

%files devel
%defattr(-, root, system)
#%defattr(-, root, root)
%{_prefix}/lib/libatk*.la
%{_prefix}/include/*
/usr/include/*
%{_prefix}/lib/pkgconfig/*
%{_datadir}/gtk-doc/
/usr/share


%changelog
*  Fri Dec 23 2005  BULL
 - Release 2
 - Prototype gtk 64 bit
*  Tue Nov 15 2005  BULL
 - Release  1
 - New version  version: 1.10.3

*  Tue Aug 09 2005  BULL
 - Release  3
 - Create symlinks between /usr/share and /opt/freeware/share

*  Mon May 30 2005  BULL
 - Release  2
 - .o removed from lib
*  Wed May 25 2005  BULL
 - Release  1
 - New version  version: 1.9.1

*  Tue Nov 23 2004  BULL
 - Release  1
 - New version  version: 1.8.0

