enable/disable bluetooth through ConnMan instead of BlueZ
[platform/core/connectivity/bluetooth-frwk.git] / packaging / bluetooth-frwk.spec
1 %bcond_with bluetooth_frwk_libnotify
2 %bcond_with bluetooth_frwk_libnotification
3 %bcond_with x
4
5 Name:       bluetooth-frwk
6 Summary:    Bluetooth framework for BlueZ and Obexd
7 Version:    0.2.55
8 Release:    2
9 Group:      Network & Connectivity/Bluetooth
10 License:    Apache-2.0
11 Source0:    %{name}-%{version}.tar.gz
12 Source1001: bluetooth-frwk.manifest
13 Source1002: bt-icon.png
14 URL:        https://review.tizen.org/git/?p=platform/core/connectivity/bluetooth-frwk.git;a=summary
15 Requires: dbus
16 Requires: bluetooth-tools
17 BuildRequires:  pkgconfig(aul)
18 BuildRequires:  pkgconfig(dbus-glib-1)
19 BuildRequires:  pkgconfig(dlog)
20 BuildRequires:  pkgconfig(glib-2.0)
21 %if %{with bluetooth_frwk_libnotify}
22 BuildRequires:  pkgconfig(libnotify)
23 BuildRequires:  pkgconfig(gdk-pixbuf-2.0)
24 BuildRequires:  pkgconfig(gtk+-3.0)
25 %elif %{without bluetooth_frwk_libnotification}
26 BuildRequires:  pkgconfig(syspopup-caller)
27 Requires:       syspopup
28 %endif
29 BuildRequires:  pkgconfig(vconf)
30 BuildRequires:  pkgconfig(libxml-2.0)
31 BuildRequires:  pkgconfig(dbus-1)
32 %if %{with x}
33 BuildRequires:  pkgconfig(utilX)
34 %endif
35 BuildRequires:  pkgconfig(capi-network-tethering)
36 BuildRequires:  pkgconfig(libprivilege-control)
37 BuildRequires:  pkgconfig(status)
38 BuildRequires:  pkgconfig(alarm-service)
39 BuildRequires:  pkgconfig(notification)
40 BuildRequires:  pkgconfig(security-server)
41 BuildRequires:  cmake
42 BuildRequires:  pkgconfig(libtzplatform-config)
43
44 Requires(post): vconf
45 Requires(post): /sbin/ldconfig
46 Requires(postun): /sbin/ldconfig
47
48 %description
49 Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
50  This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
51
52
53 %package devel
54 Summary:    Bluetooth framework for BlueZ and Obexd
55 Group:      Development/Libraries
56 Requires:   %{name} = %{version}-%{release}
57
58 %description devel
59 This package is development files for Bluetooth framework based on BlueZ and Obexd stack.
60 This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
61
62 %package service
63 Summary:    Bluetooth Service daemon
64 Group:      Network & Connectivity/Bluetooth
65 Requires:   %{name} = %{version}-%{release}
66
67 %description service
68 This package is Bluetooth Service daemon to manage BT services.
69
70 %package core
71 Summary:    Bluetooth Core daemon
72 Group:      Network & Connectivity/Bluetooth
73 Requires:   %{name} = %{version}-%{release}
74 Requires:   connman
75
76 %description core
77 This package is Bluetooth core daemon to manage activation / deactivation.
78
79 %prep
80 %setup -q
81 cp %{SOURCE1001} .
82
83
84 %build
85
86 %ifarch x86_64
87 export CFLAGS+="   -Wall -g -fvisibility=hidden -fPIC"
88 export LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
89 %else
90 export CFLAGS+=" -fpie"
91 export LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
92 %endif
93
94 %cmake . \
95 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
96 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
97 %if %{with bluetooth_frwk_libnotify}
98  -DLIBNOTIFY_SUPPORT=On \
99 %else
100  -DLIBNOTIFY_SUPPORT=Off \
101 %endif
102 %if %{with bluetooth_frwk_libnotification}
103  -DLIBNOTIFICATION_SUPPORT=On
104 %else
105  -DLIBNOTIFICATION_SUPPORT=Off
106 %endif
107
108 make
109
110 %install
111 rm -rf %{buildroot}
112 %make_install
113
114 mkdir -p %{buildroot}%{_unitdir_user}
115 mkdir -p %{buildroot}%{_unitdir_user}/tizen-middleware.target.wants
116 install -m 0644 bt-service/bluetooth-frwk-service.service %{buildroot}%{_unitdir_user}
117 ln -s ../bluetooth-frwk-service.service %{buildroot}%{_unitdir_user}/tizen-middleware.target.wants/bluetooth-frwk-service.service
118
119 %if %{with bluetooth_frwk_libnotify} || %{with bluetooth_frwk_libnotification}
120 mkdir -p %{buildroot}%{_datadir}/icons/default
121 install -m 0644 %{SOURCE1002} %{buildroot}%{_datadir}/icons/default/bt-icon.png
122 %endif
123
124 # On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
125 %if "%{profile}"=="ivi"
126 sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service
127 %endif
128
129 %post
130 /sbin/ldconfig
131 vconftool set -tf int db/bluetooth/status "0" -g 6520
132 vconftool set -tf int file/private/bt-service/flight_mode_deactivated "0" -g 6520 -i
133 vconftool set -tf string memory/bluetooth/sco_headset_name "" -g 6520 -i
134 vconftool set -tf int memory/bluetooth/device "0" -g 6520 -i
135 vconftool set -tf int memory/bluetooth/btsco "0" -g 6520 -i
136
137 %postun -p /sbin/ldconfig
138
139 %files
140 %manifest %{name}.manifest
141 %defattr(-, root, root)
142 %{_libdir}/libbluetooth-api.so.*
143
144 %files devel
145 %manifest %{name}.manifest
146 %defattr(-, root, root)
147 %{_includedir}/bt-service/bluetooth-api.h
148 %{_includedir}/bt-service/bluetooth-hid-api.h
149 %{_includedir}/bt-service/bluetooth-audio-api.h
150 %{_includedir}/bt-service/bluetooth-telephony-api.h
151 %{_includedir}/bt-service/bluetooth-media-control.h
152 %{_libdir}/pkgconfig/bluetooth-api.pc
153 %{_libdir}/libbluetooth-api.so
154
155 %files service
156 %manifest %{name}.manifest
157 %defattr(-, root, root)
158 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
159
160 %{_bindir}/bt-service
161 %{_unitdir_user}/tizen-middleware.target.wants/bluetooth-frwk-service.service
162 %{_unitdir_user}/bluetooth-frwk-service.service
163 %attr(0666,-,-) /opt/var/lib/bluetooth/auto-pair-blacklist
164 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
165 %if %{with bluetooth_frwk_libnotify} || %{with bluetooth_frwk_libnotification}
166 %{_datadir}/icons/default/bt-icon.png
167 %endif
168
169 %files core
170 %manifest %{name}.manifest
171 %defattr(-, root, root)
172 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
173 %{_bindir}/bt-core
174 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf