%define glib2_version 2.48.0
%define gtk3_version 3.20.0

%define po_package gtksourceview-3.0

Summary:        A library for viewing source files
Summary(ja):    ソースコードなどを表示するためのライブラリ
Name:           gtksourceview3
Version:        3.24.11
Release:        1%{?_dist_release}
Group:          System Environment/Libraries

Vendor:         Project Vine
Distribution:   Vine Linux

# the library itself is LGPL, some .lang files are GPL
License:        LGPLv2+ and GPLv2+
URL:            https://wiki.gnome.org/Projects/GtkSourceView
%global         shortver %(echo %{version} | sed -e 's/\.[0-9]*$//')
Source0:        https://download.gnome.org/sources/gtksourceview/%{shortver}/gtksourceview-%{version}.tar.xz
BuildRoot:      %{_tmppath}/%{name}-%{version}-root
BuildRequires:  glib2-devel >= %{glib2_version}
BuildRequires:  gtk3-devel >= %{gtk3_version}
BuildRequires:  libxml2-devel
BuildRequires:  vala-devel
BuildRequires:  intltool >= 0.35
BuildRequires:  gettext 


%description
GtkSourceView is a text widget that extends the standard GTK+
GtkTextView widget. It improves GtkTextView by implementing 
syntax highlighting and other features typical of a source code editor.

This package contains version 2 of GtkSourceView. The older version
1 is contains in the gtksourceview package.

%package devel
Summary: Files to compile applications that use gtksourceview2
Summary(ja): gtksourceview2 を使用するアプリケーションのコンパイルに必要なファイル
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: gtk3-devel >= %{gtk3_version} 
Requires: libxml2-devel
Requires: pkgconfig

%description devel
gtksourceview2-devel contains the files required to compile 
applications which use GtkSourceView 2.x.

%prep
%setup -q -n gtksourceview-%{version}

%build

%configure --disable-gtk-doc --disable-static

make %{?_smp_mflags}

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

# remove unwanted files
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT%{_datadir}/gtksourceview-3.0/language-specs/check.sh
rm -f $RPM_BUILD_ROOT%{_datadir}/gtksourceview-3.0/language-specs/convert.py

%find_lang %{po_package}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%clean
rm -rf $RPM_BUILD_ROOT

%files -f %{po_package}.lang
%defattr(-,root,root,-)
%license COPYING
%doc README AUTHORS NEWS MAINTAINERS 
%{_libdir}/*.so.*
%{_libdir}/girepository-1.0/*.typelib
%{_datadir}/gtksourceview-3.0

%files devel
%defattr(-,root,root,-)
%{_includedir}/gtksourceview-3.0
%{_libdir}/pkgconfig/*.pc
%{_libdir}/*.so
%{_datadir}/gir-1.0/*.gir
%{_datadir}/gtk-doc
%dir %{_datadir}/vala
%dir %{_datadir}/vala/vapi
%{_datadir}/vala/vapi/gtksourceview-3.0.deps
%{_datadir}/vala/vapi/gtksourceview-3.0.vapi


%changelog
* Wed Mar 18 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.24.11-1
- new upstream release.

* Sun Jul 17 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.20.4-1
- new upstream release

* Sat Jul 09 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.18.4-1
- new upstream release

* Sun Jan 24 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.18.2-1
- new upstream release

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

* Sun Apr 19 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.16.1-1
- new upstream release

* Sun Mar 29 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.16.0-1
- new upstream release

* Mon Jan 12 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.14.3-1
- new upstream release

* Wed Nov 19 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.14.2-1
- new upstream release

* Sun Oct 26 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.14.1-1
- new upstream release

* Sun Aug 31 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.12.3-1
- new upstream release

* Fri May 16 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.12.2-1
- new upstream release

* Sun Apr 20 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.12.1-1
- new upstream release

* Sat Mar 29 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.12.0-1
- new upstream release

* Sat Jan 04 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.10.1-2
- rebuild with VineSeed environment

* Sat Oct 26 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.10.1-1
- new upstream release

* Mon Jul 15 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.8.2-1
- new upstream release

* Sun Apr 21 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.8.1-1
- new upstream release

* Tue Nov 06 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.6.1-1
- new upstream release

* Sat Sep 29 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.6.0-1
- new upstream release

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

* Sun Apr 22 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.4.1-1
- new upstream release

* Sun Nov 20 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.2.3-1
- new upstream release

* Sat Oct 22 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.2.2-1
- new upstream release

* Thu Sep 29 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.2.0-1
- new upstream release

* Fri Sep 23 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.1.6-1
- new upstream release

* Mon Aug 15 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.1.3-1
- initial build for Vine Linux

