%define name gnomemm
%define version 1.2.4
%define release 0vl4

Summary: 	A C++ interface for Gnome libs (a GUI library for X).
Name: 		%{name}
Version:	%{version}
Release:	%{release}
License: 	LGPL
Group: 		System Environment/Libraries
Source:         ftp://prdownloads.sourceforge.net/gtkmm/%{name}-%{version}.tar.gz
Patch:		gnomemm-gcc3.patch
URL: 		http://gtkmm.sourceforge.net/
BuildRoot: 	%{_tmppath}/%{name}-%{version}-root
Requires:	gtk+ >= 1.2.7, gnome-libs, db4
BuildPrereq:    libsigc++10-devel >= 1.0.3, gtkmm-devel >= 1.2.5, gnome-libs-devel, db4-devel

%description
This package provides a C++ interface for GnomeUI.  It is a subpackage
of the Gtk-- project.  The interface provides a convenient interface for C++
programmers to create Gnome GUIs with GTK+'s flexible object-oriented 
framework.

%package	devel
Summary: 	Headers for developing programs that will use Gnome--.
Group: 		Development/Libraries
Requires:       %{name}, gnome-libs-devel

%description    devel
This package contains the headers that programmers will need to develop
applications which will use Gnome--, part of Gtk-- the C++ interface to 
the GTK+ (the Gimp ToolKit) GUI library.

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

%build

# ...hope this can be removed soon
%ifarch alpha
	ARCH_FLAGS="--host=alpha-linux-gnu"
%endif

# Needed for snapshot releases.
if [ ! -f configure ]; then
	CFLAGS="%{optflags}" ./autogen.sh $ARCH_FLAGS \
		--prefix=%{_prefix} \
		--disable-static \
		--enable-shared --enable-docs
else
	CC="$CC" CXX="$CXX" CPP="$CPP" \
	CFLAGS="%{optflags}" ./configure  $ARCH_FLAGS \
		--prefix=%{_prefix} \
		--disable-maintainer-mode \
		--disable-static \
		--enable-shared --enable-docs
fi

if [ "$SMP" != "" ]; then
  make -j$SMP "MAKE=make -j$SMP"
  make
else
  make
fi

%install
if [ -d %{buildroot} ]; then rm -rf %{buildroot}; fi
make DESTDIR=%{buildroot} install

# replace examples.conf by a really simple one
(
  echo 'CXXBUILD = g++ -O2 $< -o $@ `gnome-config gnomemm --cflags --libs` '
  echo 'CXXCOMPILE = g++ -O2 -c $< -o $@ `gnome-config gnomemm --cflags` '
  echo 'CXXLINK = g++ -O2 -o $@ `gnome-config gnomemm --libs` '
) > examples/examples.conf

rm examples/Makefile.am examples/Makefile.in examples/Makefile
rm examples/examples.conf.in

## strip down the docs 
#find docs/ \
#\( 	-name 'Makefile' -or	\
#	-name 'Makefile.in' -or	\
#	-name 'Makefile.am' -or	\
#	-name '*.m4' -or	\
#	-name 'html' -or	\
#	-name 'header' -or 	\
#	-name '*.h' 		\
#\)	-exec rm -rf {} \;

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%clean
rm -rf %{buildroot}

%files
%defattr(-, root, root)
%doc AUTHORS COPYING ChangeLog INSTALL NEWS README
%{_libdir}/*.so.*

%files  devel
%defattr(-, root, root)
%doc examples/ docs/  AUTHORS COPYING ChangeLog INSTALL NEWS README
%{_includedir}/*.h
%{_includedir}/gnome--
%{_libdir}/*.la
#{_libdir}/*.a # uncomment this one for static libs 
%{_libdir}/*.sh
%{_libdir}/*.so
%{_datadir}/aclocal/gnome--.m4

###########################################################################

%changelog
* Wed May 25 2005 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.2.4-0vl4
- rebuild for VineSeedPlus

* Tue May 17 2005 Tomohiro 'Tomo-p' KATO <tomop@teamgedoh.net> 1.2.4-0vl3
- fix 'BuildPrereq:'.

* Tue May 17 2005 Tomohiro 'Tomo-p' KATO <tomop@teamgedoh.net> 1.2.4-0vl2
- add Patch0.

* Sat Oct  4 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.2.4-0vl1
- new upstream release
- rebuild to remove dependancy
- s/Copyright/License/

* Mon Dec  2 2002 Daisuke SUZUKI <daisuke@linux.or.jp> 1.2.3-0vl1
- new upstream release
- build with new toolchain

* Mon Jun 10 2002 Tomoya TAKA <taka@vinelinux.org> 1.2.2-0vl1
- build for Vine Linux
- arrange Requires and BuildPrereq
- use rpm macros

* Sat Mar 10 2001 Herbert Valerio Riedel <hvr@gnu.org>
- improved examples.conf
- fixed example build problems

* Thu May 11 2000 Herbert Valerio Riedel <hvr@gnu.org>
- removed lib/gtkmm from files section
- removed empty obsolete tags

* Sun Jan 30 2000 Karl Einar Nelson <kenelson@sourceforge.net>
- adapted from gtk--.spec
