Name:          ukui-biometric-manager
Version:       3.1.2
Release:       3
Summary:       manager for biometric authentication
License:       GPL-2+
URL:           http://www.ukui.org
Source0:       %{name}-%{version}.tar.gz
Patch01:       0001-fix-compile-error-about-opencv.patch
Patch02:       0002-fix-compile-error-about-glib2.patch
Patch03:       0003-add-user-guide-of-biometric-manager.patch



BuildRequires: qt5-qtbase-devel
BuildRequires: kf5-kwindowsystem-devel
BuildRequires: libX11-devel
BuildRequires: qt5-qtx11extras-devel
BuildRequires: glib2-devel
BuildRequires: opencv
BuildRequires: pkgconf
BuildRequires: gsettings-qt-devel
BuildRequires: qt5-qttools-devel
BuildRequires: libukcc-devel
BuildRequires: polkit-qt5-1-devel
BuildRequires: libpwquality-devel
BuildRequires: qt5-qtsvg-devel


%description
 This package is a tool to manage the drivers of biometric devices and
 users' features and manage whether biometric authentication is enabled.
 The service is provided by biometric-authentication.service in
 biometric-auth package.


%prep
%setup -q
%patch01 -p1
if [ -e "/usr/include/glib-2.0/gio/gunixfdlist.h" ]; then
%patch02 -p1
fi
%patch03 -p1

%build
mkdir build && cd build
%{qmake_qt5} ..
%{make_build}

%install
rm -rf $RPM_BUILD_ROOT
cd build
make INSTALL_ROOT=%{buildroot} install

%clean
rm -rf $RPM_BUILD_ROOT

%post
ln -sf /usr/bin/biometric-manager /usr/bin/ukui-biometric-manager
%postun
unlink /usr/bin/ukui-biometric-manager

%files
%{_bindir}/biometric-manager
%{_datadir}/applications/biometric-manager.desktop
%{_datadir}/pixmaps/biometric-manager.png
%{_libdir}/ukui-control-center/libbiometrics.so
%{_datadir}/biometric-manager
%{_datadir}/kylin-user-guide/data/guide

%changelog
* Tue May 30 2023 peijiankang <peijiankang@kylinos.cn> - 3.1.2-3
- fix unlink error

* Thu May 25 2023 peijiankang <peijiankang@kylinos.cn> - 3.1.2-2
- update glib2 error

* Wed May 24 2023 peijiankang <peijiankang@kylinos.cn> - 3.1.2-1
- update version to 3.1.2

* Wed May 25 2022 tanyulong <tanyulong@kylinos.cn> - 1.0.3-1
- init package for openEuler
