Name:          libqmi
Version:       1.34.0
Release:       1
License:       LGPLv2+ and GPLv2+
Summary:       A glib-based library to use the Qualcomm MSM Interface (QMI) protocol
URL:           https://gitlab.freedesktop.org/mobile-broadband/libqmi
Source0:       https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/archive/%{version}/%{name}-%{version}.tar.bz2

BuildRequires: meson help2man
BuildRequires: glib2-devel >= 2.32.0 libgudev-devel >= 147 libmbim-devel >= 1.18.0 python3 gtk-doc gcc
Provides:      libqmi-utils = %{version}-%{release}
Obsoletes:     libqmi-utils < 1.20.0.4

%description
Libqmi is a glib-based library for talking to WWAN modems and devices which
speak the Qualcomm MSM Interface (QMI) protocol.

%package       devel
Summary:       Libraries and header files for libqmi development
Requires:      libqmi = %{version}-%{release} glib2-devel pkgconfig

%description   devel
This package contains the header and pkg-config files for development
applications using QMI functionality from applications that use glib.

%package_help

%prep
%autosetup -p1

%build
%meson -Dgtk_doc=true -Dbash_completion=false -Dqrtr=false
%meson_build

%install
%meson_install
find %{buildroot}%{_datadir}/gtk-doc |xargs touch --reference meson.build
mkdir -p %{buildroot}%{_datadir}/bash-completion/completions
cp -a src/qmicli/qmicli %{buildroot}%{_datadir}/bash-completion/completions/

%post
/sbin/ldconfig

%postun
/sbin/ldconfig

%files
%license COPYING
%{_bindir}/qmi*
%{_libdir}/libqmi-glib.so.*
%{_datadir}/bash-completion
%{_libexecdir}/qmi-proxy
%{_libdir}/girepository-1.0/Qmi-1.0.typelib

%files devel
%dir %{_includedir}/libqmi-glib
%dir %{_datadir}/gtk-doc/html/libqmi-glib
%{_includedir}/libqmi-glib/*.h
%{_libdir}/pkgconfig/qmi-glib.pc
%{_libdir}/libqmi-glib.so
%{_datadir}/gtk-doc/html/libqmi-glib/*
%exclude %{_libdir}/libqmi-glib.la
%{_datadir}/gir-1.0/Qmi-1.0.gir

%files help
%doc NEWS AUTHORS README.md
%{_mandir}/man1/*

%changelog
* Tue Oct 24 2023 liyanan  <liyanan61@h-partners.com> - 1.34.0-1
- Update to 1.34.0

* Sat Jul 22 2023 zhouwenpei <zhouwenpei1@h-partners.com> - 1.33.3-1
- update to 1.33.3

* Mon Feb 20 2023 liyanan <liyanan32@h-partners.com> - 1.30.8-2
- fix build error

* Wed Nov 16 2022 zhouwenpei <zhouwenpei1@h-partners.com> - 1.30.8-1
- update to 1.30.8

* Mon Jun 28 2021 liuyumeng <liuyumeng5@huawei.com> - 1.26.2-3
- update libmbim-devel version from 1.14.0 to 1.18.0

* Tue Jun 08 2021 wulei <wulei80@huawei.com> - 1.26.2-2
- fixes failed: error: no acceptable C compiler found in $PATH

* Tue Jul 28 2020 cuibaobao <cuibaobao1@huawei.com> - 1.26.2-1
- update to 1.26.2

* Tue Jan 14 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.20.0-5
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:add patch to modify build err

* Fri Nov 29 2019 Lijin Yang <yanglijin@huawei.com> - 1.20.0-4
- init package


