110 lines
3.8 KiB
RPMSpec
110 lines
3.8 KiB
RPMSpec
|
|
%define debug_package %{nil}
|
|||
|
|
%global openHarmony_source_release OpenHarmony-v3.2-Release
|
|||
|
|
%global samgr_dir %{_builddir}/foundation/systemabilitymgr
|
|||
|
|
%global build_opt /opt/distributed-middleware-build
|
|||
|
|
%global safwk_path %{buildroot}%{build_opt}/openeuler/compiler_gn/foundation/systemabilitymgr/safwk
|
|||
|
|
|
|||
|
|
Name: systemabilitymgr_safwk
|
|||
|
|
Version: 1.0.0
|
|||
|
|
Release: 1
|
|||
|
|
Summary: System ability manager
|
|||
|
|
License: Apache License 2.0
|
|||
|
|
Url: https://gitee.com/openharmony/systemabilitymgr_safwk
|
|||
|
|
Source1: https://gitee.com/openharmony/systemabilitymgr_safwk/repository/archive/%{openHarmony_source_release}.tar.gz #/systemabilitymgr_safwk-%{openHarmony_source_release}.tar.gz
|
|||
|
|
Source2: safwk.bundle.json
|
|||
|
|
Source3: innerkits.safwk.BUILD.gn
|
|||
|
|
Source4: services.safwk.BUILD.gn
|
|||
|
|
|
|||
|
|
Patch1: 0000-remove-dependency-on-hitrace-safwk.patch
|
|||
|
|
|
|||
|
|
BuildRequires: gcc, make, hilog, kernel-devel, uname-build-checks,libboundscheck
|
|||
|
|
BuildRequires: libatomic,libicu-devel, libxml2-devel, openssl-devel, cjson-devel
|
|||
|
|
BuildRequires: distributed-build, distributed-beget
|
|||
|
|
BuildRequires: commonlibrary_c_utils
|
|||
|
|
BuildRequires: notification_eventhandler
|
|||
|
|
BuildRequires: cjson-devel, openssl-devel
|
|||
|
|
BuildRequires: communication_ipc
|
|||
|
|
BuildRequires: Requires: systemabilitymgr_samgr
|
|||
|
|
|
|||
|
|
Requires: commonlibrary_c_utils
|
|||
|
|
Requires: distributed-beget
|
|||
|
|
Requires: notification_eventhandler
|
|||
|
|
Requires: communication_ipc
|
|||
|
|
Requires: systemabilitymgr_samgr
|
|||
|
|
|
|||
|
|
%description
|
|||
|
|
OpenEuler supports samgr for distributed softbus capability
|
|||
|
|
%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,不用autosetup,distributed-build除外
|
|||
|
|
mkdir -p %{samgr_dir}
|
|||
|
|
%setup -q -D -T -a 1 -c -n %{samgr_dir}
|
|||
|
|
# patch命令统一使用-P来指定第几个patch
|
|||
|
|
%patch -P1 -p1 -d %{samgr_dir}/safwk
|
|||
|
|
|
|||
|
|
%build
|
|||
|
|
rm -rf %{_builddir}/out
|
|||
|
|
%ifarch x86_64
|
|||
|
|
bash %{_builddir}/build.sh --product-name openeuler --target-cpu x86_64
|
|||
|
|
%endif
|
|||
|
|
|
|||
|
|
%ifarch aarch64
|
|||
|
|
bash %{_builddir}/build.sh --product-name openeuler --target-cpu arm64
|
|||
|
|
%endif
|
|||
|
|
|
|||
|
|
%install
|
|||
|
|
install -d -m 0755 %{buildroot}/%{_includedir}/safwk
|
|||
|
|
install -d -m 0755 %{buildroot}/%{_libdir}
|
|||
|
|
install -d -m 0755 %{buildroot}/%{_bindir}
|
|||
|
|
install -d -m 0755 %{buildroot}/system/bin/
|
|||
|
|
install -d -m 0755 %{safwk_path}/interfaces/innerkits/safwk
|
|||
|
|
install -d -m 0755 %{safwk_path}/services/safwk
|
|||
|
|
|
|||
|
|
%ifarch aarch64
|
|||
|
|
module_out_path="out/openeuler/linux_clang_arm64"
|
|||
|
|
%endif
|
|||
|
|
%ifarch x86_64
|
|||
|
|
module_out_path="out/openeuler/linux_clang_x86_64"
|
|||
|
|
%endif
|
|||
|
|
|
|||
|
|
# prepare so
|
|||
|
|
install -m 0755 %{_builddir}/${module_out_path}/systemabilitymgr/safwk/*.so %{buildroot}/%{_libdir}
|
|||
|
|
|
|||
|
|
# prepare bin
|
|||
|
|
install -m 0755 %{_builddir}/${module_out_path}/systemabilitymgr/safwk/sa_main %{buildroot}/%{_bindir}
|
|||
|
|
install -m 0755 %{_builddir}/${module_out_path}/systemabilitymgr/safwk/sa_main %{buildroot}/system/bin/
|
|||
|
|
|
|||
|
|
# prepare head files
|
|||
|
|
install -m 554 %{samgr_dir}/safwk/services/safwk/include/*.h %{buildroot}/%{_includedir}/safwk
|
|||
|
|
install -m 554 %{samgr_dir}/safwk/interfaces/innerkits/safwk/*.h %{buildroot}/%{_includedir}/safwk
|
|||
|
|
# cp json file
|
|||
|
|
install -m 554 %{SOURCE2} %{safwk_path}/bundle.json
|
|||
|
|
|
|||
|
|
# cp gn file
|
|||
|
|
install -m 554 %{SOURCE3} %{safwk_path}/interfaces/innerkits/safwk/BUILD.gn
|
|||
|
|
install -m 554 %{SOURCE4} %{safwk_path}/services/safwk/BUILD.gn
|
|||
|
|
|
|||
|
|
#create soft link
|
|||
|
|
ln -s /usr/include/safwk/system_ability.h %{safwk_path}/interfaces/innerkits/safwk/system_ability.h
|
|||
|
|
|
|||
|
|
%files
|
|||
|
|
%{_includedir}/safwk/*
|
|||
|
|
%{_libdir}/*.so
|
|||
|
|
%{_bindir}/sa_main
|
|||
|
|
/system/bin/sa_main
|
|||
|
|
%{build_opt}/*
|
|||
|
|
|
|||
|
|
%changelog
|
|||
|
|
* Thu Oct 12 2023 muyuying <muyuying1@huawei.com> - 1.0.0-1
|
|||
|
|
- Init and adapt safwk to openEuler
|
|||
|
|
|