1 # "on_off foo" wil turn into "ON" or "OFF"
2 %define on_off() %{expand:%%{?with_%{1}:ON}%%{!?with_%{1}:OFF}}
5 %define _with_livedumper on
6 %define _with_crashservice on
10 %bcond_with crashservice
12 # NOTE: To disable coredump set DumpCore=0 in configuration file
15 Summary: Coredump handler and report generator for Tizen
18 Group: Framework/system
19 License: Apache-2.0 and BSD-2-Clause and MIT
20 Source0: %{name}-%{version}.tar.gz
21 Source1001: crash-worker.manifest
22 BuildRequires: pkgconfig(dlog)
23 BuildRequires: pkgconfig(libtzplatform-config)
24 BuildRequires: pkgconfig(iniparser)
25 BuildRequires: pkgconfig(capi-system-info)
26 BuildRequires: pkgconfig(glib-2.0)
27 BuildRequires: pkgconfig(rpm)
29 BuildRequires: pkgconfig(pkgmgr-info)
30 BuildRequires: pkgconfig(libunwind-generic)
31 BuildRequires: libelf-devel libelf
32 BuildRequires: libebl-devel libebl
33 BuildRequires: libdw-devel libdw
34 BuildRequires: libcap-devel
37 BuildRequires: doxygen
40 %if %{with livedumper}
41 BuildRequires: boost-devel
44 Requires(post): coreutils
50 Requires: minicoredumper >= 2.1.0
51 Requires: %{_bindir}/buxton2ctl
52 %if %{with crashservice}
53 Requires: %{name}-livedumper = %{version}-%{release}
57 %package -n libcrash-service
58 Summary: libcrash-service provides API to communicate with crash-service
59 %description -n libcrash-service
62 Requires: libcrash-service
63 Summary: Crash-manager headers and library for linking
68 Summary: Documentation package for crash-worker
69 Group: Framework/System
75 Summary: Package with binaries and data for crash-worker tests
79 %if %{with livedumper}
81 Summary: Livedumper allows to dump core of live process
82 %description livedumper
86 Summary: System tests for crash-worker components
92 Requires: /usr/bin/unzip
93 Requires: /usr/bin/mcookie
94 Requires: %{_sbindir}/minicoredumper
95 Requires: %{name}-system-tests-debuginfo = %{version}-%{release}
96 %description system-tests
101 #Path to store logs and coredump files
102 %define crash_root_path %{TZ_SYS_CRASH_ROOT}
103 %define crash_path %{TZ_SYS_CRASH}
104 %define crash_temp %{crash_root_path}/temp
106 #Debug mode path - existence of file at path below mean that core file should be generated
107 %define debugmode_path %{TZ_SYS_ETC}/.debugmode
109 %define upgrade_script_path %{TZ_SYS_RO_SHARE}/upgrade/scripts
114 export CFLAGS+=" -Werror"
116 %ifarch %{arm} aarch64
129 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
130 -DTMP_FILES_DIR=%{_sysconfdir}/tmpfiles.d \
132 -DARCH_BIT=%{ARCH_BIT} \
133 -DDUMP_SYSTEMSTATE_CONFIG_DIR_PATH=%{_sysconfdir}/dump_systemstate.conf.d \
134 -DCRASH_MANAGER_CONFIG_PATH=%{_sysconfdir}/crash-manager.conf \
135 -DCRASH_ROOT_PATH=%{crash_root_path} \
136 -DCRASH_PATH=%{crash_path} \
137 -DCRASH_TEMP=%{crash_temp} \
138 -DDEBUGMODE_PATH=%{debugmode_path} \
139 -DMINICOREDUMPER_BIN_PATH=%{_sbindir}/minicoredumper \
140 -DMINICOREDUMPER_CONFIG_PATH=%{_sysconfdir}/minicoredumper/minicoredumper.cfg.json \
141 -DLIVEDUMPER_BIN_PATH=%{_bindir}/livedumper \
142 -DDUMP_SYSTEMSTATE_BIN_PATH=%{_bindir}/dump_systemstate \
143 -DCRASH_STACK_BIN_PATH=%{_libexecdir}/crash-stack \
144 -DCRASH_POPUP_BIN_PATH=%{_libexecdir}/crash-popup-launch \
145 -DCRASH_NOTIFY_BIN_PATH=%{_libexecdir}/crash-notify-send \
146 -DCRASH_TESTS_PATH=%{_libdir}/crash-worker/tests \
147 -DCRASH_SYSTEM_TESTS_PATH=%{_libdir}/crash-worker/system-tests \
148 -DLIVEDUMPER=%{on_off livedumper} \
149 -DCRASH_SERVICE=%{on_off crashservice} \
150 -DUPGRADE_SCRIPT_PATH=%{upgrade_script_path} \
152 -DDLOG_LOG_LEVEL=DLOG_INFO \
155 make %{?jobs:-j%jobs}
164 mkdir -p %{buildroot}%{crash_root_path}
165 mkdir -p %{buildroot}%{crash_path}
166 mkdir -p %{buildroot}%{crash_temp}
169 /usr/bin/chsmack -a "System" -t %{crash_path}
170 /usr/bin/chsmack -a "System" -t %{crash_temp}
173 %license LICENSE LICENSE.BSD LICENSE.MIT
174 %manifest crash-worker.manifest
175 %defattr(-,crash_worker,crash_worker,-)
176 %dir %{crash_root_path}
179 %{_sysconfdir}/crash-manager.conf
180 %{_sysconfdir}/crash-manager.conf.d/crash-manager.conf.example
181 %attr(-,root,root) %{_prefix}/lib/sysctl.d/70-crash-manager.conf
182 %attr(0750,crash_worker,crash_worker) %{_bindir}/crash-manager
183 %attr(0750,crash_worker,crash_worker) %{_bindir}/dump_systemstate
184 %{_sysconfdir}/dump_systemstate.conf.d/files/*.conf*
185 %{_sysconfdir}/dump_systemstate.conf.d/programs/*.conf*
186 %{_libexecdir}/crash-stack
187 %{_libexecdir}/crash-popup-launch
188 %{_libexecdir}/crash-notify-send
189 %{_libdir}/libcrash-manager.so.*
191 %if %{with crashservice}
192 %attr(0750,crash_worker,crash_worker) %{_bindir}/crash-service
193 %attr(-,root,root) %{_unitdir}/crash-service.service
194 %attr(-,root,root) %{_sysconfdir}/dbus-1/system.d/crash-service.conf
195 %attr(-,root,root) %{_datadir}/dbus-1/system-services/org.tizen.system.crash.livedump.service
199 %attr(-,root,root) %{upgrade_script_path}/500.crash-manager-upgrade.sh
201 %files -n libcrash-service
202 %{_libdir}/libcrash-service.so.*
205 %{_includedir}/crash-manager.h
206 %{_libdir}/libcrash-manager.so
207 %{_libdir}/pkgconfig/crash-manager.pc
208 %if %{with crashservice}
209 %{_includedir}/libcrash-service.h
210 %{_libdir}/libcrash-service.so
211 %{_libdir}/pkgconfig/crash-service.pc
216 %{_datadir}/doc/crash-worker
221 %manifest %{name}.manifest
222 %defattr(-,root,root)
223 %{_libdir}/crash-worker/tests/test1-default-crash
224 %{_libdir}/crash-worker/tests/test1-default-sleep
225 %{_libdir}/crash-worker/tests/test1-default-ill
226 %{_libdir}/crash-worker/tests/test1-custom-crash
227 %{_libdir}/crash-worker/tests/test1-custom-sleep
228 %{_libdir}/crash-worker/tests/test1-custom-ill
229 %{_libdir}/crash-worker/tests/run_tests.sh
230 %{_libdir}/crash-worker/tests/tests_common.sh
231 %{_libdir}/crash-worker/tests/crash_common.sh
235 %if %{with livedumper}
237 %manifest %{name}.manifest
238 %{_bindir}/livedumper
242 %manifest %{name}.manifest
243 %{_bindir}/crash-worker-system-tests-run
245 %{_libdir}/crash-worker/system-tests/check_minicore_mem/check_minicore_mem.sh
246 %{_libdir}/crash-worker/system-tests/check_minicore_mem/cp.sh
247 %{_libdir}/crash-worker/system-tests/cmp_backtraces/cmp_backtraces.sh
248 %{_libdir}/crash-worker/system-tests/cmp_backtraces/cp.sh
249 %{_libdir}/crash-worker/system-tests/crash_root_path/crash_root_path.sh
250 %{_libdir}/crash-worker/system-tests/critical_process/critical_process.sh
251 %{_libdir}/crash-worker/system-tests/dbus_notify/dbus_notify.sh
252 %{_libdir}/crash-worker/system-tests/dbus_notify_legacy/dbus_notify_legacy.sh
253 %{_libdir}/crash-worker/system-tests/dump_systemstate_extras/dump_systemstate_extras.sh
254 %{_libdir}/crash-worker/system-tests/exclude_paths/exclude_paths.sh
255 %{_libdir}/crash-worker/system-tests/extra_script/extra_script.sh
256 %{_libdir}/crash-worker/system-tests/full_core/full_core.sh
257 %{_libdir}/crash-worker/system-tests/info_file/info_file.sh
258 %{_libdir}/crash-worker/system-tests/libcrash-service/libcrash-service.sh
259 %{_libdir}/crash-worker/system-tests/log_file/log_file.sh
260 %{_libdir}/crash-worker/system-tests/output_param/output_param.sh
261 %{_libdir}/crash-worker/system-tests/report_basic/report_basic.sh
262 %{_libdir}/crash-worker/system-tests/report_type_info/report_type_info.sh
263 %{_libdir}/crash-worker/system-tests/so_info_file/so_info_file.sh
264 %{_libdir}/crash-worker/system-tests/time_test/cp.sh
265 %{_libdir}/crash-worker/system-tests/time_test/time_test.sh
266 %{_libdir}/crash-worker/system-tests/utils/btee
267 %{_libdir}/crash-worker/system-tests/utils/kenny
268 %{_libdir}/crash-worker/system-tests/utils/libcrash-servicetest
269 %{_libdir}/crash-worker/system-tests/utils/minicore-utils.sh
270 %{_libdir}/crash-worker/system-tests/wait_for_opt_usr/wait_for_opt_usr.sh
271 %{_libdir}/crash-worker/system-tests/without_core/without_core.sh
273 %if %{with livedumper}
274 %{_libdir}/crash-worker/system-tests/livedumper/livedumper.sh