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: libdw-devel libdw
33 BuildRequires: libcap-devel
36 BuildRequires: doxygen
39 %if %{with livedumper}
40 BuildRequires: boost-devel
43 Requires(post): coreutils
49 Requires: minicoredumper >= 2.1.0
50 Requires: %{_bindir}/buxton2ctl
51 %if %{with crashservice}
52 Requires: %{name}-livedumper = %{version}-%{release}
56 %package -n libcrash-service
57 Summary: libcrash-service provides API to communicate with crash-service
58 %description -n libcrash-service
61 Requires: libcrash-service
62 Summary: Crash-manager headers and library for linking
67 Summary: Documentation package for crash-worker
68 Group: Framework/System
74 Summary: Package with binaries and data for crash-worker tests
78 %if %{with livedumper}
80 Summary: Livedumper allows to dump core of live process
81 %description livedumper
85 Summary: System tests for crash-worker components
91 Requires: /usr/bin/unzip
92 Requires: /usr/bin/mcookie
93 Requires: %{_sbindir}/minicoredumper
94 Requires: %{name}-system-tests-debuginfo = %{version}-%{release}
95 %description system-tests
100 #Path to store logs and coredump files
101 %define crash_root_path %{TZ_SYS_CRASH_ROOT}
102 %define crash_path %{TZ_SYS_CRASH}
103 %define crash_temp %{crash_root_path}/temp
105 #Debug mode path - existence of file at path below mean that core file should be generated
106 %define debugmode_path %{TZ_SYS_ETC}/.debugmode
108 %define upgrade_script_path %{TZ_SYS_RO_SHARE}/upgrade/scripts
113 export CFLAGS+=" -Werror"
115 %ifarch %{arm} aarch64
128 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
129 -DTMP_FILES_DIR=%{_sysconfdir}/tmpfiles.d \
131 -DARCH_BIT=%{ARCH_BIT} \
132 -DDUMP_SYSTEMSTATE_CONFIG_DIR_PATH=%{_sysconfdir}/dump_systemstate.conf.d \
133 -DCRASH_MANAGER_CONFIG_PATH=%{_sysconfdir}/crash-manager.conf \
134 -DCRASH_ROOT_PATH=%{crash_root_path} \
135 -DCRASH_PATH=%{crash_path} \
136 -DCRASH_TEMP=%{crash_temp} \
137 -DDEBUGMODE_PATH=%{debugmode_path} \
138 -DMINICOREDUMPER_BIN_PATH=%{_sbindir}/minicoredumper \
139 -DMINICOREDUMPER_CONFIG_PATH=%{_sysconfdir}/minicoredumper/minicoredumper.cfg.json \
140 -DLIVEDUMPER_BIN_PATH=%{_bindir}/livedumper \
141 -DDUMP_SYSTEMSTATE_BIN_PATH=%{_bindir}/dump_systemstate \
142 -DCRASH_STACK_BIN_PATH=%{_libexecdir}/crash-stack \
143 -DCRASH_POPUP_BIN_PATH=%{_libexecdir}/crash-popup-launch \
144 -DCRASH_NOTIFY_BIN_PATH=%{_libexecdir}/crash-notify-send \
145 -DCRASH_TESTS_PATH=%{_libdir}/crash-worker/tests \
146 -DCRASH_SYSTEM_TESTS_PATH=%{_libdir}/crash-worker/system-tests \
147 -DLIVEDUMPER=%{on_off livedumper} \
148 -DCRASH_SERVICE=%{on_off crashservice} \
149 -DUPGRADE_SCRIPT_PATH=%{upgrade_script_path} \
151 -DDLOG_LOG_LEVEL=DLOG_INFO \
154 make %{?jobs:-j%jobs}
163 mkdir -p %{buildroot}%{crash_root_path}
164 mkdir -p %{buildroot}%{crash_path}
165 mkdir -p %{buildroot}%{crash_temp}
168 /usr/bin/chsmack -a "System" -t %{crash_path}
169 /usr/bin/chsmack -a "System" -t %{crash_temp}
172 %license LICENSE LICENSE.BSD LICENSE.MIT
173 %manifest crash-worker.manifest
174 %defattr(-,crash_worker,crash_worker,-)
175 %dir %{crash_root_path}
178 %{_sysconfdir}/crash-manager.conf
179 %{_sysconfdir}/crash-manager.conf.d/crash-manager.conf.example
180 %attr(-,root,root) %{_prefix}/lib/sysctl.d/70-crash-manager.conf
181 %attr(0750,crash_worker,crash_worker) %{_bindir}/crash-manager
182 %attr(0750,crash_worker,crash_worker) %{_bindir}/dump_systemstate
183 %{_sysconfdir}/dump_systemstate.conf.d/files/*.conf*
184 %{_sysconfdir}/dump_systemstate.conf.d/programs/*.conf*
185 %{_libexecdir}/crash-stack
186 %{_libexecdir}/crash-popup-launch
187 %{_libexecdir}/crash-notify-send
188 %{_libdir}/libcrash-manager.so.*
190 %if %{with crashservice}
191 %attr(0750,crash_worker,crash_worker) %{_bindir}/crash-service
192 %attr(-,root,root) %{_unitdir}/crash-service.service
193 %attr(-,root,root) %{_sysconfdir}/dbus-1/system.d/crash-service.conf
194 %attr(-,root,root) %{_datadir}/dbus-1/system-services/org.tizen.system.crash.livedump.service
198 %attr(-,root,root) %{upgrade_script_path}/500.crash-manager-upgrade.sh
200 %files -n libcrash-service
201 %{_libdir}/libcrash-service.so.*
204 %{_includedir}/crash-manager.h
205 %{_libdir}/libcrash-manager.so
206 %{_libdir}/pkgconfig/crash-manager.pc
207 %if %{with crashservice}
208 %{_includedir}/libcrash-service.h
209 %{_libdir}/libcrash-service.so
210 %{_libdir}/pkgconfig/crash-service.pc
215 %{_datadir}/doc/crash-worker
220 %manifest %{name}.manifest
221 %defattr(-,root,root)
222 %{_libdir}/crash-worker/tests/test1-default-crash
223 %{_libdir}/crash-worker/tests/test1-default-sleep
224 %{_libdir}/crash-worker/tests/test1-default-ill
225 %{_libdir}/crash-worker/tests/test1-custom-crash
226 %{_libdir}/crash-worker/tests/test1-custom-sleep
227 %{_libdir}/crash-worker/tests/test1-custom-ill
228 %{_libdir}/crash-worker/tests/run_tests.sh
229 %{_libdir}/crash-worker/tests/tests_common.sh
230 %{_libdir}/crash-worker/tests/crash_common.sh
234 %if %{with livedumper}
236 %manifest %{name}.manifest
237 %{_bindir}/livedumper
241 %manifest %{name}.manifest
242 %{_bindir}/crash-worker-system-tests-run
244 %{_libdir}/crash-worker/system-tests/check_minicore_mem/check_minicore_mem.sh
245 %{_libdir}/crash-worker/system-tests/check_minicore_mem/cp.sh
246 %{_libdir}/crash-worker/system-tests/cmp_backtraces/cmp_backtraces.sh
247 %{_libdir}/crash-worker/system-tests/cmp_backtraces/cp.sh
248 %{_libdir}/crash-worker/system-tests/crash_root_path/crash_root_path.sh
249 %{_libdir}/crash-worker/system-tests/critical_process/critical_process.sh
250 %{_libdir}/crash-worker/system-tests/dbus_notify/dbus_notify.sh
251 %{_libdir}/crash-worker/system-tests/dbus_notify_legacy/dbus_notify_legacy.sh
252 %{_libdir}/crash-worker/system-tests/dump_systemstate_extras/dump_systemstate_extras.sh
253 %{_libdir}/crash-worker/system-tests/exclude_paths/exclude_paths.sh
254 %{_libdir}/crash-worker/system-tests/extra_script/extra_script.sh
255 %{_libdir}/crash-worker/system-tests/full_core/full_core.sh
256 %{_libdir}/crash-worker/system-tests/info_file/info_file.sh
257 %{_libdir}/crash-worker/system-tests/libcrash-service/libcrash-service.sh
258 %{_libdir}/crash-worker/system-tests/log_file/log_file.sh
259 %{_libdir}/crash-worker/system-tests/output_param/output_param.sh
260 %{_libdir}/crash-worker/system-tests/report_basic/report_basic.sh
261 %{_libdir}/crash-worker/system-tests/report_type_info/report_type_info.sh
262 %{_libdir}/crash-worker/system-tests/so_info_file/so_info_file.sh
263 %{_libdir}/crash-worker/system-tests/time_test/cp.sh
264 %{_libdir}/crash-worker/system-tests/time_test/time_test.sh
265 %{_libdir}/crash-worker/system-tests/utils/btee
266 %{_libdir}/crash-worker/system-tests/utils/kenny
267 %{_libdir}/crash-worker/system-tests/utils/libcrash-servicetest
268 %{_libdir}/crash-worker/system-tests/utils/minicore-utils.sh
269 %{_libdir}/crash-worker/system-tests/wait_for_opt_usr/wait_for_opt_usr.sh
270 %{_libdir}/crash-worker/system-tests/without_so_info_file/without_so_info_file.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