Remove hardcoded path for multiuser support 64/18264/1 accepted/tizen/generic/20140325.191842 accepted/tizen/ivi/20140325.183459 accepted/tizen/ivi/panda/20140326.234455 submit/tizen/20140325.023152
authorSabera Djelti (sdi2) <sabera.djelti@open.eurogiciel.org>
Wed, 19 Mar 2014 16:57:10 +0000 (17:57 +0100)
committerSabera Djelti (sdi2) <sabera.djelti@open.eurogiciel.org>
Wed, 19 Mar 2014 16:59:49 +0000 (17:59 +0100)
Bug-Tizen: PTREL-365

Change-Id: I1496814e5ae4b691f7a459a76b8959538f943715
Signed-off-by: Sabera Djelti (sdi2) <sabera.djelti@open.eurogiciel.org>
CMakeLists.txt
bt-service/CMakeLists.txt
bt-service/bluetooth-frwk-service
bt-service/bluetooth-frwk-service.conf.in [moved from bt-service/bluetooth-frwk-service.conf with 91% similarity]
bt-service/bluetooth-frwk-service.service
bt-service/bluetooth-frwk-service_user.conf [deleted file]
packaging/bluetooth-frwk.spec

index 81a231c..9a47572 100644 (file)
@@ -9,11 +9,6 @@ IF(LIBNOTIFICATION_SUPPORT)
     ADD_DEFINITIONS("-DLIBNOTIFICATION_SUPPORT")
 ENDIF(LIBNOTIFICATION_SUPPORT)
 
-OPTION(MULTI_USER_SUPPORT "Enable multi-user support" OFF)
-IF(MULTI_USER_SUPPORT)
-    ADD_DEFINITIONS("-DMULTI_USER_SUPPORT")
-ENDIF(MULTI_USER_SUPPORT)
-
 ADD_SUBDIRECTORY(bt-api)
 
 ADD_SUBDIRECTORY(bt-service)
index 33831d7..13934f6 100644 (file)
@@ -104,23 +104,15 @@ ELSE(LIBNOTIFY_SUPPORT)
 ENDIF(LIBNOTIFY_SUPPORT)
 
 
-IF(NOT MULTI_USER_SUPPORT)
-       INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.projectx.bt.service DESTINATION share/dbus-1/system-services)
-ENDIF(NOT MULTI_USER_SUPPORT)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.projectx.bt.service DESTINATION share/dbus-1/system-services)
 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
 
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/auto-pair-blacklist DESTINATION /opt/var/lib/bluetooth)
 
 # install booting script
-IF(NOT MULTI_USER_SUPPORT)
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service.conf)
 INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service DESTINATION /etc/rc.d/init.d)
-ENDIF(NOT MULTI_USER_SUPPORT)
-
-IF(MULTI_USER_SUPPORT)
-       install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service_user.conf DESTINATION /etc/dbus-1/system.d)
-ELSE(MULTI_USER_SUPPORT)
-       install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service.conf DESTINATION /etc/dbus-1/system.d)
-ENDIF(MULTI_USER_SUPPORT)
+install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service.conf DESTINATION /etc/dbus-1/system.d)
 
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 
index 674d59e..b9cfc40 100644 (file)
@@ -3,10 +3,11 @@
 #
 # Script for running BT Service during booting time
 #
+source /etc/tizen-platform.conf
 
 if [ -x /usr/bin/bt-service ]; then
        if [ -d /sys/fs/cgroup/systemd ]; then
-               export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/app/dbus/user_bus_socket;
+               export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${TZ_USER_NAME}/dbus/user_bus_socket;
        fi
 
        /usr/bin/bt-service &
similarity index 91%
rename from bt-service/bluetooth-frwk-service.conf
rename to bt-service/bluetooth-frwk-service.conf.in
index 6e799a1..1c490a5 100644 (file)
@@ -1,7 +1,7 @@
 <!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
  "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
 <busconfig>
-    <policy user="app">
+    <policy group="@TZ_SYS_USER_GROUP@">
         <allow own="org.projectx.bt"/>
         <allow own="org.projectx.bt_event"/>
     </policy>
index 63bf3df..50c2291 100644 (file)
@@ -6,7 +6,7 @@ Description=Bluetooth Framework Service
 [Service]
 Type=dbus
 BusName=org.projectx.bt
-Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/app/dbus/user_bus_socket
+Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$UID/dbus/user_bus_socket
 ExecStart=/usr/bin/bt-service
 RemainAfterExit=yes
 
diff --git a/bt-service/bluetooth-frwk-service_user.conf b/bt-service/bluetooth-frwk-service_user.conf
deleted file mode 100644 (file)
index ff102d6..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
-    <policy context="default">
-        <allow own="org.projectx.bt"/>
-        <allow own="org.projectx.bt_event"/>
-    </policy>
-    <policy at_console="true">
-        <allow send_destination="org.projectx.bt"/>
-    </policy>
-    <policy context="default">
-        <allow send_destination="org.projectx.bt"/>
-    </policy>
-</busconfig>
-
index 99f6f64..0534829 100644 (file)
@@ -1,6 +1,5 @@
 %bcond_with bluetooth_frwk_libnotify
 %bcond_with bluetooth_frwk_libnotification
-%bcond_with multi_user
 %bcond_with x
 
 Name:       bluetooth-frwk
@@ -40,6 +39,7 @@ BuildRequires:  pkgconfig(alarm-service)
 BuildRequires:  pkgconfig(notification)
 BuildRequires:  pkgconfig(security-server)
 BuildRequires:  cmake
+BuildRequires:  pkgconfig(libtzplatform-config)
 
 Requires(post): vconf
 Requires(post): /sbin/ldconfig
@@ -90,11 +90,7 @@ export CFLAGS+=" -fpie"
 export LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
 %endif
 %cmake . \
-%if %{with multi_user}
-       -DMULTI_USER_SUPPORT=On \
-%else
-       -DMULTI_USER_SUPPORT=Off \
-%endif
+-DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
 %if %{with bluetooth_frwk_libnotify}
  -DLIBNOTIFY_SUPPORT=On \
 %else
@@ -111,14 +107,10 @@ make
 %install
 rm -rf %{buildroot}
 %make_install
-%if !%{with multi_user}
-       mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc3.d/
-       mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc5.d/
-       ln -s %{_sysconfdir}/rc.d/init.d/bluetooth-frwk-service %{buildroot}%{_sysconfdir}/rc.d/rc3.d/S80bluetooth-frwk-service
-       ln -s %{_sysconfdir}/rc.d/init.d/bluetooth-frwk-service %{buildroot}%{_sysconfdir}/rc.d/rc5.d/S80bluetooth-frwk-service
-%else
-       mv %{buildroot}%{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service_user.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
-%endif
+mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc3.d/
+mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc5.d/
+ln -s %{_sysconfdir}/rc.d/init.d/bluetooth-frwk-service %{buildroot}%{_sysconfdir}/rc.d/rc3.d/S80bluetooth-frwk-service
+ln -s %{_sysconfdir}/rc.d/init.d/bluetooth-frwk-service %{buildroot}%{_sysconfdir}/rc.d/rc5.d/S80bluetooth-frwk-service
 
 mkdir -p %{buildroot}%{_unitdir_user}
 mkdir -p %{buildroot}%{_unitdir_user}/tizen-middleware.target.wants
@@ -159,12 +151,11 @@ vconftool set -tf int memory/bluetooth/btsco "0" -g 6520 -i
 %files service
 %manifest %{name}.manifest
 %defattr(-, root, root)
-%if !%{with multi_user}
-       %{_datadir}/dbus-1/system-services/org.projectx.bt.service
-       %{_sysconfdir}/rc.d/init.d/bluetooth-frwk-service
-       %{_sysconfdir}/rc.d/rc3.d/S80bluetooth-frwk-service
-       %{_sysconfdir}/rc.d/rc5.d/S80bluetooth-frwk-service
-%endif
+%{_datadir}/dbus-1/system-services/org.projectx.bt.service
+%{_sysconfdir}/rc.d/init.d/bluetooth-frwk-service
+%{_sysconfdir}/rc.d/rc3.d/S80bluetooth-frwk-service
+%{_sysconfdir}/rc.d/rc5.d/S80bluetooth-frwk-service
+
 %{_bindir}/bt-service
 %{_unitdir_user}/tizen-middleware.target.wants/bluetooth-frwk-service.service
 %{_unitdir_user}/bluetooth-frwk-service.service