%define  ver     0.12
%define  rel     1
%define  prefix  %{_prefix}

Summary: Theme engines for GTK+.
Name: gtk-engines
Version: %ver
Release: %rel
Copyright: GPL
Group: System Environment/Libraries
Source: ftp://ftp.gnome.org/pub/GNOME/stable/source/gtk-engines/gtk-engines-%{PACKAGE_VERSION}.tar.gz
Patch0: gtk-engines-%{ver}-aix.patch

Url: http://gtk.themes.org
BuildRoot:/var/tmp/gtk-engines-%{PACKAGE_VERSION}-root
Docdir: %{prefix}/doc

%ifarch ia64
  %define DEFCCIA cc
  %define DEFCC %{DEFCCIA}
%else
  %define DEFCC cc
%endif

%description
The gtk-engines package contains shared objects and configuration
files that implement a number of GTK+ theme engines.  Theme engines
provide different looks for GTK+, so that it can resemble other
toolkits or operating systems.  The gtk-engines package contains
graphical engines for various GTK+ toolkit themes, including Notif,
Redmond95, Pixmap and Metal (swing-like).

%prep
%setup -q
%patch0 -p1 -b .aix

%build
# Use the default compiler for this platform - gcc otherwise
if [[ -z "$CC" ]]
then
    if test "X`type %{DEFCC} 2>/dev/null`" != 'X'; then
       export CC=%{DEFCC}
    else 
       export CC=gcc
    fi
fi

libtoolize --force

if test "X$CC" != "Xgcc"
then
       export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's:-fsigned-char::'`
       export CFLAGS="$RPM_OPT_FLAGS"
fi
%ifarch ppc rs6000
   export LDFLAGS="-Wl,-brtl"
%endif
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix}
make

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT

#
# makefile is broken, sets exec_prefix explicitely.
#
make exec_prefix=$RPM_BUILD_ROOT%{prefix} prefix=$RPM_BUILD_ROOT%{prefix} install 

# sanitize permissions
find $RPM_BUILD_ROOT%{prefix}/share/themes -type d -exec chmod 755 {} \;
find $RPM_BUILD_ROOT%{prefix}/share/themes -type f -name "*.png" -exec chmod 644 {} \;

cd $RPM_BUILD_ROOT
mkdir -p usr/lib
cd usr/lib
ln -sf ../..%{prefix}/lib/gtk gtk

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-, root, root)
%doc COPYING README ChangeLog
/usr/lib/gtk
%{prefix}/lib/gtk/themes/engines/*
%{prefix}/share/themes/*

%changelog
* Tue Jul 17 2001 Dan McNichol <mcnichol@austin.ibm.com>
- update release to 0.12

* Thu Mar 29 2001 Marc Stephenson <marc@austin.ibm.com>
- Only use -brtl for ppc

* Fri Mar 09 2001 Marc Stephenson <marc@austin.ibm.com>
- Add logic for default compiler
- Rebuild against new shared objects
- Undo stdlib changes - these are not real libs

* Fri Feb 16 2001 aixtoolbox <aixtoollbox-l@austin.ibm.com>
- Account for different standard lib location in IA64 32-bit ABI

* Fri Oct 27 2000 pkgmgr <pkgmgr@austin.ibm.com>
- Modify for AIX Freeware distribution

* Tue Feb 22 2000 Bill Nottingham <notting@redhat.com>
- sanitize various things (permissions, .xv thumbnails)

* Thu Feb 10 2000 Preston Brown <pbrown@redhat.com>
- remove backup files from package

* Tue Jan 25 2000 Owen Taylor <otaylor@redhat.com>
- Update to 0.10 (fixing problem with text in eventboxes
  becoming garbled)

* Wed Sep 15 1999 Elliot Lee <sopwith@redhat.com>
- Misc fixes from DrMike suggestions

* Thu Sep 09 1999 Elliot Lee <sopwith@redhat.com>
- Update to 0.6, etc.

* Wed Apr 14 1999 Michael Fulbright <drmike@redhat.com>
- removed Odo (has issues)

* Fri Apr 9 1999 The Rasterman <raster@redhat.com>
- patched metal theme - fixed handlebox redraw.

* Wed Mar 31 1999 Michael Fulbright <drmike@redhat.com>
- removed some themes that were misbehaving

* Tue Mar 16 1999 Michael Fulbright <drmike@redhat.com>
- removed enlightened themes, seems to be defective

* Thu Mar 11 1999 Michael Fulbright <drmike@redhat.com>
- removed Default theme data, this comes with gtk+ package

* Wed Mar 10 1999 Michael Fulbright <drmike@redhat.com>
- added extra gtk themes

* Thu Mar 04 1999 Michael Fulbright <drmike@redhat.com>
- version 0.5

* Fri Feb 12 1999 Michael Fulbright <drmike@redhat.com>
- version 0.4

* Wed Feb 03 1999 Michael Fulbright <drmike@redhat.com>
- version 0.3

* Mon Dec 18 1998 Michael Fulbright <drmike@redhat.com>
- version 0.2

* Wed Dec 16 1998 Michael Fulbright <drmike@redhat.com>
- rebuild because gtk+ version changed

* Wed Dec 16 1998 Michael Fulbright <drmike@redhat.com>
- in preparation for GNOME freeze

* Fri Nov 20 1998 Michael Fulbright <drmike@redhat.com>
- First try at a spec file
