%define ver 2.0

Summary: A C++ wrapper for gtksourceview
Summary(ja): gtksourceview の C++ ラッパー
Name: gtksourceviewmm
Version: 2.10.3
Release: 2%{?_dist_release}
License: LGPL
Group: System Environment/Libraries
Source: ftp://ftp.gnome.org/pub/GNOME/sources/gtksourceviewmm/2.10/%{name}-%{version}.tar.xz

Buildroot: %{_tmppath}/%{name}-%{version}-root

Requires:	gtksourceview2 >= 2.9.7
Requires:	gtkmm2 >= 2.12
BuildRequires:	gtksourceview2-devel >= 2.9.7
BuildRequires:	gtkmm2-devel >= 2.12
BuildRequires:	mm-common
BuildRequires:	autoconf

Vendor: Project Vine
Distribution: Vine Linux
Packager: Takemikaduchi

Patch0: gtksourceviewmm-2.10.3-c++11.patch

%description
Gtksourceviewmm is a C++ wrapper for gtksourceview.


%package	devel
Summary: 	Development tools for gtksourceviewmm applications.
Summary(ja): 	gtksourceviewmm アプリケーションの開発用ファイル
Group: 		Development/Libraries
Requires:       %{name} = %{version}-%{release}
Requires:	gtksourceview2-devel >= 2.9.7
Requires:	gtkmm2-devel >= 2.12

%description devel
Header files and libraries for building a extension library for the gtksourceviewmm.

%prep
%setup -q 
%patch0 -p1

%build
autoreconf -if
%configure --disable-static
make %{?_smp_mflags}

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

make install DESTDIR=$RPM_BUILD_ROOT

find $RPM_BUILD_ROOT -type f -name "*.a" -exec rm -f {} ';'
find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';'

# Fix documentation installation, put everything under gtk-doc
mkdir -p $RPM_BUILD_ROOT%{_datadir}/gtk-doc/html/%{name}-%{ver}
mv ${RPM_BUILD_ROOT}%{_docdir}/%{name}-%{ver}/* $RPM_BUILD_ROOT%{_datadir}/gtk-doc/html/%{name}-%{ver}/

# devhelp path fix
sed -i 's:doc/%{name}-%{ver}:gtk-doc/html/%{name}-%{ver}:g' $RPM_BUILD_ROOT%{_datadir}/devhelp/books/%{name}-%{ver}/%{name}-%{ver}.devhelp2

# remove demos, examples
rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}-%{ver}/demo
rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}-%{ver}/examples

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

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

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

%files  devel
%defattr(-, root, root)
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/%{name}-*
%{_libdir}/pkgconfig/*.pc
%{_datadir}/gtk-doc/html/*
%{_datadir}/devhelp/books/*

%changelog
* Wed Jun 29 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.10.3-2
- rebuild with gcc-5.4.0
- add Patch0 (gtksourceviewmm-2.10.3-c++11.patch)

* Sun May 20 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.10.3-1
- new upstream release

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

* Thu Jul 29 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.10.1-1
- initial build for Vine Linux

