first commit
[scm/bb/meta-tizen.git] / recipes-tizen / bluez / bluez.inc
1 DESCRIPTION = "Bluetooth Stack for Linux"
2 HOMEPAGE = "http://www.bluez.org"
3 SECTION = "Network & Connectivity/Bluetooth"
4 LICENSE = "GPL-2.0+"
5
6 SRC_URI = ""
7
8 S = "${WORKDIR}/git"
9
10 PROVIDES = ""
11
12 #PROVIDES by bluez-docs  
13 PROVIDES += "bluez-docs "
14 RPROVIDES_bluez-docs  += "bluez-docs "
15
16 #PROVIDES by bluez-devel 
17 PROVIDES += "bluez-devel"
18 RPROVIDES_bluez-devel += "bluez-devel"
19 RPROVIDES_bluez-devel += "bluez-dev"
20
21 #PROVIDES by obexd 
22 PROVIDES += "obexd"
23 RPROVIDES_obexd += "obexd"
24
25 #PROVIDES by bluez 
26 PROVIDES += "bluez"
27 RPROVIDES_bluez += "bluez"
28
29 #PROVIDES by bluez-test 
30 PROVIDES += "bluez-test"
31 RPROVIDES_bluez-test += "bluez-test"
32
33 #PROVIDES by libbluetooth 
34 PROVIDES += "libbluetooth"
35 RPROVIDES_libbluetooth += "libbluetooth"
36
37 #PROVIDES by bluez-cups 
38 PROVIDES += "bluez-cups"
39 RPROVIDES_bluez-cups += "bluez-cups"
40
41 RDEPENDS = ""
42 #RDEPENDS of bluez-devel (${PN}-devel)
43 RDEPENDS_${PN}-devel += "libbluetooth"
44
45 #RDEPENDS of obexd (obexd)
46 RDEPENDS_obexd += "tizen-platform-config-tools"
47
48 #RDEPENDS of bluez (${PN})
49 RDEPENDS_${PN} += "systemd"
50
51 #RDEPENDS of bluez-test (${PN}-test)
52 RDEPENDS_${PN}-test += "libbluetooth"
53 RDEPENDS_${PN}-test += "dbus-python"
54 RDEPENDS_${PN}-test += "python-gobject"
55
56 #RDEPENDS of bluez-cups (${PN}-cups)
57 RDEPENDS_${PN}-cups += "libbluetooth"
58
59
60 DEPENDS = ""
61 #DEPENDS of bluez 
62 DEPENDS += "flex"
63 DEPENDS += "systemd"
64 DEPENDS += "pkgconfig(alsa)"
65 DEPENDS += "pkgconfig-native"
66 DEPENDS += "check-devel"
67 DEPENDS += "pkgconfig(dbus-1)"
68 DEPENDS += "pkgconfig(libnl-1)"
69 DEPENDS += "libsndfile-devel"
70 DEPENDS += "udev"
71 DEPENDS += "automake-native"
72 DEPENDS += "libcap-ng-devel"
73 DEPENDS += "libtool-cross"
74 DEPENDS += "libusb-devel"
75 DEPENDS += "libudev-devel"
76 DEPENDS += "glib2-devel"
77 DEPENDS += "libical-devel"
78 DEPENDS += "readline-devel"
79
80 do_patch() {
81  chmod -Rf a+rX,u+w,g-w,o-w ${S}
82  #setup -q
83  cp ${S}/packaging/bluez.manifest .
84  
85  
86 }
87
88 do_configure() {
89 }
90
91 do_compile() {
92  LANG=C
93  export LANG
94  unset DISPLAY
95  CFLAGS="-O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables" ; export CFLAGS ; 
96  CXXFLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CXXFLAGS ; 
97  FFLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -I%_fmoddir}" ; export FFLAGS ; 
98  LD_AS_NEEDED=1; export LD_AS_NEEDED ; 
99  
100  autoreconf -fiv
101  
102  export CFLAGS="${CFLAGS} -D__TIZEN_PATCH__"
103  
104    CFLAGS="${CFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CFLAGS ; 
105    CXXFLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CXXFLAGS ; 
106    FFLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -I%_fmoddir}" ; export FFLAGS ; 
107    autotools_do_configure --build=${TARGET_SYS} --host=${HOST_SYS} \
108          --target=x86_64-tizen-linux \
109          --program-prefix= \
110          --prefix=/usr \
111          --exec-prefix=/usr \
112          --bindir=/usr/bin \
113          --sbindir=/usr/sbin \
114          --sysconfdir=/etc \
115          --datadir=/usr/share \
116          --includedir=/usr/include \
117          --libdir=/usr/lib \
118          --libexecdir=/usr/libexec \
119          --localstatedir=/var \
120          --sharedstatedir=/usr/com \
121          --mandir=/usr/share/man \
122          --infodir=/usr/share/info  --with-pic \
123              --libexecdir=/lib \
124              --disable-usb      \
125              --enable-test      \
126              --enable-library   \
127              --enable-experimental      \
128              --enable-readline  \
129              --with-systemdunitdir=/lib/systemd/system  \
130              --enable-capng
131  make -j16 all V=1
132  
133  exit 0
134  make check
135  
136  
137  
138 }
139
140 do_install() {
141  echo export RPM_BUILD_ROOT=${D}
142  LANG=C
143  export LANG
144  unset DISPLAY
145  rm -rf ${D} 
146  mkdir -p ${D} 
147  
148  
149    oe_runmake \
150          DESTDIR=${D} \
151          INSTALL_ROOT=${D} \
152          BINDIR=/usr/bin \
153    install  
154    rm -f ${D}/usr/share/info/dir 
155    find ${D} -regex ".*\.la$" | xargs rm -f -- 
156    find ${D} -regex ".*\.a$" | xargs rm -f --
157  
158  rm -rvf $RPM_BUILD_ROOT//usr/lib/gstreamer-*
159  install --mode=0755 -D ${S}/packaging/bluetooth.sh $RPM_BUILD_ROOT/usr/lib/udev/bluetooth.sh
160  install --mode=0644 -D ${S}/packaging/bluetooth.modprobe $RPM_BUILD_ROOT//etc/modprobe.d/50-bluetooth.conf
161  if ! test -e ${D}/usr/lib/cups/backend/bluetooth
162  then if test -e ${D}/usr/lib/cups/backend/bluetooth
163       then mkdir -p ${D}/usr/lib/cups/backend
164            mv ${D}/usr/lib/cups/backend/bluetooth ${D}/usr/lib/cups/backend/bluetooth
165       fi
166  fi
167  # no idea why this is suddenly necessary...
168  install --mode 0755 -d $RPM_BUILD_ROOT/var/lib/bluetooth
169  
170  install -D -m 0755 ${S}/packaging/obex-root-setup ${D}/usr/bin/obex-root-setup
171  install -D -m 0755 ${S}/packaging/create-symlinks ${D}/etc/obex/root-setup.d/000_create-symlinks
172  install -D -m 0755 tools/btiotest $RPM_BUILD_ROOT//usr/bin/
173  install -D -m 0755 tools/bluetooth-player $RPM_BUILD_ROOT//usr/bin/
174  install -D -m 0755 tools/mpris-player $RPM_BUILD_ROOT//usr/bin/
175  install -D -m 0755 tools/btmgmt $RPM_BUILD_ROOT//usr/bin/
176  install -D -m 0755 tools/scotest $RPM_BUILD_ROOT//usr/bin/
177  
178  install -D -m 0755 tools/obexctl ${D}/usr/bin/obexctl
179  
180  
181 }
182
183 PACKAGES = ""
184 PACKAGES += "obexd"
185 PACKAGES += "bluez-docs"
186 PACKAGES += "bluez"
187 PACKAGES += "bluez-test"
188 PACKAGES += "libbluetooth"
189 PACKAGES += "bluez-devel"
190 PACKAGES += "bluez-cups"
191
192 obexd_files = ""
193 obexd_files += "/lib/bluetooth/obexd"
194 obexd_files += "/lib/systemd/user/obex.service"
195 obexd_files += "/usr/share/dbus-1/services/org.bluez.obex.service"
196 obexd_files += "/etc/obex/root-setup.d/000_create-symlinks"
197 obexd_files += "/usr/bin/obex-root-setup"
198
199 bluez-docs_files = ""
200 bluez-docs_files += "/usr/share/info"
201 bluez-docs_files += "/usr/share/man"
202
203 bluez_files = ""
204 bluez_files += "bluez.manifest"
205 bluez_files += "/usr/bin/hcitool"
206 bluez_files += "/usr/bin/l2ping"
207 bluez_files += "/usr/bin/obexctl"
208 bluez_files += "/usr/bin/rfcomm"
209 bluez_files += "/usr/bin/sdptool"
210 bluez_files += "/usr/bin/ciptool"
211 bluez_files += "/usr/bin/hciattach"
212 bluez_files += "/usr/bin/hciconfig"
213 bluez_files += "/lib/bluetooth/bluetoothd"
214 bluez_files += "/usr/bin/bccmd"
215 bluez_files += "/usr/lib/udev"
216 bluez_files += "/usr/lib/udev/*"
217 bluez_files += "/usr/share/dbus-1/system-services/org.bluez.service"
218 bluez_files += "/etc/dbus-1/system.d/bluetooth.conf"
219 bluez_files += "/var/lib/bluetooth"
220 bluez_files += "/etc/modprobe.d"
221 bluez_files += "/etc/modprobe.d/50-bluetooth.conf"
222 bluez_files += "/lib/systemd/system/bluetooth.service"
223
224 bluez-test_files = ""
225 bluez-test_files += "bluez.manifest"
226 bluez-test_files += "/usr/lib/bluez/test/*"
227 bluez-test_files += "/usr/bin/l2test"
228 bluez-test_files += "/usr/bin/rctest"
229 bluez-test_files += "/usr/bin/bluetoothctl"
230 bluez-test_files += "/usr/bin/btiotest"
231 bluez-test_files += "/usr/bin/mpris-player"
232 bluez-test_files += "/usr/bin/bluetooth-player"
233 bluez-test_files += "/usr/bin/btmon"
234 bluez-test_files += "/usr/bin/hcidump"
235 bluez-test_files += "/usr/bin/btmgmt"
236 bluez-test_files += "/usr/bin/scotest"
237
238 libbluetooth_files = ""
239 libbluetooth_files += "bluez.manifest"
240 libbluetooth_files += "/usr/lib/libbluetooth.so.*"
241
242 bluez-devel_files = ""
243 bluez-devel_files += "bluez.manifest"
244 bluez-devel_files += "/usr/include/bluetooth"
245 bluez-devel_files += "/usr/lib/libbluetooth.so"
246 bluez-devel_files += "/usr/lib/pkgconfig/bluez.pc"
247
248 bluez-cups_files = ""
249 bluez-cups_files += "bluez.manifest"
250 bluez-cups_files += "/usr/lib/cups"
251 bluez-cups_files += "/usr/lib/cups/backend"
252 bluez-cups_files += "/usr/lib/cups/backend/bluetooth"
253
254 FILES_obexd = "${obexd_files}"
255 FILES_${PN}-docs = "${bluez-docs_files}"
256 FILES_${PN} = "${bluez_files}"
257 FILES_${PN}-test = "${bluez-test_files}"
258 FILES_libbluetooth = "${libbluetooth_files}"
259 FILES_${PN}-devel = "${bluez-devel_files}"
260 FILES_${PN}-cups = "${bluez-cups_files}"
261
262 PKG_obexd= "obexd"
263 PKG_bluez-docs= "bluez-docs"
264 PKG_bluez= "bluez"
265 PKG_bluez-test= "bluez-test"
266 PKG_libbluetooth= "libbluetooth"
267 PKG_bluez-devel= "bluez-devel"
268 PKG_bluez-cups= "bluez-cups"
269
270 require bluez-extraconf.inc