%define upgrade_script_path %{TZ_SYS_RO_SHARE}/upgrade/scripts
%build
+%{?asan: %define sanitizer 1}
+%{?ubsan: %define sanitizer 1}
+
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
CMAKE_OPTS="-DCONFIG_FILE_PATH=%{config_file_path} \
-DINFO_FILE_PATH=%{info_file_path} \
-DTIZEN_ID_PATH=%{tizen_id_path} \
-DDB_PATH=%{db_path} \
-DUPGRADE_SCRIPT_PATH=%{upgrade_script_path} \
- %{?asan:-DBUILD_UPDATE_DB=OFF}"
+ %{?sanitizer:-DBUILD_UPDATE_DB=OFF}"
mkdir build && cd build
%cmake .. ${CMAKE_OPTS}
# excluded from ASan build. So the update_db is rebuilt without forced ASan
# options after the rest of package is ready
%__make %{?_smp_mflags}
-%{?asan:
+%{?sanitizer:
mkdir -p %{_builddir}/update_db && pushd %{_builddir}/update_db
/usr/bin/gcc-unforce-options
%cmake %{_builddir}/%{name}-%{version} ${CMAKE_OPTS} -DBUILD_UPDATE_DB=ON
pushd build
%make_install
popd
-%{?asan:pushd %{_builddir}/update_db/src/update_db && %make_install && popd}
+%{?sanitizer:pushd %{_builddir}/update_db/src/update_db && %make_install && popd}
mkdir -p %{buildroot}/etc
cp -f script/make_info_file.sh %{buildroot}/etc/make_info_file.sh