1 # "on_off foo" wil turn into "ON" or "OFF"
2 %define on_off() %{expand:%%{?with_%{1}:ON}%%{!?with_%{1}:OFF}}
9 # NOTE: To disable coredump set DumpCore=0 in configuration file
12 Summary: Crash-manager
15 Group: Framework/system
17 Source0: %{name}-%{version}.tar.gz
18 Source1001: crash-worker.manifest
19 BuildRequires: pkgconfig(dlog)
20 BuildRequires: pkgconfig(libtzplatform-config)
21 BuildRequires: pkgconfig(iniparser)
22 BuildRequires: pkgconfig(capi-system-info)
23 BuildRequires: pkgconfig(glib-2.0)
24 BuildRequires: pkgconfig(rpm)
26 BuildRequires: pkgconfig(pkgmgr-info)
28 BuildRequires: pkgconfig(libunwind-generic)
29 BuildRequires: libelf-devel libelf
30 BuildRequires: libebl-devel libebl
31 BuildRequires: libdw-devel libdw
34 BuildRequires: doxygen
37 Requires(post): coreutils
43 Requires: %{_sbindir}/minicoredumper
50 Summary: Documentation package for crash-worker
51 Group: Framework/System
54 This package provides development documentation for crash-worker.
59 Summary: Package with binaries and data for crash-worker tests
62 This package contains installable tests in Bash.
68 #Path to store logs and coredump files
69 %define crash_root_path %{TZ_SYS_CRASH_ROOT}
70 %define crash_path %{TZ_SYS_CRASH}
71 %define crash_temp %{crash_root_path}/temp
73 #Debug mode path - existence of file at path below mean that core file should be generated
74 %define debugmode_path %{TZ_SYS_ETC}/.debugmode
76 #Path for log_dump module
77 %define crash_all_log %{TZ_SYS_ALLLOGS}
78 %define crash_dump_gen %{TZ_SYS_DUMPGEN}
80 %define upgrade_script_path %{TZ_SYS_RO_SHARE}/upgrade/scripts
85 export CFLAGS+=" -Werror"
87 %ifarch %{arm} aarch64
100 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
101 -DTMP_FILES_DIR=%{_sysconfdir}/tmpfiles.d \
103 -DARCH_BIT=%{ARCH_BIT} \
104 -DCRASH_MANAGER_CONFIG_PATH=%{_sysconfdir}/crash-manager.conf \
105 -DTZ_SYS_ETC=%{TZ_SYS_ETC} \
106 -DTZ_SYS_BIN=%{TZ_SYS_BIN} \
107 -DCRASH_ROOT_PATH=%{crash_root_path} \
108 -DCRASH_PATH=%{crash_path} \
109 -DCRASH_TEMP=%{crash_temp} \
110 -DDEBUGMODE_PATH=%{debugmode_path} \
111 -DMINICOREDUMPER_BIN_PATH=%{_sbindir}/minicoredumper \
112 -DMINICOREDUMPER_CONFIG_PATH=%{_sysconfdir}/minicoredumper/minicoredumper.cfg.json \
113 -DCRASH_STACK_PATH=%{_libexecdir}/crash-stack \
114 -DCRASH_TESTS_PATH=%{_libdir}/crash-worker-tests \
115 -DSYS_ASSERT=%{on_off sys_assert} \
116 -DUPGRADE_SCRIPT_PATH=%{upgrade_script_path} \
118 make %{?jobs:-j%jobs}
126 mkdir -p %{buildroot}%{crash_root_path}
127 mkdir -p %{buildroot}%{crash_path}
128 mkdir -p %{buildroot}%{crash_temp}
131 mkdir -p %{buildroot}%{crash_all_log}
132 mkdir -p %{buildroot}%{crash_dump_gen}
133 cp dump_scripts/* %{buildroot}%{crash_dump_gen}
134 chmod 755 %{buildroot}%{crash_dump_gen}/*
137 %if %{with sys_assert}
138 if [ ! -d /.build ]; then
139 orig="%{_libdir}/libsys-assert.so"
140 pattern=$(echo $orig | sed -e 's|/|\\/|g')
141 ret=$(sed -n "/${pattern}/p" %{_sysconfdir}/ld.so.preload)
142 if [ -z "$ret" ]; then
143 echo "%{_libdir}/libsys-assert.so" >> %{_sysconfdir}/ld.so.preload
145 chmod 644 %{_sysconfdir}/ld.so.preload
151 /usr/bin/chsmack -a "System" -t %{crash_path}
152 /usr/bin/chsmack -a "System" -t %{crash_temp}
153 /usr/bin/chsmack -a "System" -t %{crash_dump_gen}
154 /usr/bin/chsmack -a "System" -t %{crash_dump_gen}/module.d
155 /usr/bin/chsmack -a "System::Shared" -t %{crash_all_log}
156 /usr/bin/chsmack -a "_" %{crash_dump_gen}/module.d/*
159 %if %{with sys_assert}
160 orig="%{_libdir}/libsys-assert.so"
161 pattern=$(echo $orig | sed -e 's|/|\\/|g')
162 sed -i "/${pattern}/D" %{_sysconfdir}/ld.so.preload
168 %manifest crash-worker.manifest
169 %defattr(-,system_fw,system_fw,-)
170 %dir %{crash_root_path}
173 %dir %{crash_all_log}
175 %attr(0750,system_fw,system_fw) %{_bindir}/*
176 %{_unitdir}/log_dump.service
177 %{_sysconfdir}/crash-manager.conf
178 %attr(-,root,root) %{_sysconfdir}/dbus-1/system.d/log_dump.conf
179 %attr(-,root,root) %{_prefix}/lib/sysctl.d/99-crash-manager.conf
180 %attr(-,root,root) %{_datadir}/dbus-1/system-services/org.tizen.system.crash.service
181 %{_libexecdir}/crash-stack
182 %if %{with sys_assert}
183 %{_libdir}/libsys-assert.so
184 %{_sysconfdir}/tmpfiles.d/sys-assert.conf
188 %attr(-,root,root) %{upgrade_script_path}/500.crash-manager-upgrade.sh
192 %{_datadir}/doc/crash-worker
197 %manifest %{name}.manifest
198 %defattr(-,root,root)
199 %{_libdir}/crash-worker-tests/test1-default-crash
200 %{_libdir}/crash-worker-tests/test1-default-sleep
201 %{_libdir}/crash-worker-tests/test1-default-ill
202 %{_libdir}/crash-worker-tests/test1-custom-crash
203 %{_libdir}/crash-worker-tests/test1-custom-sleep
204 %{_libdir}/crash-worker-tests/test1-custom-ill
205 %{_libdir}/crash-worker-tests/run_tests.sh
206 %{_libdir}/crash-worker-tests/tests_common.sh
207 %{_libdir}/crash-worker-tests/crash_common.sh