Fix package build for Tizen:IVI 90/22890/3
authorEd Bartosh <eduard.bartosh@intel.com>
Sun, 9 Mar 2014 14:17:56 +0000 (16:17 +0200)
committerjy910.yun <jy910.yun@samsung.com>
Mon, 16 Jun 2014 05:26:33 +0000 (14:26 +0900)
Build of deviced fails for OBS projects with enabled debuginfo and
defined 'simulator' macro with this error:

error: Installed (but unpackaged) file(s) found:
   /usr/lib/debug/.build-id/6e/480d9a978edacf116bd409aa09b97923290f3b
   /usr/lib/debug/.build-id/6e/480d9a978edacf116bd409aa09b97923290f3b.debug
   /usr/lib/debug/usr/bin/restart.debug

The reason of this failure is explained in this bug
https://bugzilla.redhat.com/show_bug.cgi?id=878863#c2:
Debuginfo generation operates on the disk contents and knows exactly
nothing about specs.

In plain English it means that debuginfo doesn't care about %exclude
statements in %files section of the .spec and processes all binaries,
installed into build root.

This fix removes /usr/bin/restart from buildroot to avoid generation of
debug info for it if 'simulator' macro is defined and includes this binary
into the package only if 'simulator' macro is not defined.

Change-Id: I8368ecc53edb54fb068d394db1abf8d1d73e593a
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
packaging/deviced.spec

index 1a20ed3..81fb3bc 100755 (executable)
@@ -198,6 +198,10 @@ install -m 0644 %{SOURCE8} %{buildroot}%{_unitdir}/regpmon.service
 %install_service graphical.target.wants zbooting-done.service
 install -m 0644 %{SOURCE9} %{buildroot}%{_unitdir}/zbooting-done.service
 
+%if 0%{?simulator}
+rm -f %{buildroot}%{_bindir}/restart
+%endif
+
 %post
 #memory type vconf key init
 vconftool set -t int memory/sysman/usbhost_status -1 -i
@@ -272,9 +276,7 @@ systemctl daemon-reload
 %files -n deviced
 %manifest deviced.manifest
 %{_bindir}/deviced
-%if 0%{?simulator}
-%exclude %{_bindir}/restart
-%else
+%if %{undefined simulator}
 %{_bindir}/restart
 %endif
 %{_bindir}/movi_format.sh