Name:          libvirt-glib
Version:       4.0.0
Release:       3
Summary:       libvirt glib integration for events
License:       LGPLv2+
URL:           http://libvirt.org/
Source0:       https://libvirt.org/sources/glib/%{name}-%{version}.tar.xz
BuildRequires: glib2-devel >= 2.48.0 libvirt-devel >= 1.2.8 gobject-introspection-devel
BuildRequires: libxml2-devel >= 2.9.1 vala gettext gtk-doc meson
Patch00:       libvirt-glib-4.0.0-cast-align.patch
Patch01:       build-don-t-set-glib-version-constraints-for-g-ir-sc.patch
Patch02:       Make-xmlError-structs-constant.patch

Provides:      libvirt-gconfig libvirt-gobject
Obsoletes:     libvirt-gconfig libvirt-gobject

%description
This package provides integration between libvirt and the glib event loop.


%package       devel
Summary:       libvirt glib integration for events development files
Requires:      %{name} = %{version}-%{release} libvirt-devel >= 1.1.1
Provides:      libvirt-gconfig-devel libvirt-gobject-devel
Obsoletes:     libvirt-gconfig-devel libvirt-gobject-devel

%description   devel
This package provides development header files and libraries for integration between libvirt and the glib event loop.


%prep
%autosetup -p1

%build
%meson -Drpath=disabled -Dintrospection=enabled
%meson_build

%install
%meson_install

%delete_la_and_a

%find_lang %{name}

%check
%meson_test

%ldconfig_post
%ldconfig_postun

%files -f %{name}.lang
%doc README COPYING AUTHORS NEWS
%{_libdir}/libvirt-g*-1.0.so.*
%{_libdir}/girepository-1.0/LibvirtG*-1.0.typelib

%files devel
%doc examples/event-test.c
%{_libdir}/*-1.0.so
%{_libdir}/pkgconfig/*-1.0.pc
%dir %{_includedir}/*-1.0
%dir %{_includedir}/*-1.0/libvirt-g*
%{_includedir}/*-1.0/libvirt-g*/*.h
%{_datadir}/gir-1.0/*-1.0.gir
%{_datadir}/gtk-doc/html/Libvirt-g*
%{_datadir}/vala/vapi/libvirt-g*

%changelog
* Wed May 29 2024 zhangxianting <zhangxianting@uniontech.com> - 4.0.0-3
- sync submissions, make xmlError structs constant, to resolve compilation error

* Mon Jun 13 2022 yezengruan <yezengruan@huawei.com> - 4.0.0-2
- build: don't set glib version constraints for g-ir-scanner

* Wed Jun 30 2021 weijin deng <weijin.deng@turbolinux.com.cn> - 4.0.0-1
- Upgrade to 4.0.0
- Use meson rebuild
- Add libvirt-glib-4.0.0-cast-align.patch

* Sat Nov 30 2019 chenzhenyu <chenzhenyu13@huawei.com> - 1.0.0-8
- Package init