!5 请求将 security_huks合入next分支
From: @zxstty Reviewed-by: @yukaii Signed-off-by: @yukaii
This commit is contained in:
commit
00e7b000da
1080
0001-adapt-compilation-tailor-dependencies.patch
Normal file
1080
0001-adapt-compilation-tailor-dependencies.patch
Normal file
File diff suppressed because it is too large
Load Diff
31
huks.BUILD.gn
Executable file
31
huks.BUILD.gn
Executable file
@ -0,0 +1,31 @@
|
||||
# Copyright (C) 2021-2022 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//build/ohos.gni")
|
||||
|
||||
config("huks_config") {
|
||||
include_dirs = [ "/usr/include/huks" ]
|
||||
libs = ["hukssdk.z"]
|
||||
}
|
||||
|
||||
if (os_level == "standard") {
|
||||
group("libhukssdk") {
|
||||
public_configs = [ ":huks_config" ]
|
||||
}
|
||||
}
|
||||
|
||||
if (os_level == "small" || os_level == "mini") {
|
||||
group("libhukssdk") {
|
||||
}
|
||||
}
|
||||
|
||||
78
huks.bundle.json
Normal file
78
huks.bundle.json
Normal file
@ -0,0 +1,78 @@
|
||||
{
|
||||
"name": "@ohos/huks",
|
||||
"description": "The provider of key and certificate manangement capbility, which belongs to security subsystem",
|
||||
"version": "3.1",
|
||||
"license": "Apache License 2.0",
|
||||
"publishAs": "code-segment",
|
||||
"segment": {
|
||||
"destPath": "base/security/huks"
|
||||
},
|
||||
"dirs":{},
|
||||
"scripts": {
|
||||
"install": "DEST_PATH=${DEP_BUNDLE_BASE}/base/security/huks && mkdir -p $DEST_PATH && cp -r ./* $DEST_PATH"
|
||||
},
|
||||
"author": {},
|
||||
"repository": "",
|
||||
"component": {
|
||||
"name": "huks",
|
||||
"subsystem": "security",
|
||||
"syscap": [
|
||||
"SystemCapability.Security.Huks",
|
||||
"SystemCapability.Security.Cipher"
|
||||
],
|
||||
"features": [],
|
||||
"adapted_system_type": [
|
||||
"standard",
|
||||
"small",
|
||||
"mini"
|
||||
],
|
||||
"hisysevent_config": [
|
||||
"//base/security/huks/hisysevent.yaml"
|
||||
],
|
||||
"rom": "5000KB",
|
||||
"ram": "500kB",
|
||||
"deps": {
|
||||
"components": [
|
||||
"ability_base",
|
||||
"access_token",
|
||||
"bundle_framework",
|
||||
"common",
|
||||
"common_event_service",
|
||||
"hisysevent_native",
|
||||
"hitrace_native",
|
||||
"hiviewdfx_hilog_native",
|
||||
"ipc",
|
||||
"napi",
|
||||
"os_account",
|
||||
"safwk",
|
||||
"samgr",
|
||||
"thirdparty_bounds_checking_function",
|
||||
"c_utils"
|
||||
],
|
||||
"third_party": [
|
||||
"openssl",
|
||||
"bounds_checking_function"
|
||||
]
|
||||
},
|
||||
"build": {
|
||||
"group_type": {
|
||||
},
|
||||
"inner_kits": [
|
||||
{
|
||||
"name": "//base/security/huks/interfaces/innerkits/huks_standard/main:libhukssdk",
|
||||
"header": {
|
||||
"header_files": [
|
||||
"hks_api.h"
|
||||
],
|
||||
"header_base": "//base/security/huks/interfaces/innerkits/huks_standard/main/include"
|
||||
}
|
||||
}
|
||||
],
|
||||
"test": [
|
||||
"//base/security/huks:huks_sdk_test",
|
||||
"//base/security/huks/test/fuzz_test:fuzztest"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
18
mbedtls.BUILD.gn
Normal file
18
mbedtls.BUILD.gn
Normal file
@ -0,0 +1,18 @@
|
||||
import("//build/ohos.gni")
|
||||
config("mbedtls_config") {
|
||||
include_dirs = [
|
||||
"include",
|
||||
]
|
||||
libs = [
|
||||
"mbedtls.z",
|
||||
]
|
||||
}
|
||||
|
||||
ohos_shared_library("mbedtls_shared") {
|
||||
public_configs = [ ":mbedtls_config" ]
|
||||
}
|
||||
|
||||
group("mbedtls") {
|
||||
public_deps = [ ":mbedtls_shared" ]
|
||||
}
|
||||
|
||||
BIN
security_huks-OpenHarmony-v3.2-Release.tar.gz
Normal file
BIN
security_huks-OpenHarmony-v3.2-Release.tar.gz
Normal file
Binary file not shown.
112
security_huks.spec
Normal file
112
security_huks.spec
Normal file
@ -0,0 +1,112 @@
|
||||
%define debug_package %{nil}
|
||||
%global build_opt /opt/distributed-middleware-build
|
||||
%global oh_version OpenHarmony-v3.2-Release
|
||||
%global security_path %{_builddir}/base/security
|
||||
%global third_party_path %{_builddir}/third_party
|
||||
|
||||
Name: security_huks
|
||||
Version: 1.0.0
|
||||
Release: 1%{?dist}
|
||||
Summary: Key management service
|
||||
License: Apache-2.0
|
||||
URL: https://gitee.com/openharmony/security_huks
|
||||
Source1: https://gitee.com/openharmony/security_huks/repository/archive/OpenHarmony-v3.2-Release.tar.gz #/security_huks-OpenHarmony-v3.2-Release.tar.gz
|
||||
Source2: huks.BUILD.gn
|
||||
Source3: huks.bundle.json
|
||||
|
||||
Patch1: 0001-adapt-compilation-tailor-dependencies.patch
|
||||
|
||||
BuildRequires: gcc, make, hilog, kernel-devel, uname-build-checks
|
||||
BuildRequires: distributed-build, distributed-beget
|
||||
BuildRequires: commonlibrary_c_utils
|
||||
BuildRequires: notification_eventhandler
|
||||
BuildRequires: communication_ipc
|
||||
BuildRequires: systemabilitymgr_safwk, systemabilitymgr_samgr
|
||||
BuildRequires: openssl-devel
|
||||
|
||||
|
||||
Requires: distributed-beget
|
||||
Requires: commonlibrary_c_utils
|
||||
Requires: notification_eventhandler
|
||||
Requires: communication_ipc
|
||||
Requires: systemabilitymgr_safwk, systemabilitymgr_samgr
|
||||
BuildRequires: openssl-devel
|
||||
|
||||
%description
|
||||
OpenHarmony Universal KeyStore (HUKS) provides applications with key library capabilities, such as key management and cryptographic operations on keys. HUKS also provides APIs for applications to import or generate keys.
|
||||
|
||||
# Decompress source code package, make patches to the source code.
|
||||
%prep
|
||||
rm -rf %{_builddir}/*
|
||||
|
||||
cp -rf %{build_opt} %{_builddir}/build
|
||||
[ ! -L "%{_builddir}/build.sh" ] && ln -s %{_builddir}/build/build_scripts/build.sh %{_builddir}/build.sh
|
||||
[ ! -L "%{_builddir}/.gn" ] && ln -s %{_builddir}/build/core/gn/dotfile.gn %{_builddir}/.gn
|
||||
[ ! -L "%{_builddir}/build.py" ] && ln -s %{_builddir}/build/lite/build.py %{_builddir}/build.py
|
||||
cp -rf %{_builddir}/build/openeuler/vendor %{_builddir}/
|
||||
cp -rf %{_builddir}/build/openeuler/compiler_gn/* %{_builddir}
|
||||
|
||||
%setup -q -D -T -a 1 -c -n %{security_path}
|
||||
mv %{security_path}/%{name}-%{oh_version} %{security_path}/huks
|
||||
%patch -P1 -p1 -d %{security_path}/huks
|
||||
|
||||
%build
|
||||
|
||||
|
||||
%ifarch x86_64
|
||||
%{_builddir}/build.sh --product-name openeuler --target-cpu x86_64
|
||||
%endif
|
||||
|
||||
%ifarch aarch64
|
||||
%{_builddir}/build.sh --product-name openeuler --target-cpu arm64
|
||||
%endif
|
||||
|
||||
%install
|
||||
install -d -m 0755 %{buildroot}/%{_includedir}/huks
|
||||
install -d -m 0755 %{buildroot}/%{_libdir}
|
||||
install -d -m 0755 %{buildroot}/system/lib64
|
||||
install -d -m 0755 %{buildroot}%{build_opt}/openeuler/compiler_gn/base/security/huks/interfaces/innerkits/huks_standard/main/
|
||||
|
||||
%ifarch aarch64
|
||||
%define module_out_path out/openeuler/linux_clang_arm64/security/huks
|
||||
%define header_out_path out/openeuler/innerkits/linux-arm64/huks
|
||||
%endif
|
||||
|
||||
%ifarch x86_64
|
||||
%define module_out_path out/openeuler/linux_clang_x86_64/security/huks
|
||||
%define header_out_path out/openeuler/innerkits/linux-x86_64/huks
|
||||
%endif
|
||||
# prepare head files
|
||||
find %{_builddir}/${header_out_path} -name *.h -print0 | xargs -0 -i cp -rf {} %{buildroot}%{_includedir}/huks/
|
||||
install -m 0755 %{_builddir}/base/security/huks/frameworks/huks_standard/main/common/include/*.h %{buildroot}%{_includedir}/huks/
|
||||
|
||||
# copy executable file.
|
||||
install -m 0755 %{_builddir}/%{module_out_path}/*.so %{buildroot}%{_libdir}
|
||||
install -m 0755 %{_builddir}/%{module_out_path}/*.so %{buildroot}/system/lib64
|
||||
|
||||
#cp json file
|
||||
install -m 0755 %{SOURCE3} %{buildroot}%{build_opt}/openeuler/compiler_gn/base/security/huks/bundle.json
|
||||
|
||||
#cp gn file
|
||||
install -m 0755 %{SOURCE2} %{buildroot}%{build_opt}/openeuler/compiler_gn/base/security/huks/interfaces/innerkits/huks_standard/main/BUILD.gn
|
||||
|
||||
#cp yaml file
|
||||
install -m 0755 %{_builddir}/base/security/huks/hisysevent.yaml %{buildroot}%{build_opt}/openeuler/compiler_gn/base/security/huks
|
||||
|
||||
#create soft link
|
||||
ln -s /usr/include/huks %{buildroot}%{build_opt}/openeuler/compiler_gn/base/security/huks/include
|
||||
|
||||
# copy ko file to the certain path on deployment environment.
|
||||
%files
|
||||
%{_libdir}/*.so
|
||||
%{_includedir}/huks/*
|
||||
# %{bundle_dir}/*
|
||||
/system/*
|
||||
%{build_opt}/*
|
||||
%changelog
|
||||
* Mon Oct 30 2023 Yuying Mu <muyuying1@huawei.com> - 1.0.0-1
|
||||
- add gn file
|
||||
* Sat Oct 07 2023 Peng He <hepeng68@huawei.com> - 1.0.0-1
|
||||
* Tue Nov 21 2023 JiaQi Zhao <zhaojiaqi18@huawei.com> - 1.0.0-1
|
||||
- adapt compilation, tailor dependencies on hitrace and hisysevent
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user