
%define ver	0.13a
%define rel	2

Summary: GTK+ binding for librep Lisp environment
Name: rep-gtk
Version: %{ver}
Release: %{rel}
Requires: librep >= 0.10, gtk+ >= 1.2
Copyright: GPL
Group: Development/Languages
Source: ftp://rep-gtk.sourceforge.net/pub/rep-gtk/rep-gtk-%{ver}.tar.gz
Patch0: rep-gtk-%{ver}-aixcomp.patch
Patch1: rep-gtk-%{ver}-nonfunc.patch
URL: http://rep-gtk.sourceforge.net/
Buildroot: /var/tmp/%{name}-%{ver}-%{rel}-root

%ifarch ia64
%define DEFCC bcc
%else
%define DEFCC cc
%endif

%description
This is a binding of GTK+ for the librep Lisp interpreter. It is based
on Marius Vollmer's guile-gtk package (initially version 0.15, updated
to 0.17), with a new glue-code generator.

%package libglade
Summary: librep binding for the libglade library for loading user interfaces.
Group: Development/Languages
Requires: %{name} libglade

%description libglade
This is a binding of libglade for the librep Lisp interpreter. libglade
allows applications to dynamically load XML descriptions of GTK+ widget
hierarchies. These hierarchies may be created by the GLADE GUI builder.

%package gnome
Summary: GNOME binding for librep
Group: Development/Languages
Requires: %{name}, gnome-libs, libglade

%description gnome
This is a binding of the various GNOME libraries for the librep Lisp
interpreter. It include support for the basic GNOME functions, the
GNOME user interface widgets, the GNOME Canvas architecture, and the
GNOME version of libglade.

%prep
%setup -q
%patch0 -p1 -b .aixcomp
%patch1 -p1 -b .nonfunc

%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
if test "X$CC" != "Xgcc"
then
       export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's:-fsigned-char::'`
       export CFLAGS="$RPM_OPT_FLAGS"
fi
CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="-Wl,-brtl" ./configure --prefix %{_prefix} %{_host}
make CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="-Wl,-brtl"

%install
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT
make install \
    installdir=$RPM_BUILD_ROOT%{_prefix}/libexec/rep/%{_host}

%clean
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc README README.guile-gtk BUGS ChangeLog gtk.defs gdk.defs
%{_prefix}/libexec/rep/%{_host}/libsgtk-types.so*
%{_prefix}/libexec/rep/%{_host}/libgtk.so*
%{_prefix}/libexec/rep/%{_host}/sgtk-types.la
%{_prefix}/libexec/rep/%{_host}/gtk.la

%files libglade
%defattr(-,root,root)
%doc libglade.defs examples/test-libglade examples/simple.glade
%doc examples/rep-ui examples/rep-ui.glade
%{_prefix}/libexec/rep/%{_host}/libglade.so*
%{_prefix}/libexec/rep/%{_host}/libglade.la

%files gnome
%defattr(-,root,root)
%doc gnome*.defs gdk-pixbuf.defs libglade.defs
%doc examples/gnome-test examples/canvas-test
%{_prefix}/libexec/rep/%{_host}/libgnome*.so*
%{_prefix}/libexec/rep/%{_host}/gnome*.la
%{_prefix}/libexec/rep/%{_host}/libglade-gnome.so*
%{_prefix}/libexec/rep/%{_host}/libglade-gnome.la
%{_prefix}/libexec/rep/%{_host}/libgdk-pixbuf.so*
%{_prefix}/libexec/rep/%{_host}/gdk-pixbuf.la


%changelog
* Fri Mar 09 2001 Marc Stephenson <marc@austin.ibm.com>
- Add logic for default compiler
- Rebuild against new shared objects

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

* Mon Jan 10 2000 Bill Nottingham <notting@redhat.com>
- update to 0.8

* Wed Nov 17 1999 Michael K. Johnson <johnsonm@redhat.com>
- include John's REP_GTK_DONT_INITIALIZE patch

* Fri Sep 17 1999 John Harper <john@dcs.warwick.ac.uk>
- specify installdir when installing

* Tue Sep 14 1999 Aron Griffis <agriffis@bigfoot.com>
- 0.4 spec file update: added buildroot
