%define ver 3.0

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

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

Requires:	gtksourceview3 >= 3.2.0
Requires:	gtkmm3 >= 3.2.0
BuildRequires:	gtksourceview3-devel >= 3.2.0
BuildRequires:	gtkmm3-devel >= 3.2.0

Vendor: Project Vine
Distribution: Vine Linux
Packager: Takemikaduchi

# from upstream
Patch0: gtksourceviewmm-3.18.0-c++11-markup.patch

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


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

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

%prep
%setup -q -n gtksourceviewmm-%{version}
%patch0 -p1

%build
%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/gtksourceviewmm-%{ver}
mv ${RPM_BUILD_ROOT}%{_docdir}/gtksourceviewmm-%{ver}/* $RPM_BUILD_ROOT%{_datadir}/gtk-doc/html/gtksourceviewmm-%{ver}/

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

# remove demos, examples
rm -rf $RPM_BUILD_ROOT%{_datadir}/gtksourceviewmm-%{ver}/demo
rm -rf $RPM_BUILD_ROOT%{_datadir}/gtksourceviewmm-%{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}/gtksourceviewmm-*
%{_libdir}/pkgconfig/*.pc
%{_datadir}/gtk-doc/html/*
%{_datadir}/devhelp/books/*

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

* Sun Nov 01 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.18.0-1
- new upstream release

* Fri Dec 13 2013 NAKAMURA Kenta <kenta@vinelinux.org> 3.2.0-2
- rebuilt with the current gtksourceview3

* Tue Jun 19 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.2.0-1
- initial build

