%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: 5 Summary: System ability manager License: Apache-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 Source5: start_services.sh Source6: stop_services.sh Patch1: 0000-remove-dependency-on-hitrace-safwk.patch Patch2: 0001-feat-for-embedded-fix-config_safwk-include_dirs.patch BuildRequires: gcc, make, hilog, libboundscheck BuildRequires: libatomic, libxml2-devel, cjson-devel BuildRequires: distributed-build, distributed-beget BuildRequires: commonlibrary_c_utils BuildRequires: notification_eventhandler BuildRequires: communication_ipc BuildRequires: 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 %patch -P2 -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/ install -m 0755 %{SOURCE5} %{buildroot}/system/bin/ install -m 0755 %{SOURCE6} %{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/* %{build_opt}/* %changelog * Tue Apr 2 2024 s_c_c - 1.0.0-5 - Fix BUILD.gn sysroot path for embedded * Mon Apr 1 2024 s_c_c - 1.0.0-4 - Fix config_safwk include_dirs for embedded * Wed Mar 27 2024 tianhang - 1.0.0-3 - update version to 1.0.0-3 - * Mon Dec 18 2023 Peng He - 1.0.0-2 - Add shell scripts for services start/stop * Thu Oct 12 2023 muyuying - 1.0.0-1 - Init and adapt safwk to openEuler