update initial spec files
[scm/bb/tizen.git] / proto-meta-Tizen_generic / specfile-initial / bluetooth-frwk / 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
75 %description core
76 This package is Bluetooth core daemon to manage activation / deactivation.
77
78 %prep
79 %setup -q
80 cp %{SOURCE1001} .
81
82
83 %build
84
85 %ifarch x86_64
86 export CFLAGS+="   -Wall -g -fvisibility=hidden -fPIC"
87 export LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
88 %else
89 export CFLAGS+=" -fpie"
90 export LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
91 %endif
92
93 %cmake . \
94 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
95 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
96 %if %{with bluetooth_frwk_libnotify}
97  -DLIBNOTIFY_SUPPORT=On \
98 %else
99  -DLIBNOTIFY_SUPPORT=Off \
100 %endif
101 %if %{with bluetooth_frwk_libnotification}
102  -DLIBNOTIFICATION_SUPPORT=On
103 %else
104  -DLIBNOTIFICATION_SUPPORT=Off
105 %endif
106
107 make
108
109 %install
110 rm -rf %{buildroot}
111 %make_install
112
113 mkdir -p %{buildroot}%{_unitdir_user}
114 mkdir -p %{buildroot}%{_unitdir_user}/tizen-middleware.target.wants
115 install -m 0644 bt-service/bluetooth-frwk-service.service %{buildroot}%{_unitdir_user}
116 ln -s ../bluetooth-frwk-service.service %{buildroot}%{_unitdir_user}/tizen-middleware.target.wants/bluetooth-frwk-service.service
117
118 %if %{with bluetooth_frwk_libnotify} || %{with bluetooth_frwk_libnotification}
119 mkdir -p %{buildroot}%{_datadir}/icons/default
120 install -m 0644 %{SOURCE1002} %{buildroot}%{_datadir}/icons/default/bt-icon.png
121 %endif
122
123 # On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
124 %if "%{profile}"=="ivi"
125 sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service
126 %endif
127
128 %post
129 /sbin/ldconfig
130 vconftool set -tf int db/bluetooth/status "0" -g 6520
131 vconftool set -tf int file/private/bt-service/flight_mode_deactivated "0" -g 6520 -i
132 vconftool set -tf string memory/bluetooth/sco_headset_name "" -g 6520 -i
133 vconftool set -tf int memory/bluetooth/device "0" -g 6520 -i
134 vconftool set -tf int memory/bluetooth/btsco "0" -g 6520 -i
135
136 %postun -p /sbin/ldconfig
137
138 %files
139 %manifest %{name}.manifest
140 %defattr(-, root, root)
141 %{_libdir}/libbluetooth-api.so.*
142
143 %files devel
144 %manifest %{name}.manifest
145 %defattr(-, root, root)
146 %{_includedir}/bt-service/bluetooth-api.h
147 %{_includedir}/bt-service/bluetooth-hid-api.h
148 %{_includedir}/bt-service/bluetooth-audio-api.h
149 %{_includedir}/bt-service/bluetooth-telephony-api.h
150 %{_includedir}/bt-service/bluetooth-media-control.h
151 %{_libdir}/pkgconfig/bluetooth-api.pc
152 %{_libdir}/libbluetooth-api.so
153
154 %files service
155 %manifest %{name}.manifest
156 %defattr(-, root, root)
157 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
158
159 %{_bindir}/bt-service
160 %{_unitdir_user}/tizen-middleware.target.wants/bluetooth-frwk-service.service
161 %{_unitdir_user}/bluetooth-frwk-service.service
162 %attr(0666,-,-) /opt/var/lib/bluetooth/auto-pair-blacklist
163 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
164 %if %{with bluetooth_frwk_libnotify} || %{with bluetooth_frwk_libnotification}
165 %{_datadir}/icons/default/bt-icon.png
166 %endif
167
168 %files core
169 %manifest %{name}.manifest
170 %defattr(-, root, root)
171 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
172 %{_bindir}/bt-core
173 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf