'app' user is no more present on Tizen Common.
So we can run bt-service as 'guest' user for the moment
(e.g. TZ_SYS_DEFAULT_USER macro refers to 'guest' user)
Add a workaround in spec file to keep compatibility with IVI
that still needs to run bt-service by 'app' user even
if there is a 'guest' user.
Change-Id: I5d1e48cd5352852074f9eda220ffacf0405fbc63
Signed-off-by: Corentin Lecouvey <corentin.lecouvey@open.eurogiciel.org>
ENDIF(LIBNOTIFY_SUPPORT)
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/org.projectx.bt.service.in ${CMAKE_CURRENT_SOURCE_DIR}/org.projectx.bt.service)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.projectx.bt.service DESTINATION share/dbus-1/system-services)
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
[D-BUS Service]
Name=org.projectx.bt
Exec=/bin/sh -c 'export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$UID/dbus/user_bus_socket; exec /usr/bin/bt-service'
-User=app
+User=@TZ_SYS_DEFAULT_USER@
export CFLAGS+=" -fpie"
export LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
%endif
+
%cmake . \
-DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
+-DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
%if %{with bluetooth_frwk_libnotify}
-DLIBNOTIFY_SUPPORT=On \
%else
install -m 0644 %{SOURCE1002} %{buildroot}%{_datadir}/icons/default/bt-icon.png
%endif
+# On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
+%if "%{profile}"=="ivi"
+sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service
+%endif
+
%post
/sbin/ldconfig
vconftool set -tf int db/bluetooth/status "0" -g 6520