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)
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})
#
# 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 &
<!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>
[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
+++ /dev/null
-<!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>
-
%bcond_with bluetooth_frwk_libnotify
%bcond_with bluetooth_frwk_libnotification
-%bcond_with multi_user
%bcond_with x
Name: bluetooth-frwk
BuildRequires: pkgconfig(notification)
BuildRequires: pkgconfig(security-server)
BuildRequires: cmake
+BuildRequires: pkgconfig(libtzplatform-config)
Requires(post): vconf
Requires(post): /sbin/ldconfig
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
%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
%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