%define glib2_version 2.54.0

Name:           json-glib
Version:        1.6.6
Release:        2
Summary:        Library for lightweight data-interchange format

License:        LGPLv2+
URL:            https://wiki.gnome.org/Projects/JsonGlib
Source0:        https://download.gnome.org/sources/%{name}/1.6/%{name}-%{version}.tar.xz

BuildRequires:  docbook-style-xsl gettext gi-docgen
BuildRequires:  gobject-introspection-devel meson libxslt
BuildRequires:	glib2-devel >= %{glib2_version}

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

%description
JSON-GLib is a library providing serialization and deserialization support
for the JavaScript Object Notation (JSON) format described by RFC 4627.

%package	devel
Summary:        Development files for %{name}
Requires:       %{name} = %{version}-%{release}
Provides:       %{name}-tests
Obsoletes:      %{name}-tests < %{version}-%{release}

%description	devel
%{name}-devel contains the header files for developing
applications that want to make use of %{name}.

%package_help

%prep
%autosetup -n %{name}-%{version} -p1

%build
%meson -Dgtk_doc=enabled -Dman=true
%meson_build

%install
%meson_install

%ldconfig_scriptlets
%find_lang json-glib-1.0

%files
%defattr(-,root,root) 
%license COPYING
%{_libdir}/libjson-glib-1.0.so.0*
%{_libdir}/girepository-1.0/Json-1.0.typelib
%{_datadir}/locale/*

%files devel
%defattr(-,root,root)
%{_bindir}/json-glib-format
%{_bindir}/json-glib-validate
%{_libdir}/libjson-glib-1.0.so
%{_libdir}/pkgconfig/json-glib-1.0.pc
%{_includedir}/json-glib-1.0/
%{_datadir}/gir-1.0/Json-1.0.gir
%{_libexecdir}/installed-tests/
%{_datadir}/installed-tests/

%files help
%defattr(-,root,root)
%doc NEWS
%{_mandir}/man1/json-glib-format.1*
%{_mandir}/man1/json-glib-validate.1*
%{_datadir}/doc/json-glib-1.0/

%changelog
* Thu Apr 21 2022 dillon chen <dillon.chen@gmail.com> - 1.6.6-1
- Update to 1.6.6

* Wed Jun 30 2021 weijin deng <weijin.deng@turbolinux.com.cn> - 1.6.2-2
- Recover provides virtual subpackage json-glib-tests

* Mon May 24 2021 weijin deng <weijin.deng@turbolinux.com.cn> - 1.6.2-1
- Upgrade to 1.6.2
- Update Version, Source0, BuildRequires, Obsoletes, Provides

* Thu Jan 28 2021 zhanzhimin <zhanzhimin@huawei.com> - 1.6.0-1
- update to 1.6.0

* Wed Sep 11 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.4.4-2
- Package init
