%define name gtkmm
%define version 1.2.10
%define release 0vl3

Summary: A C++ interface for the GTK+ (a GUI library for X).
Name: %{name}
Version: %{version}
Release: %{release}
License: LGPL
Group: System Environment/Libraries
Source: ftp://ftp.gtk.org/pub/gtk/gtk--/%{name}-%{version}.tar.bz2
URL: http://gtkmm.sourceforge.net/
Obsoletes: Gtk--, gtk--
Buildroot: %{_tmppath}/%{name}-%{version}-root
Requires: gtk+, glib, libsigc++10
BuildPrereq: gtk+-devel, glib-devel, libsigc++10-devel

%description
This package provides a C++ interface for GTK+ (the Gimp ToolKit) GUI
library.  The interface provides a convenient interface for C++
programmers to create GUIs with GTK+'s flexible object-oriented framework.
Features include type safe callbacks, widgets that are extensible using
inheritance and over 110 classes that can be freely combined to quickly
create complex user interfaces.

%package	devel
Summary: 	Headers for developing programs that will use Gtk--.
Group: 		Development/Libraries
Obsoletes:	Gtk---devel, gtk---devel
Requires:       %{name}, gtk+-devel, glib-devel, libsigc++10-devel

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

%prep
%setup -q

%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}" CXXFLAGS="%{optflags}" ./autogen.sh $ARCH_FLAGS \
		--prefix=%{_prefix} \
		--disable-static \
		--enable-shared --enable-docs
else
	CFLAGS="%{optflags}" CXXFLAGS="%{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

# since the tutorial and FAQ is not build by default
#make -C docs/tutorial/
#make -C docs/FAQ/

%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 $@ `gtkmm-config --cflags --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
%{_bindir}/*
%{_includedir}/*.h
%{_includedir}/gdk--
%{_includedir}/gtk--
%{_libdir}/*.la
#{_libdir}/*.a
%{_libdir}/*.so
%{_libdir}/gtkmm/*
%{_datadir}/aclocal/gtk--.m4

###########################################################################
%changelog
* Sun Dec 14 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.2.10-0vl3
- Rename Requires: libsigc++10 and BuildRequires: libsigc++10

* Sat Oct  4 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.2.10-0vl2
- rebuild to remove dependancy
- s/Copyright/License/

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

* Mon Jun 10 2002 Tomoya TAKA <taka@vinelinux.org> 1.2.9-0vl1
- update to 1.2.9
- arrange spec file

* Thu Feb 07 2002 Satoshi IWMAOTO <satoshi.iwamoto@nifty.ne.jp>
- 1.2.8-0vl2
- fix files list

* Wed Feb 06 2002 Satoshi IWMAOTO <satoshi.iwamoto@nifty.ne.jp>
- 1.2.8-0vl1
- update source
- Build for Vine Linux 2.5

* Wed Feb 21 2001 yoneda kenji <yoneda@n.isl.titech.ac.jp>
- packaged for Vine Linux 2.1

* Sun May 21 2000 Herbert Valerio Riedel <hvr@gnu.org>
- fixed up documentation in gtkmm-devel

* Sun May 07 2000 Herbert Valerio Riedel <hvr@gnu.org>
- CXXFLAGS are set too

* Sun Feb 20 2000 Herbert Valerio Riedel <hvr@gnu.org>
- gnome-- and gtk-- are packaged separately

* Fri Jan 28 2000 Herbert Valerio Riedel <hvr@gnu.org>
- adapted to the new docs

* Sun Jan  2 2000 Herbert Valerio Riedel <hvr@gnu.org>
- examples should be makeable now

* Sun Dec 26 1999 Herbert Valerio Riedel <hvr@gnu.org>
- commented out manpages for now...

* Sat Dec 25 1999 Herbert Valerio Riedel <hvr@gnu.org>
- added dependancies on libsigc++

* Sat Nov  6 1999 Herbert Valerio Riedel <hvr@gnu.org>
- cleanup for 1.1.x
- changed rpm package name from Gtk-- to gtkmm
- removed that static hack

* Sat Oct 21 1999 Karl Einar Nelson <kenelson@ece.ucdavis.edu>
- Changed dist from Gtk--- to gtkmm-

* Sat Sep 11 1999 Herbert Valerio Riedel <hvr@gnu.org>
- added SMP support
- added custom release feature

* Sun Aug  1 1999 Herbert Valerio Riedel <hvr@gnu.org>
- Updated to gtk---1.1.x

* Thu Jul 29 1999 Herbert Valerio Riedel <hvr@gnu.org>
- Updated to gtk---1.0.x
- Merged in changes from redhat's gtk--.spec
- conditional build of static libraries by define 'STATIC'

* Thu May 10 1998 Bibek Sahu <scorpio@dodds.net>
- Upgraded to gtk---0.9.3

* Thu Apr 30 1998 Bibek Sahu <scorpio@dodds.net>
- Fixed problem with gtk---devel requiring libgtk-- (not gtk--).  Oops.

* Thu Apr 30 1998 Bibek Sahu <scorpio@dodds.net>
- Fixed problem with most of the headers not being included.

* Thu Apr 30 1998 Bibek Sahu <scorpio@dodds.net>
- Upgraded to gtk---0.9.1

* Tue Apr 28 1998 Bibek Sahu <scorpio@dodds.net>
- Fixed to build gtk-- and gtk---devel packages.

* Tue Apr 28 1998 Bibek Sahu <scorpio@dodds.net>
- First (s)rpm build.

