1 # "on_off foo" wil turn into "ON" or "OFF"
2 %define on_off() %{expand:%%{?with_%{1}:ON}%%{!?with_%{1}:OFF}}
5 %define _with_logdump on
11 # NOTE: To disable coredump set DumpCore=0 in configuration file
14 Summary: Crash-manager
17 Group: Framework/system
18 License: Apache-2.0 and BSD
19 Source0: %{name}-%{version}.tar.gz
20 Source1001: crash-worker.manifest
21 BuildRequires: pkgconfig(dlog)
22 BuildRequires: pkgconfig(libtzplatform-config)
23 BuildRequires: pkgconfig(iniparser)
24 BuildRequires: pkgconfig(capi-system-info)
25 BuildRequires: pkgconfig(glib-2.0)
26 BuildRequires: pkgconfig(rpm)
28 BuildRequires: pkgconfig(pkgmgr-info)
30 BuildRequires: pkgconfig(libunwind-generic)
31 BuildRequires: libelf-devel libelf
32 BuildRequires: libebl-devel libebl
33 BuildRequires: libdw-devel libdw
36 BuildRequires: doxygen
39 Requires(post): coreutils
45 Requires: %{_sbindir}/minicoredumper
46 Requires: %{_bindir}/buxton2ctl
53 Summary: Documentation package for crash-worker
54 Group: Framework/System
57 This package provides development documentation for crash-worker.
62 Summary: Package with binaries and data for crash-worker tests
65 This package contains installable tests in Bash.
71 #Path to store logs and coredump files
72 %define crash_root_path %{TZ_SYS_CRASH_ROOT}
73 %define crash_path %{TZ_SYS_CRASH}
74 %define crash_temp %{crash_root_path}/temp
76 #Debug mode path - existence of file at path below mean that core file should be generated
77 %define debugmode_path %{TZ_SYS_ETC}/.debugmode
79 #Path for log_dump module
80 %define crash_all_log %{TZ_SYS_ALLLOGS}
81 %define crash_dump_gen %{TZ_SYS_DUMPGEN}
83 %define upgrade_script_path %{TZ_SYS_RO_SHARE}/upgrade/scripts
88 export CFLAGS+=" -Werror"
90 %ifarch %{arm} aarch64
103 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
104 -DTMP_FILES_DIR=%{_sysconfdir}/tmpfiles.d \
106 -DARCH_BIT=%{ARCH_BIT} \
107 -DCRASH_MANAGER_CONFIG_PATH=%{_sysconfdir}/crash-manager.conf \
108 -DCRASH_ROOT_PATH=%{crash_root_path} \
109 -DCRASH_PATH=%{crash_path} \
110 -DCRASH_TEMP=%{crash_temp} \
111 -DDEBUGMODE_PATH=%{debugmode_path} \
112 -DMINICOREDUMPER_BIN_PATH=%{_sbindir}/minicoredumper \
113 -DMINICOREDUMPER_CONFIG_PATH=%{_sysconfdir}/minicoredumper/minicoredumper.cfg.json \
114 -DCRASH_STACK_PATH=%{_libexecdir}/crash-stack \
115 -DCRASH_TESTS_PATH=%{_libdir}/crash-worker-tests \
116 -DSYS_ASSERT=%{on_off sys_assert} \
117 -DLOG_DUMP=%{on_off logdump} \
118 -DUPGRADE_SCRIPT_PATH=%{upgrade_script_path} \
120 make %{?jobs:-j%jobs}
128 mkdir -p %{buildroot}%{crash_root_path}
129 mkdir -p %{buildroot}%{crash_path}
130 mkdir -p %{buildroot}%{crash_temp}
134 mkdir -p %{buildroot}%{crash_all_log}
135 mkdir -p %{buildroot}%{crash_dump_gen}
136 cp dump_scripts/* %{buildroot}%{crash_dump_gen}
137 chmod 755 %{buildroot}%{crash_dump_gen}/*
141 %if %{with sys_assert}
142 if [ ! -d /.build ]; then
143 orig="%{_libdir}/libsys-assert.so"
144 pattern=$(echo $orig | sed -e 's|/|\\/|g')
145 ret=$(sed -n "/${pattern}/p" %{_sysconfdir}/ld.so.preload)
146 if [ -z "$ret" ]; then
147 echo "%{_libdir}/libsys-assert.so" >> %{_sysconfdir}/ld.so.preload
149 chmod 644 %{_sysconfdir}/ld.so.preload
155 /usr/bin/chsmack -a "System" -t %{crash_path}
156 /usr/bin/chsmack -a "System" -t %{crash_temp}
159 /usr/bin/chsmack -a "System" -t %{crash_dump_gen}
160 /usr/bin/chsmack -a "System" -t %{crash_dump_gen}/module.d
161 /usr/bin/chsmack -a "System::Shared" -t %{crash_all_log}
162 /usr/bin/chsmack -a "_" %{crash_dump_gen}/module.d/*
166 %if %{with sys_assert}
167 orig="%{_libdir}/libsys-assert.so"
168 pattern=$(echo $orig | sed -e 's|/|\\/|g')
169 sed -i "/${pattern}/D" %{_sysconfdir}/ld.so.preload
175 %manifest crash-worker.manifest
176 %defattr(-,system_fw,system_fw,-)
177 %dir %{crash_root_path}
180 %{_sysconfdir}/crash-manager.conf
181 %attr(-,root,root) %{_prefix}/lib/sysctl.d/99-crash-manager.conf
182 %attr(0750,system_fw,system_fw) %{_bindir}/crash-manager
183 %attr(0750,system_fw,system_fw) %{_bindir}/dump_systemstate
184 %{_libexecdir}/crash-stack
185 %{_libexecdir}/crash-popup-launch
188 %dir %{crash_all_log}
190 %attr(-,root,root) %{_unitdir}/log_dump.service
191 %attr(-,root,root) %{_sysconfdir}/dbus-1/system.d/log_dump.conf
192 %attr(-,root,root) %{_datadir}/dbus-1/system-services/org.tizen.system.crash.service
193 %attr(0750,system_fw,system_fw) %{_bindir}/log_dump
196 %if %{with sys_assert}
197 %{_libdir}/libsys-assert.so
198 %{_sysconfdir}/tmpfiles.d/sys-assert.conf
202 %attr(-,root,root) %{upgrade_script_path}/500.crash-manager-upgrade.sh
206 %{_datadir}/doc/crash-worker
211 %manifest %{name}.manifest
212 %defattr(-,root,root)
213 %{_libdir}/crash-worker-tests/test1-default-crash
214 %{_libdir}/crash-worker-tests/test1-default-sleep
215 %{_libdir}/crash-worker-tests/test1-default-ill
216 %{_libdir}/crash-worker-tests/test1-custom-crash
217 %{_libdir}/crash-worker-tests/test1-custom-sleep
218 %{_libdir}/crash-worker-tests/test1-custom-ill
219 %{_libdir}/crash-worker-tests/run_tests.sh
220 %{_libdir}/crash-worker-tests/tests_common.sh
221 %{_libdir}/crash-worker-tests/crash_common.sh