%define name libsigc++
%define version 2.6.2
%define release 1%{?_dist_release}

%define lib_name sigc++-2.0

Summary: The Typesafe Signal Framework for C++
Summary(ja): C++ 用の型安全なシグナルフレームワーク
Name: %{name}
Version: %{version}
Release: %{release}

Group: System Environment/Libraries
License: LGPLv2
URL: http://libsigc.sourceforge.net/

Source: http://ftp.gnome.org/pub/GNOME/sources/libsigc++/2.6/%{name}-%{version}.tar.xz

Buildroot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: gcc-c++
BuildRequires: m4

Vendor: Project Vine
Distribution: Vine Linux


%description
This library implements a full callback system for use in widget libraries,
abstract interfaces, and general programming. Originally part of the Gtk--
widget set, %{name} is now a seperate library to provide for more general
use. It is the most complete library of its kind with the ablity to connect
an abstract callback to a class method, function, or function object. It
contains adaptor classes for connection of dissimilar callbacks and has an
ease of use unmatched by other C++ callback libraries.

Package gtkmm2, which is a C++ binding to the GTK2 library, uses libsigc++.


%package devel
Summary: development tools for the Typesafe Signal Framework for C++ 
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: pkgconfig

%description devel
The %{name}-devel package contains the static libraries and header files
needed for development with %{name}.

%package examples
Summary: examples and tests for the Typesafe Signal Framework for C++ 
Group: Development/Libraries
Requires: %{name}-devel = %{version}-%{release}

%description examples
The %{name}-devel package contains source code of example and test
programs for %{name}.

%prep
%setup -q

