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: Crash-manager
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)
31 BuildRequires: pkgconfig(libunwind-generic)
32 BuildRequires: libelf-devel libelf
33 BuildRequires: libebl-devel libebl
34 BuildRequires: libdw-devel libdw
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}
60 %package -n libcrash-service
61 Summary: libcrash-service provides API to communicate with crash-service
62 %description -n libcrash-service
65 Summary: Crash-manager development package
67 Requires: libcrash-service
68 This package provides library and header files.
72 Summary: Documentation package for crash-worker
73 Group: Framework/System
76 This package provides development documentation for crash-worker.
81 Summary: Package with binaries and data for crash-worker tests
84 This package contains installable tests in Bash.
87 %if %{with livedumper}
89 Summary: Livedumper allows to dump core of live process
91 %description livedumper
97 #Path to store logs and coredump files
98 %define crash_root_path %{TZ_SYS_CRASH_ROOT}
99 %define crash_path %{TZ_SYS_CRASH}
100 %define crash_temp %{crash_root_path}/temp
102 #Debug mode path - existence of file at path below mean that core file should be generated
103 %define debugmode_path %{TZ_SYS_ETC}/.debugmode
105 %define upgrade_script_path %{TZ_SYS_RO_SHARE}/upgrade/scripts
110 export CFLAGS+=" -Werror"
112 %ifarch %{arm} aarch64
125 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
126 -DTMP_FILES_DIR=%{_sysconfdir}/tmpfiles.d \
128 -DARCH_BIT=%{ARCH_BIT} \
129 -DDUMP_SYSTEMSTATE_CONFIG_DIR_PATH=%{_sysconfdir}/dump_systemstate.conf.d \
130 -DCRASH_MANAGER_CONFIG_PATH=%{_sysconfdir}/crash-manager.conf \
131 -DCRASH_ROOT_PATH=%{crash_root_path} \
132 -DCRASH_PATH=%{crash_path} \
133 -DCRASH_TEMP=%{crash_temp} \
134 -DDEBUGMODE_PATH=%{debugmode_path} \
135 -DMINICOREDUMPER_BIN_PATH=%{_sbindir}/minicoredumper \
136 -DMINICOREDUMPER_CONFIG_PATH=%{_sysconfdir}/minicoredumper/minicoredumper.cfg.json \
137 -DLIVEDUMPER_BIN_PATH=%{_bindir}/livedumper \
138 -DDUMP_SYSTEMSTATE_BIN_PATH=%{_bindir}/dump_systemstate \
139 -DCRASH_STACK_BIN_PATH=%{_libexecdir}/crash-stack \
140 -DCRASH_POPUP_BIN_PATH=%{_libexecdir}/crash-popup-launch \
141 -DCRASH_NOTIFY_BIN_PATH=%{_libexecdir}/crash-notify-send \
142 -DCRASH_TESTS_PATH=%{_libdir}/crash-worker-tests \
143 -DLIVEDUMPER=%{on_off livedumper} \
144 -DCRASH_SERVICE=%{on_off crashservice} \
145 -DUPGRADE_SCRIPT_PATH=%{upgrade_script_path} \
149 make %{?jobs:-j%jobs}
157 mkdir -p %{buildroot}%{crash_root_path}
158 mkdir -p %{buildroot}%{crash_path}
159 mkdir -p %{buildroot}%{crash_temp}
162 /usr/bin/chsmack -a "System" -t %{crash_path}
163 /usr/bin/chsmack -a "System" -t %{crash_temp}
166 %license LICENSE LICENSE.BSD
167 %manifest crash-worker.manifest
168 %defattr(-,system_fw,system_fw,-)
169 %dir %{crash_root_path}
172 %{_sysconfdir}/crash-manager.conf
173 %attr(-,root,root) %{_prefix}/lib/sysctl.d/70-crash-manager.conf
174 %attr(0750,system_fw,system_fw) %{_bindir}/crash-manager
175 %attr(0750,system_fw,system_fw) %{_bindir}/dump_systemstate
176 %{_sysconfdir}/dump_systemstate.conf.d/files/files.conf.example
177 %{_sysconfdir}/dump_systemstate.conf.d/programs/programs.conf.example
178 %{_libexecdir}/crash-stack
179 %{_libexecdir}/crash-popup-launch
180 %{_libexecdir}/crash-notify-send
181 %{_libdir}/libcrash-manager.so.*
183 %if %{with crashservice}
184 %attr(0750,system_fw,system_fw) %{_bindir}/crash-service
185 %attr(-,root,root) %{_unitdir}/crash-service.service
186 %attr(-,root,root) %{_sysconfdir}/dbus-1/system.d/crash-service.conf
187 %attr(-,root,root) %{_datadir}/dbus-1/system-services/org.tizen.system.crash.livedump.service
191 %attr(-,root,root) %{upgrade_script_path}/500.crash-manager-upgrade.sh
193 %files -n libcrash-service
194 %{_libdir}/libcrash-service.so.*
197 %{_includedir}/crash-manager.h
198 %{_libdir}/libcrash-manager.so
199 %{_libdir}/pkgconfig/crash-manager.pc
200 %if %{with crashservice}
201 %{_includedir}/libcrash-service.h
202 %{_libdir}/libcrash-service.so
203 %{_libdir}/pkgconfig/crash-service.pc
208 %{_datadir}/doc/crash-worker
213 %manifest %{name}.manifest
214 %defattr(-,root,root)
215 %{_libdir}/crash-worker-tests/test1-default-crash
216 %{_libdir}/crash-worker-tests/test1-default-sleep
217 %{_libdir}/crash-worker-tests/test1-default-ill
218 %{_libdir}/crash-worker-tests/test1-custom-crash
219 %{_libdir}/crash-worker-tests/test1-custom-sleep
220 %{_libdir}/crash-worker-tests/test1-custom-ill
221 %{_libdir}/crash-worker-tests/run_tests.sh
222 %{_libdir}/crash-worker-tests/tests_common.sh
223 %{_libdir}/crash-worker-tests/crash_common.sh
227 %if %{with livedumper}
229 %manifest %{name}.manifest
230 %{_bindir}/livedumper