launch bt-service as 'guest' user instead of 'app' 11/28611/2 accepted/tizen/3.0.2014.q3/common/20141020.094323 accepted/tizen/common/20141013.105514 submit/tizen/20141013.073414 submit/tizen/20141013.104150 submit/tizen_3.0.2014.q3_common/20141020.093726
authorCorentin Lecouvey <corentin.lecouvey@open.eurogiciel.org>
Fri, 10 Oct 2014 11:57:56 +0000 (13:57 +0200)
committerCorentin Lecouvey <corentin.lecouvey@open.eurogiciel.org>
Fri, 10 Oct 2014 15:22:45 +0000 (17:22 +0200)
'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>
bt-service/CMakeLists.txt
bt-service/org.projectx.bt.service.in [moved from bt-service/org.projectx.bt.service with 85% similarity]
packaging/bluetooth-frwk.spec

index 2bd86f2..22045e1 100644 (file)
@@ -106,6 +106,7 @@ ELSE(LIBNOTIFY_SUPPORT)
 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)
 
similarity index 85%
rename from bt-service/org.projectx.bt.service
rename to bt-service/org.projectx.bt.service.in
index bc73483..bf43821 100644 (file)
@@ -1,4 +1,4 @@
 [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@
index 5429bf4..fee56c7 100644 (file)
@@ -89,8 +89,10 @@ export LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbol
 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
@@ -122,6 +124,11 @@ mkdir -p %{buildroot}%{_datadir}/icons/default
 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