Rollback changes to submit TIZEN:COMMON project
[platform/core/connectivity/bluetooth-frwk.git] / packaging / bluetooth-frwk.spec
index 4959ee9..d2e0410 100644 (file)
@@ -5,7 +5,7 @@
 Name:       bluetooth-frwk
 Summary:    Bluetooth framework for BlueZ and Obexd
 Version:    0.2.55
-Release:    2
+Release:    0
 Group:      Network & Connectivity/Bluetooth
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
@@ -37,11 +37,10 @@ BuildRequires:  pkgconfig(libprivilege-control)
 BuildRequires:  pkgconfig(status)
 BuildRequires:  pkgconfig(alarm-service)
 BuildRequires:  pkgconfig(notification)
-BuildRequires:  pkgconfig(security-server)
 BuildRequires:  cmake
 BuildRequires:  pkgconfig(libtzplatform-config)
 
-Requires(post): vconf
+Requires(post): /usr/bin/vconftool
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
 
@@ -71,6 +70,7 @@ This package is Bluetooth Service daemon to manage BT services.
 Summary:    Bluetooth Core daemon
 Group:      Network & Connectivity/Bluetooth
 Requires:   %{name} = %{version}-%{release}
+Requires:   connman
 
 %description core
 This package is Bluetooth core daemon to manage activation / deactivation.
@@ -83,11 +83,11 @@ cp %{SOURCE1001} .
 %build
 
 %ifarch x86_64
-export CFLAGS+="   -Wall -g -fvisibility=hidden -fPIC"
-export LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
+export CFLAGS="${CFLAGS}   -Wall -g -fvisibility=hidden -fPIC"
+export LDFLAGS="${LDFLAGS} -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
 %else
-export CFLAGS+=" -fpie"
-export LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
+export CFLAGS="${CFLAGS} -fpie"
+export LDFLAGS="${LDFLAGS} -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
 %endif
 
 %cmake . \
@@ -104,16 +104,14 @@ export LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbol
  -DLIBNOTIFICATION_SUPPORT=Off
 %endif
 
-make
+%__make
 
 %install
 rm -rf %{buildroot}
 %make_install
 
 mkdir -p %{buildroot}%{_unitdir_user}
-mkdir -p %{buildroot}%{_unitdir_user}/tizen-middleware.target.wants
 install -m 0644 bt-service/bluetooth-frwk-service.service %{buildroot}%{_unitdir_user}
-ln -s ../bluetooth-frwk-service.service %{buildroot}%{_unitdir_user}/tizen-middleware.target.wants/bluetooth-frwk-service.service
 
 %if %{with bluetooth_frwk_libnotify} || %{with bluetooth_frwk_libnotification}
 mkdir -p %{buildroot}%{_datadir}/icons/default
@@ -127,11 +125,17 @@ sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-servi
 
 %post
 /sbin/ldconfig
-vconftool set -tf int db/bluetooth/status "0" -g 6520
-vconftool set -tf int file/private/bt-service/flight_mode_deactivated "0" -g 6520 -i
-vconftool set -tf string memory/bluetooth/sco_headset_name "" -g 6520 -i
-vconftool set -tf int memory/bluetooth/device "0" -g 6520 -i
-vconftool set -tf int memory/bluetooth/btsco "0" -g 6520 -i
+vconftool set -f -t int db/bluetooth/status "0" -g 6520
+vconftool set -f -t int file/private/bt-service/flight_mode_deactivated "0" -g 6520 -i
+vconftool set -f -t string memory/bluetooth/sco_headset_name "" -g 6520 -i
+vconftool set -f -t int memory/bluetooth/device "0" -g 6520 -i
+vconftool set -f -t int memory/bluetooth/btsco "0" -g 6520 -i
+# set 'User' smack label to vconf keys in order to allow bt-service to access them.
+chsmack -a 'User' %TZ_SYS_CONFIG/db/bluetooth/status
+chsmack -a 'User' %TZ_SYS_CONFIG/file/private/bt-service/flight_mode_deactivated
+chsmack -a 'User' %TZ_SYS_CONFIG/memory_init/memory/bluetooth/sco_headset_name
+chsmack -a 'User' %TZ_SYS_CONFIG/memory_init/memory/bluetooth/device
+chsmack -a 'User' %TZ_SYS_CONFIG/memory_init/memory/bluetooth/btsco
 
 %postun -p /sbin/ldconfig
 
@@ -157,7 +161,6 @@ vconftool set -tf int memory/bluetooth/btsco "0" -g 6520 -i
 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
 
 %{_bindir}/bt-service
-%{_unitdir_user}/tizen-middleware.target.wants/bluetooth-frwk-service.service
 %{_unitdir_user}/bluetooth-frwk-service.service
 %attr(0666,-,-) /opt/var/lib/bluetooth/auto-pair-blacklist
 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf