加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
device_manager.spec 4.18 KB
一键复制 编辑 原始数据 按行查看 历史
muyuying 提交于 2023-10-31 20:18 . init package
%define debug_package %{nil}
%global oh_version OpenHarmony-v3.2-Release
%global device_manager_dir %{_builddir}/foundation/distributedhardware/device_manager
%global build_opt /opt/distributed-middleware-build
%global samgr_dir %{_builddir}/foundation/systemabilitymgr
%global json_dir %{_builddir}/third_party/json
Name: distributedhardware_device_manager
Version: 1.0.0
Release: 2
Summary: Distributed middleware used components.
License: Apache-2.0
Url: https://gitee.com/openharmony/
Source0: https://gitee.com/openharmony/distributedhardware_device_manager/repository/archive/openHarmony-v3.2-Release.tar.gz #/distributedhardware_device_manager-OpenHarmony-v3.2-Release.tar.gz
Source1: https://gitee.com/openharmony/third_party_json/repository/archive/openHarmony-v3.2-Release.tar.gz #/third_party_json-OpenHarmony-v3.2-Release.tar.gz
Patch0: 0011-remove-dependency-and-adapt-for-build-device_manager.patch
BuildRequires: distributed-build, hilog
Requires: libboundscheck
%description
Tools used by distributed middleware.
# Generate directory structure for build.
%prep
rm -rf %{_builddir}/*
cp -rp %{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 -r %{_builddir}/build/openeuler/vendor %{_builddir}/
cp -r %{_builddir}/build/openeuler/compiler_gn/third_party %{_builddir}/
cp -rf %{_builddir}/build/openeuler/compiler_gn/base %{_builddir}/
rm -rf %{_builddir}/base/security/dataclassification
rm -rf %{_builddir}/base/security/device_security_level
%setup -q -D -T -a 0 -c -n %{device_manager_dir}/..
%setup -q -D -T -a 1 -c -n %{json_dir}/..
%patch0 -p1 -d %{device_manager_dir}
######copy gn files#####
#copy ipc gn files
mkdir -p %{_builddir}/foundation/communication
cp -r %{_builddir}/build/openeuler/compiler_gn/foundation/communication/ipc %{_builddir}/foundation/communication/
#copy dsoftbus gn files
cp -r %{_builddir}/build/openeuler/compiler_gn/foundation/communication/dsoftbus %{_builddir}/foundation/communication/
#copy c_utils gn files
mkdir -p %{_builddir}/commonlibrary
cp -r %{_builddir}/build/openeuler/compiler_gn/commonlibrary/c_utils %{_builddir}/commonlibrary/
# copy samgr gn files
mkdir -p %{samgr_dir}
cp -r %{_builddir}/build/openeuler/compiler_gn/foundation/systemabilitymgr/samgr %{_builddir}/foundation/systemabilitymgr/
# copy init safwk files
cp -r %{_builddir}/build/openeuler/compiler_gn/foundation/systemabilitymgr/safwk %{_builddir}/foundation/systemabilitymgr/
#directory to avoid %build fail
if [ ! -d "device_manager" ];then
mkdir device_manager
else
echo "device_manager already exist"
fi
%build
cd %{_builddir}
rm -rf %{_builddir}/out
%ifarch x86_64
./build.sh --product-name openeuler --target-cpu x86_64
%endif
%ifarch aarch64
./build.sh --product-name openeuler --target-cpu arm64
%endif
%install
install -d -m 0755 %{buildroot}/%{_includedir}/device_manager
install -d -m 0755 %{buildroot}/%{_libdir}
install -d -m 0755 %{buildroot}%{_includedir}/nlohmann_json
install -d -m 0755 %{buildroot}%{_includedir}/nlohmann_json/single_include
%ifarch aarch64
module_out_path="out/openeuler/linux_clang_arm64"
header_out_path="out/openeuler/innerkits/linux-arm64/"
%endif
%ifarch x86_64
module_out_path="out/openeuler/linux_clang_x86_64"
header_out_path="out/openeuler/innerkits/linux-x86_64/"
%endif
# prepare so
install -m 0755 %{_builddir}/${module_out_path}/distributedhardware/device_manager/*.so %{buildroot}/%{_libdir}
# prepare head files
find %{_builddir}/${header_out_path} -name *.h -print0 | xargs -0 -i cp -rf {} %{buildroot}%{_includedir}/device_manager/
# copy nlohmann_json header file to includedir.
cd %{json_dir}
cp -rvf include/nlohmann %{buildroot}/%{_includedir}/nlohmann_json
cp -rvf single_include/nlohmann %{buildroot}/%{_includedir}/nlohmann_json/single_include
%files
%{_includedir}/device_manager/*
%{_includedir}/nlohmann_json/*
%{_libdir}/*.so
%changelog
* Tue Oct 31 2023 Yuying Mu <muyuying1@huawei.com> - 1.0.0-1
- Init and adapt device manager to openEuler
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化