%define ver      0.5.9
%define RELEASE 3
%define rel     %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE}
%define prefix   %{_prefix}
%define sysconfdir	/etc

Summary: A GTK+ GUI builder.
Name: glade
Version: %ver
Release: %rel
Copyright: GPL
URL: http://glade.pn.org/
Source: http://glade.pn.org/glade-%version.tar.gz
Patch: glade-%version-aixlt.patch
BuildRoot: /var/tmp/glade-%version-root
Group: Development/Tools

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

%description
GLADE is a free user interface builder for GTK+ and GNOME, released
under the GNU General Public License (GPL). GLADE can produce C source
code; C++, Ada95, Python and Perl support is also available, via
external tools which process the XML interface description files
output by GLADE. GLADE supports most GTK+ 1.2 widgets. Support for
styles, however, is not complete.

Install glade if you need an interface builder for GTK+ and GNOME.

%prep
%setup -q
%patch0 -p2 -b .aixlt

%build
%ifarch alpha
  ARCH_FLAGS="--host=alpha-redhat-linux"
%endif

# 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

./configure --prefix=%{_prefix} $ARCH_FLAGS
if [ "$SMP" != "" ]; then
	make MAKE="make -j$SMP" LDFLAGS="-Wl,-brtl" PACKAGE_PIXMAPS_DIR=%{_prefix}/share/pixmaps/glade
else
	make LDFLAGS="-Wl,-brtl" PACKAGE_PIXMAPS_DIR=%{_prefix}/share/pixmaps/glade
fi

%install
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT
make prefix=$RPM_BUILD_ROOT%{_prefix} \
	PACKAGE_PIXMAPS_DIR=$RPM_BUILD_ROOT%{_prefix}/share/pixmaps/glade \
	install

strip $RPM_BUILD_ROOT%{_prefix}/bin/* ||:


(cd $RPM_BUILD_ROOT
 mkdir -p usr/bin
 cd usr/bin
 ln -sf ../..%{_prefix}/bin/* .
)

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog INSTALL README NEWS TODO 
/usr/bin/glade
%{_prefix}/bin/glade
%{_prefix}/share/gnome/apps/Development/glade.desktop
%{_prefix}/lib/locale/*/*/*
%{_prefix}/share/glade
%{_prefix}/share/pixmaps/glade/glade_logo.png

%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

* Wed Feb 23 2000 Cristian Gafton <gafton@redhat.com>
- minor bug fixes from jrb

* Mon Feb 14 2000 Jonathan Blandford <jrb@redhat.com>
- Update to 0.5.6
- removed patch to revert desktop entry to Development.

* Fri Sep 17 1999 Elliot Lee <sopwith@redhat.com>
- Update to 0.5.3
- Merge in changes from upstream spec file (e.g. include locale files)

* Wed Aug 25 1999 Cristian Gafton <gafton@redhat.com>
- fixed the group description

* Fri Aug 20 1999 Michael Fulbright <drmike@redhat.com>
- moved desktop entry into 'Applications' from 'Development' on menu

* Mon Aug 16 1999 Michael Fulbright <drmike@redhat.com>
- Integrated into RH distribution

* Thu Aug 05 1999 Preben Randhol <randhol@pvv.org>
- Latest source 0.5.1

* Wed Jul 09 1999 Preben Randhol <randhol@pvv.org>
- Latest source 0.5.0

* Wed Apr 12 1999 Preben Randhol <randhol@pvv.org>
- Latest source

* Wed Mar 04 1999 Preben Randhol <randhol@pvv.org>
- 990304 Latest from CVS

