Tizen recipes : Fix tizen common build and get little more closer to current Tizen...
[scm/bb/meta-tizen.git] / meta-tizen-ivi / meta-tizen-common-base / recipes-connectivity / bluetooth-frwk / bluetooth-frwk.inc
1 DESCRIPTION = "Bluetooth framework for BlueZ and Obexd"
2 HOMEPAGE = "http://nohomepage.org"
3 SECTION = "Network & Connectivity/Bluetooth"
4 LICENSE = "Apache-2.0"
5 PV = "0.2.55"
6
7 SRC_URI = ""
8
9 S = "${WORKDIR}/git"
10
11 inherit manifest autotools-brokensep
12
13 BBCLASSEXTEND = ""
14 PROVIDES = ""
15
16 #PROVIDES by bluetooth-frwk-core
17 PROVIDES += "bluetooth-frwk-core"
18
19
20 #PROVIDES by bluetooth-frwk-dev
21 PROVIDES += "bluetooth-frwk-dev"
22
23
24 #PROVIDES by bluetooth-frwk-service
25 PROVIDES += "bluetooth-frwk-service"
26
27
28 #PROVIDES by bluetooth-frwk
29
30
31 RDEPENDS = ""
32 #RDEPENDS of bluetooth-frwk-core (${PN}-core)
33 RDEPENDS_${PN}-core += "connman"
34 RDEPENDS_${PN}-core += "bluetooth-frwk"
35
36 #RDEPENDS of bluetooth-frwk-dev (${PN}-dev)
37 RDEPENDS_${PN}-dev += "bluetooth-frwk"
38
39 #RDEPENDS of bluetooth-frwk-service (${PN}-service)
40 RDEPENDS_${PN}-service += "bluetooth-frwk"
41
42 #RDEPENDS of bluetooth-frwk (${PN})
43 RDEPENDS_${PN} += "dbus"
44 RDEPENDS_${PN} += "bluetooth-tools"
45 RDEPENDS_${PN} += "vconf"
46 RDEPENDS_${PN} += "glibc"
47
48
49 DEPENDS = ""
50 #DEPENDS of bluetooth-frwk
51 DEPENDS += "status"
52 inherit tizen_cmake
53 DEPENDS += "libxml2"
54 DEPENDS += "dbus"
55 DEPENDS += "tizen-platform-config"
56 inherit pkgconfig
57 DEPENDS += "dlog"
58 DEPENDS += "glib-2.0"
59 DEPENDS += "capi-network-tethering"
60 DEPENDS += "aul"
61 DEPENDS += "security-server"
62 DEPENDS += "notification"
63 DEPENDS += "alarm-manager"
64 DEPENDS += "libprivilege-control"
65 DEPENDS += "vconf"
66 DEPENDS += "dbus-glib"
67
68 do_prep() {
69  cd ${S}
70  chmod -Rf a+rX,u+w,g-w,o-w ${S}
71  #setup -q
72  cp ${S}/packaging/bluetooth-frwk.manifest .
73  
74  
75  
76 }
77 do_patch_append() {
78     bb.build.exec_func('do_prep', d)
79 }
80
81 do_configure() {
82 }
83
84 do_compile() {
85  cd ${S}
86  LANG=C
87  export LANG
88  unset DISPLAY
89  LD_AS_NEEDED=1; export LD_AS_NEEDED ;
90  
91  
92  export CFLAGS="${CFLAGS}   -Wall -g -fvisibility=hidden -fPIC"
93  export LDFLAGS="${LDFLAGS} -Wl,--rpath=${prefix}/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
94  
95  
96    cmake \
97          -DCMAKE_VERBOSE_MAKEFILE=ON \
98          -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
99          -DCMAKE_INSTALL_LIBDIR:PATH=${prefix}/lib \
100          -DINCLUDE_INSTALL_DIR:PATH=${prefix}/include \
101          -DLIB_INSTALL_DIR:PATH=${prefix}/lib \
102          -DSYSCONF_INSTALL_DIR:PATH=${sysconfdir} \
103          -DSHARE_INSTALL_PREFIX:PATH=${prefix}/share \
104          -DCMAKE_SKIP_RPATH:BOOL=ON \
105          -DBUILD_SHARED_LIBS:BOOL=ON \
106          -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake \
107          ${EXTRA_OECMAKE} . \
108  -DTZ_SYS_USER_GROUP=users \
109  -DTZ_SYS_DEFAULT_USER=app \
110   -DLIBNOTIFY_SUPPORT=Off \
111   -DLIBNOTIFICATION_SUPPORT=On
112  
113  oe_runmake
114  
115  
116  
117 }
118
119 do_install() {
120  export RPM_BUILD_ROOT=${D}
121  cd ${S}
122  LANG=C
123  export LANG
124  unset DISPLAY
125  rm -rf ${D}
126  mkdir -p ${D}
127  
128  rm -rf ${D}
129  
130    oe_runmake \
131          DESTDIR=${D} \
132          INSTALL_ROOT=${D} \
133          BINDIR=${prefix}/bin \
134    install  
135    rm -f ${D}${infodir}/dir 
136    find ${D} -regex ".*\.la$" | xargs rm -f -- 
137    find ${D} -regex ".*\.a$" | xargs rm -f --
138  
139  mkdir -p ${D}${prefix}/lib/systemd/user
140  install -m 0644 bt-service/bluetooth-frwk-service.service ${D}${prefix}/lib/systemd/user
141  
142  mkdir -p ${D}${prefix}/share/icons/default
143  install -m 0644 ${S}/packaging/bt-icon.png ${D}${prefix}/share/icons/default/bt-icon.png
144  
145  # On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
146  
147  
148 }
149
150 pkg_postinst_${PN}() {
151     #!/bin/sh -e
152
153     [ "x$D" == "x" ] && ldconfig
154     vconftool set -f -t int db/bluetooth/status "0" -g 6520
155     vconftool set -f -t int file/private/bt-service/flight_mode_deactivated "0" -g 6520 -i
156     vconftool set -f -t string memory/bluetooth/sco_headset_name "" -g 6520 -i
157     vconftool set -f -t int memory/bluetooth/device "0" -g 6520 -i
158     vconftool set -f -t int memory/bluetooth/btsco "0" -g 6520 -i
159     # set 'User' smack label to vconf keys in order to allow bt-service to access them.
160     chsmack -a 'User' $D${prefix}/kdb/db/bluetooth/status
161     chsmack -a 'User' $D${prefix}/kdb/file/private/bt-service/flight_mode_deactivated
162     chsmack -a 'User' $D${prefix}/kdb/memory_init/memory/bluetooth/sco_headset_name
163     chsmack -a 'User' $D${prefix}/kdb/memory_init/memory/bluetooth/device
164     chsmack -a 'User' $D${prefix}/kdb/memory_init/memory/bluetooth/btsco
165
166 }
167
168 pkg_postrm_${PN}() {
169     #!/bin/sh -e
170
171     [ "x$D" == "x" ] && ldconfig
172 }
173
174 PACKAGES = "${PN}-dbg ${PN}-doc ${PN}-locale"
175 PACKAGES += " bluetooth-frwk-dev "
176 PACKAGES += " bluetooth-frwk-core "
177 PACKAGES += " bluetooth-frwk-service "
178 PACKAGES += " bluetooth-frwk "
179
180 bluetooth-frwk-dev_files = ""
181 bluetooth-frwk-dev_files += "${prefix}/include/bt-service/bluetooth-api.h"
182 bluetooth-frwk-dev_files += "${prefix}/include/bt-service/bluetooth-hid-api.h"
183 bluetooth-frwk-dev_files += "${prefix}/include/bt-service/bluetooth-audio-api.h"
184 bluetooth-frwk-dev_files += "${prefix}/include/bt-service/bluetooth-telephony-api.h"
185 bluetooth-frwk-dev_files += "${prefix}/include/bt-service/bluetooth-media-control.h"
186 bluetooth-frwk-dev_files += "${prefix}/lib/pkgconfig/bluetooth-api.pc"
187 bluetooth-frwk-dev_files += "${prefix}/lib/libbluetooth-api.so"
188 MANIFESTFILES_${PN}-dev = "bluetooth-frwk.manifest"
189
190 bluetooth-frwk-core_files = ""
191 bluetooth-frwk-core_files += "${prefix}/share/dbus-1/system-services/org.projectx.bt_core.service"
192 bluetooth-frwk-core_files += "${prefix}/bin/bt-core"
193 bluetooth-frwk-core_files += "${sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf"
194 MANIFESTFILES_${PN}-core = "bluetooth-frwk.manifest"
195
196 bluetooth-frwk-service_files = ""
197 bluetooth-frwk-service_files += "${prefix}/share/dbus-1/system-services/org.projectx.bt.service"
198 bluetooth-frwk-service_files += "${prefix}/bin/bt-service"
199 bluetooth-frwk-service_files += "${prefix}/lib/systemd/user/bluetooth-frwk-service.service"
200 bluetooth-frwk-service_files += "/opt/var/lib/bluetooth/auto-pair-blacklist"
201 bluetooth-frwk-service_files += "${sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf"
202 bluetooth-frwk-service_files += "${prefix}/share/icons/default/bt-icon.png"
203 MANIFESTFILES_${PN}-service = "bluetooth-frwk.manifest"
204
205 bluetooth-frwk_files = ""
206 bluetooth-frwk_files += "${prefix}/lib/libbluetooth-api.so.*"
207 MANIFESTFILES_${PN} = "bluetooth-frwk.manifest"
208
209 FILES_${PN}-dev = "${bluetooth-frwk-dev_files}"
210 FILES_${PN}-core = "${bluetooth-frwk-core_files}"
211 FILES_${PN}-service = "${bluetooth-frwk-service_files}"
212 FILES_${PN} = "${bluetooth-frwk_files}"
213
214 PKG_bluetooth-frwk-dev= "bluetooth-frwk-dev"
215 PKG_bluetooth-frwk-core= "bluetooth-frwk-core"
216 PKG_bluetooth-frwk-service= "bluetooth-frwk-service"
217 PKG_bluetooth-frwk= "bluetooth-frwk"
218
219 require bluetooth-frwk-extraconf.inc
220