Backup/Restore scripts are provided to solve conflict with
soc-npu-user-libs.
When it installs, it will backup files which will be installed
to /root directory. And rpm shows information both packages
are installed.
After developing npu-enigne, it will restore previously backup
files while it removes package.
To enable this feature, build with 'dtv' definition.
$ vbs build -A armv7l --include-all --define 'dtv 1'
Signed-off-by: Jiho Chu <jiho.chu@samsung.com>
chsmack -a "User::App::Shared" /tmp/npu-engine.log
%endif
+# Backup/Restore scripts are provided for workaround to solve the conflict with soc-npu-user-libs
+%if 0%{?dtv}
+%pre
+# backup files only in install case
+if [ $1 -eq 1 ]; then
+mkdir -p /root/npu-engine
+cp %{_libdir}/libnpu-engine*.so /root/npu-engine/
+cp %{_sysconfdir}/npu-engine.ini /root/npu-engine/
+fi
+
+%postun
+# restore files only in uninstall case
+if [ $1 -eq 0 ]; then
+mv /root/npu-engine/libnpu-engine*.so %{_libdir}/
+mv /root/npu-engine/npu-engine.ini %{_sysconfdir}/
+rm -rf /root/npu-engine
+fi
+%endif
+
%files
%manifest npu-engine.manifest
%defattr(-,root,root,-)