%build
%configure --disable-static --enable-silent-rules
make %{_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT

# removed unpackage files
rm -f $RPM_BUILD_ROOT%{_libdir}/lib*.la

mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{lib_name}
cp -a examples tests $RPM_BUILD_ROOT%{_libdir}/%{lib_name}
find $RPM_BUILD_ROOT%{_libdir}/%{lib_name} -type d -name .libs |xargs -r rm -rf
find $RPM_BUILD_ROOT%{_libdir}/%{lib_name} -type d -name .deps |xargs -r rm -rf
find $RPM_BUILD_ROOT%{_libdir}/%{lib_name} -type f |xargs file |
	grep -E '(relocatable|executable|shell script)' |cut -d: -f1 |xargs -r rm -f

for i in $RPM_BUILD_ROOT%{_libdir}/%{lib_name}/{examples,tests}/Makefile; do
	rm -f $i.*
done

rm -rf docs-toinstall
mkdir -p docs-to-install
cp -pr $RPM_BUILD_ROOT%{_docdir}/%{name}-2.0/* docs-to-install/
rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}-2.0

# devhelp path fix
sed -i 's/doc\/%{name}-2.0/doc\/%{name}-devel-%{version}/g' $RPM_BUILD_ROOT%{_datadir}/devhelp/books/%{name}-2.0/%{name}-2.0.devhelp2
#sed -i 's/html\/..\/..\/index\.html/html\/index\.html/g' $RPM_BUILD_ROOT%{_datadir}/devhelp/books/libglademm-%{ver}/libglademm-%{ver}.devhelp

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%clean
rm -rf $RPM_BUILD_ROOT

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

%files devel
%defattr(-,root,root,755)
%{_includedir}/*
%{_libdir}/%{lib_name}/include
%{_libdir}/pkgconfig/*.pc
#{_libdir}/lib*.la
%{_libdir}/lib*.so
%{_datadir}/devhelp/books/%{name}-2.0/*
%doc docs-to-install/index.html docs-to-install/images
%doc docs-to-install/reference docs-to-install/tutorial

%files examples
%defattr(-,root,root,755)
%{_libdir}/%{lib_name}/examples
%{_libdir}/%{lib_name}/tests

%changelog
* Sat Nov 14 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.6.2-1
- new upstream release

* Sat Oct 31 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.6.1-1
- new upstream release

* Sun Oct 14 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.2.11-1
- new upstream release

* Sun Dec 25 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.2.10-1
- new upstream release

* Tue Sep 21 2010 IWAI, Masaharu <iwai@alib.jp> 2.2.8-2
- build with rpm-4.8.1-1 for pkg-config file

* Thu Sep  9 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.2.8-1
- new upstream release

* Thu Apr 29 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.2.6-1
- new upstream release
- built with new toolchain

* Sun Sep 27 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.2.4.2-1
- new upstream release
- remove static libraries from devel package

* Fri Mar 20 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.2.3-1
- new upstream release
- spec in UTF-8

* Sat Apr 12 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.2.2-2vl5
- removed .la files from devel package

* Sun Apr  6 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.2.2-1vl5
- new upstream release

* Fri May 11 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0.17-0vl2
- rebuild with new environment/toolchain

* Sun Sep 24 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.0.17-0vl1
- new upstream release

* Tue Aug  2 2005 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.0.16-0vl2
- rebuild with new libtool

* Tue Aug  2 2005 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.0.16-0vl1
- new upstream release

* Sat Jul 30 2005 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.0.15-0vl1
- new upstream release

* Sat Jun 11 2005 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.0.14-0vl1
- new upstream release

* Sun Mar 20 2005 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.0.10-0vl1
- new upstream release
- added tutorial to devel package

* Sun Nov 14 2004 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.0.6-0vl1
- update to 2.0.6

* Sun Dec 14 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.2.5-0vl1
- update to 1.2.5
- add Requires: pkgconfig

* Sat Oct  4 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.0.4-0vl3
- rebuild to remove dependance <5371>
- add Japanese summary
- use better macros
- s/Copyright/License/

* Mon Nov 25 2002 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0.4-0vl2
- rebuild with new toolchain

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

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

* Sat Apr 15 2000 Dmitry V. Levin <ldv@fandra.org>
- updated Url and Source fileds
- 1.0.0 stable release

* Sat Jan 22 2000 Dmitry V. Levin <ldv@fandra.org>
- filtering out -fno-rtti and -fno-exceptions options from $RPM_OPT_FLAGS
- minor install section cleanup

* Wed Jan 19 2000 Allan Rae <rae@lyx.org>
- autogen just creates configure, not runs it, so cleaned that up too.

* Wed Jan 19 2000 Dmitry V. Levin <ldv@fandra.org>
- minor attr fix
- removed unnecessary curly braces
- fixed Herbert's adjustement

* Sat Jan 15 2000 Dmitry V. Levin <ldv@fandra.org>
- minor package dependence fix

* Sat Dec 25 1999 Herbert Valerio Riedel <hvr@gnu.org>
- fixed typo of mine
- added traditional CUSTOM_RELEASE stuff
- added SMP support

* Thu Dec 23 1999 Herbert Valerio Riedel <hvr@gnu.org>
- adjusted spec file to get tests.Makefile and examples.Makefile from scripts/

* Fri Oct 22 1999 Dmitry V. Levin <ldv@fandra.org>
- split into three packages: %name, %name-devel and %name-examples

* Thu Aug 12 1999 Karl Nelson <kenelson@ece.ucdavis.edu>
- updated source field and merged conflicts between revisions.

* Tue Aug 10 1999 Dmitry V. Levin <ldv@fandra.org>
- updated Prefix and BuildRoot fields

* Thu Aug  5 1999 Herbert Valerio Riedel <hvr@hvrlab.dhs.org>
- made sure configure works on all alphas

* Wed Jul  7 1999 Karl Nelson <kenelson@ece.ucdavis.edu>
- Added autoconf macro for sigc.

* Fri Jun 11 1999 Karl Nelson <kenelson@ece.ucdavis.edu>
- Made into a .in to keep version field up to date 
- Still need to do release by hand

* Mon Jun  7 1999 Dmitry V. Levin <ldv@fandra.org>
- added Vendor and Packager fields

* Sat Jun  5 1999 Dmitry V. Levin <ldv@fandra.org>
- updated to 0.8.0

* Tue Jun  1 1999 Dmitry V. Levin <ldv@fandra.org>
- initial revision