summaryrefslogtreecommitdiff
path: root/safwk.spec
blob: 9865b9fc63367c903364ae18201d17491f4bc521 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
%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 <shichuchao@huawei.com> - 1.0.0-5
- Fix BUILD.gn sysroot path for embedded

* Mon Apr 1 2024 s_c_c <shichuchao@huawei.com> - 1.0.0-4
- Fix config_safwk include_dirs for embedded

* Wed Mar 27 2024 tianhang <tian_hang@hoperun.com> - 1.0.0-3
- update version to 1.0.0-3 
- 
* Mon Dec 18 2023 Peng He <hepeng68@huawei.com> - 1.0.0-2
- Add shell scripts for services start/stop

* Thu Oct 12 2023 muyuying <muyuying1@huawei.com> - 1.0.0-1
- Init and adapt safwk to openEuler