%bcond_with tests

%global glib2_version 2.55.0

Name:           libdazzle
Version:        3.40.0
Release:        1%{?_dist_release}
Summary:        A companion library to GObject and Gtk+
Group:          system
Vendor:         Project Vine
Distribution:   Vine Linux

License:        GPLv3+
URL:            https://git.gnome.org/browse/libdazzle/
%global         shortver %(echo %{version} | sed -e 's/\.[0-9]*$//')
Source0:        https://download.gnome.org/sources/%{name}/%{shortver}/%{name}-%{version}.tar.xz

BuildRequires:  gtk-doc
BuildRequires:  meson
BuildRequires:  vala

BuildRequires:  glib2-devel >= %{glib2_version}
BuildRequires:  gobject-introspection-devel
BuildRequires:  gtk3-devel

# for tests
%if %{with tests}
BuildRequires:  dbus
BuildRequires:  xorg-x11-server-Xvfb
BuildRequires:  xorg-x11-xauth
BuildRequires:  words
%endif

Requires:       glib2%{?_isa} >= %{glib2_version}

%description
 The libdazzle library is a companion library to GObject and Gtk+.
It provides various features that we wish were in the underlying 
library but cannot for various reasons. In most cases, they are 
wildly out of scope for those libraries. In other cases, our design 
isn't quite generic enough to work for everyone.

%package        devel
Summary:        Development files for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.


%debug_package


%prep
%autosetup -p1


%build
export LANG=ja_JP.UTF-8
%meson \
  -Denable_gtk_doc=true
%meson_build


%install
export LANG=ja_JP.UTF-8
%meson_install


%if %{with tests}
%check
dbus-run-session -- xvfb-run -w 10 ninja test %{__ninja_common_opts} -C %{_vpath_builddir}
%endif


%files
%license COPYING
%doc AUTHORS NEWS README.md
%{_bindir}/dazzle-list-counters
%{_libdir}/libdazzle-1.0.so.*
%dir %{_libdir}/girepository-1.0
%{_libdir}/girepository-1.0/Dazzle-1.0.typelib

%files devel
%doc CONTRIBUTING.md examples
%dir %{_datadir}/gir-1.0
%{_datadir}/gir-1.0/Dazzle-1.0.gir
%dir %{_datadir}/gtk-doc
%dir %{_datadir}/gtk-doc/html
%{_datadir}/gtk-doc/html/libdazzle
%dir %{_datadir}/vala
%dir %{_datadir}/vala/vapi
%{_datadir}/vala/vapi/libdazzle-1.0.*
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/libdazzle-1.0.pc


%changelog
* Tue Mar 30 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 3.40.0-1
- new upstream release.

* Tue May 05 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 3.36.0-1
- new upstream release.

* Mon Dec 31 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 3.30.1-1
- initial build for Vine Linux.
- this is not newest release: version 3.30.2 or later needs gtk+-3.24.

