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
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
35 BuildRequires: doxygen
38 %if %{with livedumper}
39 BuildRequires: boost-devel
42 Requires(post): coreutils
48 Requires: minicoredumper >= 2.1.0
49 Requires: %{_bindir}/buxton2ctl
50 %if %{with crashservice}
51 Requires: %{name}-livedumper = %{version}-%{release}
55 %package -n libcrash-service
56 Summary: libcrash-service provides API to communicate with crash-service
57 %description -n libcrash-service
60 Requires: libcrash-service
61 Summary: Crash-manager headers and library for linking
66 Summary: Documentation package for crash-worker
67 Group: Framework/System
73 Summary: Package with binaries and data for crash-worker tests
77 %if %{with livedumper}
79 Summary: Livedumper allows to dump core of live process
80 %description livedumper
86 #Path to store logs and coredump files
87 %define crash_root_path %{TZ_SYS_CRASH_ROOT}
88 %define crash_path %{TZ_SYS_CRASH}
89 %define crash_temp %{crash_root_path}/temp
91 #Debug mode path - existence of file at path below mean that core file should be generated
92 %define debugmode_path %{TZ_SYS_ETC}/.debugmode
94 %define upgrade_script_path %{TZ_SYS_RO_SHARE}/upgrade/scripts
99 export CFLAGS+=" -Werror"
101 %ifarch %{arm} aarch64
114 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
115 -DTMP_FILES_DIR=%{_sysconfdir}/tmpfiles.d \
117 -DARCH_BIT=%{ARCH_BIT} \
118 -DDUMP_SYSTEMSTATE_CONFIG_DIR_PATH=%{_sysconfdir}/dump_systemstate.conf.d \
119 -DCRASH_MANAGER_CONFIG_PATH=%{_sysconfdir}/crash-manager.conf \
120 -DCRASH_ROOT_PATH=%{crash_root_path} \
121 -DCRASH_PATH=%{crash_path} \
122 -DCRASH_TEMP=%{crash_temp} \
123 -DDEBUGMODE_PATH=%{debugmode_path} \
124 -DMINICOREDUMPER_BIN_PATH=%{_sbindir}/minicoredumper \
125 -DMINICOREDUMPER_CONFIG_PATH=%{_sysconfdir}/minicoredumper/minicoredumper.cfg.json \
126 -DLIVEDUMPER_BIN_PATH=%{_bindir}/livedumper \
127 -DDUMP_SYSTEMSTATE_BIN_PATH=%{_bindir}/dump_systemstate \
128 -DCRASH_STACK_BIN_PATH=%{_libexecdir}/crash-stack \
129 -DCRASH_POPUP_BIN_PATH=%{_libexecdir}/crash-popup-launch \
130 -DCRASH_NOTIFY_BIN_PATH=%{_libexecdir}/crash-notify-send \
131 -DCRASH_TESTS_PATH=%{_libdir}/crash-worker-tests \
132 -DLIVEDUMPER=%{on_off livedumper} \
133 -DCRASH_SERVICE=%{on_off crashservice} \
134 -DUPGRADE_SCRIPT_PATH=%{upgrade_script_path} \
138 make %{?jobs:-j%jobs}
146 mkdir -p %{buildroot}%{crash_root_path}
147 mkdir -p %{buildroot}%{crash_path}
148 mkdir -p %{buildroot}%{crash_temp}
151 /usr/bin/chsmack -a "System" -t %{crash_path}
152 /usr/bin/chsmack -a "System" -t %{crash_temp}
155 %license LICENSE LICENSE.BSD
156 %manifest crash-worker.manifest
157 %defattr(-,system_fw,system_fw,-)
158 %dir %{crash_root_path}
161 %{_sysconfdir}/crash-manager.conf
162 %attr(-,root,root) %{_prefix}/lib/sysctl.d/70-crash-manager.conf
163 %attr(0750,system_fw,system_fw) %{_bindir}/crash-manager
164 %attr(0750,system_fw,system_fw) %{_bindir}/dump_systemstate
165 %{_sysconfdir}/dump_systemstate.conf.d/files/files.conf.example
166 %{_sysconfdir}/dump_systemstate.conf.d/programs/programs.conf.example
167 %{_libexecdir}/crash-stack
168 %{_libexecdir}/crash-popup-launch
169 %{_libexecdir}/crash-notify-send
170 %{_libdir}/libcrash-manager.so.*
172 %if %{with crashservice}
173 %attr(0750,system_fw,system_fw) %{_bindir}/crash-service
174 %attr(-,root,root) %{_unitdir}/crash-service.service
175 %attr(-,root,root) %{_sysconfdir}/dbus-1/system.d/crash-service.conf
176 %attr(-,root,root) %{_datadir}/dbus-1/system-services/org.tizen.system.crash.livedump.service
180 %attr(-,root,root) %{upgrade_script_path}/500.crash-manager-upgrade.sh
182 %files -n libcrash-service
183 %{_libdir}/libcrash-service.so.*
186 %{_includedir}/crash-manager.h
187 %{_libdir}/libcrash-manager.so
188 %{_libdir}/pkgconfig/crash-manager.pc
189 %if %{with crashservice}
190 %{_includedir}/libcrash-service.h
191 %{_libdir}/libcrash-service.so
192 %{_libdir}/pkgconfig/crash-service.pc
197 %{_datadir}/doc/crash-worker
202 %manifest %{name}.manifest
203 %defattr(-,root,root)
204 %{_libdir}/crash-worker-tests/test1-default-crash
205 %{_libdir}/crash-worker-tests/test1-default-sleep
206 %{_libdir}/crash-worker-tests/test1-default-ill
207 %{_libdir}/crash-worker-tests/test1-custom-crash
208 %{_libdir}/crash-worker-tests/test1-custom-sleep
209 %{_libdir}/crash-worker-tests/test1-custom-ill
210 %{_libdir}/crash-worker-tests/run_tests.sh
211 %{_libdir}/crash-worker-tests/tests_common.sh
212 %{_libdir}/crash-worker-tests/crash_common.sh
216 %if %{with livedumper}
218 %manifest %{name}.manifest
219 %{_bindir}/livedumper