!1 First submission of source code
From: @kylinsecos_admin Reviewed-by: @doudou19 Signed-off-by: @doudou19
This commit is contained in:
commit
94a5debf7e
@ -0,0 +1,92 @@
|
||||
From 98f402e67e9a4a78e6461ecbddf3ab7c4ba05419 Mon Sep 17 00:00:00 2001
|
||||
From: wangxiaoqing <wangxiaoqing@kylinos.com.cn>
|
||||
Date: Tue, 25 Jan 2022 17:16:12 +0800
|
||||
Subject: [PATCH] fix(kiran-biometrics): Add the enable zlog ex macro for zlog
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 添加ENABLE_ZLOG_EX宏来兼容不同版本的zlog
|
||||
|
||||
Signed-off-by: wangxiaoqing <wangxiaoqing@kylinos.com.cn>
|
||||
---
|
||||
src/CMakeLists.txt | 13 ++++++++++++-
|
||||
src/kiran-biometrics.c | 4 ++++
|
||||
src/main.c | 11 +++++++++++
|
||||
3 files changed, 27 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index a1891ca..c0ab353 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -9,7 +9,18 @@ if (DEFINED HAVE_KIRAN_FACE)
|
||||
pkg_check_modules (ZMQ REQUIRED libzmq)
|
||||
pkg_check_modules (GLIB_JSON REQUIRED json-glib-1.0)
|
||||
endif()
|
||||
-pkg_check_modules (ZLOG REQUIRED zlog)
|
||||
+
|
||||
+if (ENABLE_ZLOG_EX)
|
||||
+ pkg_search_module(ZLOG REQUIRED zlog)
|
||||
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_ZLOG_EX")
|
||||
+else()
|
||||
+ find_library(ZLOG_LIBRARY zlog)
|
||||
+ set (ZLOG_INCLUDE_DIRS "")
|
||||
+ set (ZLOG_LIBRARIES "${ZLOG_LIBRARY}")
|
||||
+endif()
|
||||
+
|
||||
+message("found zlog dirs: ${ZLOG_INCLUDE_DIRS}")
|
||||
+message("found zlog libs: ${ZLOG_LIBRARIES}")
|
||||
|
||||
configure_file(${SRC_DIR}/config.h.in config.h)
|
||||
configure_file(${SRC_DIR}/kiran-biometrics-i.h.in kiran-biometrics-i.h)
|
||||
diff --git a/src/kiran-biometrics.c b/src/kiran-biometrics.c
|
||||
index 538cb41..68e1cd6 100644
|
||||
--- a/src/kiran-biometrics.c
|
||||
+++ b/src/kiran-biometrics.c
|
||||
@@ -21,7 +21,11 @@
|
||||
#include <sys/types.h>
|
||||
#include <pwd.h>
|
||||
#include <errno.h>
|
||||
+#ifdef ENABLE_ZLOG_EX
|
||||
#include <zlog_ex.h>
|
||||
+#else
|
||||
+#include <zlog.h>
|
||||
+#endif
|
||||
|
||||
#include "kiran-biometrics.h"
|
||||
#include "kiran-fprint-manager.h"
|
||||
diff --git a/src/main.c b/src/main.c
|
||||
index 536e32c..547ff54 100644
|
||||
--- a/src/main.c
|
||||
+++ b/src/main.c
|
||||
@@ -21,7 +21,11 @@
|
||||
#include <glib-object.h>
|
||||
#include <gmodule.h>
|
||||
#include <locale.h>
|
||||
+#ifdef ENABLE_ZLOG_EX
|
||||
#include <zlog_ex.h>
|
||||
+#else
|
||||
+#include <zlog.h>
|
||||
+#endif
|
||||
#include "kiran-biometrics.h"
|
||||
|
||||
|
||||
@@ -34,8 +38,15 @@ int main (int argc, char **argv)
|
||||
DBusGProxy *driver_proxy;
|
||||
guint request_name_ret;
|
||||
|
||||
+#ifdef ENABLE_ZLOG_EX
|
||||
if (dzlog_init_ex (NULL, "kylinsec-system", "kiran-biometrics", "kiran_biometrics_manager") < 0)
|
||||
+#else
|
||||
+ if (dzlog_init("/etc/zlog.conf", "kylinsec-system") < 0)
|
||||
+#endif
|
||||
+ {
|
||||
+ g_error ("zlog init failed!");
|
||||
return -1;
|
||||
+ }
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
|
||||
--
|
||||
2.27.0
|
||||
|
||||
BIN
kiran-biometrics-0.0.2.tar.gz
Normal file
BIN
kiran-biometrics-0.0.2.tar.gz
Normal file
Binary file not shown.
118
kiran-biometrics.spec
Normal file
118
kiran-biometrics.spec
Normal file
@ -0,0 +1,118 @@
|
||||
%global on_openeuler 1
|
||||
|
||||
Name: kiran-biometrics
|
||||
Version: 0.0.2
|
||||
Release: 2.kb3
|
||||
Summary: Kiran Desktop kiran-biometrics
|
||||
License: Mulan PSL v2
|
||||
URL: http://www.kylinsec.com.cn
|
||||
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
|
||||
Patch0: 0001-fix-kiran-biometrics-Add-the-enable-zlog-ex-macro-fo-98f402e6.patch
|
||||
|
||||
BuildRequires: glib2-devel
|
||||
BuildRequires: dbus-glib-devel
|
||||
%if 0%{?on_openeuler}
|
||||
#BuildRequires: fingerprint-sdk-devel
|
||||
%else
|
||||
%ifarch x86_64
|
||||
BuildRequires: fingerprint-sdk-devel
|
||||
%endif
|
||||
%endif
|
||||
%if 0%{?on_openeuler}
|
||||
BuildRequires: zlog
|
||||
%else
|
||||
BuildRequires: zlog-devel
|
||||
%endif
|
||||
BuildRequires: cmake
|
||||
BuildRequires: make
|
||||
BuildRequires: pam-devel
|
||||
BuildRequires: kiran-cc-daemon-devel
|
||||
#BuildRequires: opencv-glib-devel
|
||||
#BuildRequires: zeromq-devel
|
||||
BuildRequires: json-glib-devel
|
||||
BuildRequires: dbus-glib-devel
|
||||
BuildRequires: gettext
|
||||
BuildRequires: gcc-c++
|
||||
|
||||
#Requires: facematch
|
||||
|
||||
%description
|
||||
Kiran Biometrics is used do fprint and face auth for system.
|
||||
|
||||
%package devel
|
||||
Summary: Development files for kiran biometrics
|
||||
|
||||
%description devel
|
||||
Development files for kiran-biometrics
|
||||
|
||||
%prep
|
||||
%autosetup -p1
|
||||
|
||||
%build
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
%cmake -DCMAKE_INSTALL_PREFIX=/usr ..
|
||||
make %{?_smp_mflags} V=1
|
||||
|
||||
%install
|
||||
cd build
|
||||
make install DESTDIR=$RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%{_libexecdir}/kiran_biometrics_manager
|
||||
%{_sysconfdir}/dbus-1/system.d/kiran_biometrics.conf
|
||||
%{_datadir}/dbus-1/system-services/com.kylinsec.Kiran.SystemDaemon.Biometrics.service
|
||||
%{_sysconfdir}/kiran-biometrics/settings.conf
|
||||
%{_datadir}/locale/zh_CN/LC_MESSAGES/kiran-biometrics.mo
|
||||
%{_prefix}/lib/systemd/system/kiran-system-daemon-biometrics.service
|
||||
%if 0%{?on_openeuler}
|
||||
#%{_libdir}/kiran-fprint-modules/libkiran_arat_fingerprint.so
|
||||
#%{_libdir}/kiran-fprint-modules/libkiran_zk_fingerprint.so
|
||||
%else
|
||||
%ifarch x86_64
|
||||
%{_libdir}/kiran-fprint-modules/libkiran_arat_fingerprint.so
|
||||
%{_libdir}/kiran-fprint-modules/libkiran_zk_fingerprint.so
|
||||
%endif
|
||||
%endif
|
||||
%{_libdir}/security/pam_kiran_fprintd.so
|
||||
%{_libdir}/security/pam_kiran_authmode.so
|
||||
#%{_libdir}/security/pam_kiran_face.so
|
||||
|
||||
|
||||
%files devel
|
||||
%{_includedir}/kiran-pam-msg.h
|
||||
%{_includedir}/kiran-fprint-module.h
|
||||
%{_includedir}/kiran-biometrics/kiran-biometrics-i.h
|
||||
|
||||
%changelog
|
||||
* Tue Jan 25 2022 longcheng <longcheng@kylinos.com.cn> - 0.0.2-2.kb3
|
||||
- KYOS-B: remove BuildRequires: fingerprint-sdk-devel in openeuler
|
||||
- KYOS-F:Add the enable zlog ex macro for zlog.
|
||||
- KYOS-B: Add BuildRequires: gcc-c++ in openeuler
|
||||
|
||||
* Mon Jan 24 2022 wxq <wangxiaoqing@kylinos.com.cn> - 0.0.2-2.kb2
|
||||
- KYOS-F: Add the Mulan license.
|
||||
|
||||
* Wed Dec 29 2021 kpkg <kpkg@kylinos.com.cn> - 0.0.2-2.kb1
|
||||
- rebuild for KY3.4-MATE-modules-dev
|
||||
|
||||
* Wed Dec 29 2021 caoyuanji<caoyuanji@kylinos.com.cn> - 0.0.2-2
|
||||
- Upgrade version number for easy upgrade
|
||||
|
||||
* Mon Dec 20 2021 caoyuanji <caoyuanji@kylinos.com.cn> - 0.0.2-1.kb3
|
||||
- rebuild for KY3.4-4-KiranUI-2.2
|
||||
|
||||
* Mon Dec 20 2021 caoyuanji <caoyuanji@kylinos.com.cn> - 0.0.2-1.kb2
|
||||
- rebuild for KY3.4-4-KiranUI-2.2
|
||||
|
||||
* Mon Dec 20 2021 caoyuanji <caoyuanji@kylinos.com.cn> - 0.0.2-1.kb1
|
||||
- rebuild for KY3.4-4-KiranUI-2.2
|
||||
|
||||
* Mon Aug 23 2021 wxq <wangxiaoqing@kylinos.com.cn> - 0.0.2-1
|
||||
- KYOS-F: update to 0.0.2 (#35700)
|
||||
|
||||
* Sat Mar 27 2021 wxq <wangxiaoqing@kylinos.com.cn> - 0.0.1
|
||||
- KYOS-F: add the face and fprint auth.(#35700)
|
||||
Loading…
x
Reference in New Issue
Block a user