59e39ba595f4a8e0501aadd52a592bc73c31086c
[scm/bb/meta-tizen.git] / meta-tizen-common-base / recipes-connectivity / bluetooth-tools / bluetooth-tools.inc
1 DESCRIPTION = "Bluetooth-tools"
2 HOMEPAGE = "http://nohomepage.org"
3 SECTION = "Network & Connectivity/Bluetooth"
4 LICENSE = "Apache-2.0"
5 PV = "0.2.35"
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-tools-no-firmware
17 PROVIDES += "bluetooth-tools-no-firmware"
18
19
20 #PROVIDES by bluetooth-tools
21
22
23 RDEPENDS = ""
24 #RDEPENDS of bluetooth-tools-no-firmware (${PN}-no-firmware)
25 RDEPENDS_${PN}-no-firmware += "bluetooth-tools"
26 RDEPENDS_${PN}-no-firmware += "rfkill"
27
28 #RDEPENDS of bluetooth-tools (${PN})
29 RDEPENDS_${PN} += "tizen-platform-config-tools"
30
31
32 DEPENDS = ""
33 #DEPENDS of bluetooth-tools
34 inherit tizen_cmake
35
36 do_prep() {
37  cd ${S}
38  chmod -Rf a+rX,u+w,g-w,o-w ${S}
39  #setup -q
40  
41  
42 }
43 do_patch_append() {
44     bb.build.exec_func('do_prep', d)
45 }
46
47 do_configure() {
48 }
49
50 do_compile() {
51  cd ${S}
52  LANG=C
53  export LANG
54  unset DISPLAY
55  LD_AS_NEEDED=1; export LD_AS_NEEDED ;
56  
57  export CFLAGS="${CFLAGS} -fpie -fvisibility=hidden"
58  export LDFLAGS="${LDFLAGS} -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
59  
60  
61    cmake \
62          -DCMAKE_VERBOSE_MAKEFILE=ON \
63          -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
64          -DCMAKE_INSTALL_LIBDIR:PATH=${prefix}/lib \
65          -DINCLUDE_INSTALL_DIR:PATH=${prefix}/include \
66          -DLIB_INSTALL_DIR:PATH=${prefix}/lib \
67          -DSYSCONF_INSTALL_DIR:PATH=${sysconfdir} \
68          -DSHARE_INSTALL_PREFIX:PATH=${prefix}/share \
69          -DCMAKE_SKIP_RPATH:BOOL=ON \
70          -DBUILD_SHARED_LIBS:BOOL=ON \
71          -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake \
72          ${EXTRA_OECMAKE} . -DCMAKE_INSTALL_PREFIX=${prefix}
73  oe_runmake ${PARALLEL_MAKE}
74  
75  
76  
77 }
78
79 do_install() {
80  export RPM_BUILD_ROOT=${D}
81  cd ${S}
82  LANG=C
83  export LANG
84  unset DISPLAY
85  rm -rf ${D}
86  mkdir -p ${D}
87  
88  rm -rf ${D}
89  
90    oe_runmake \
91          DESTDIR=${D} \
92          INSTALL_ROOT=${D} \
93          BINDIR=${prefix}/bin \
94    install  
95    rm -f ${D}${infodir}/dir 
96    find ${D} -regex ".*\.la$" | xargs rm -f -- 
97    find ${D} -regex ".*\.a$" | xargs rm -f --
98  
99  mkdir -p ${D}${sysconfdir}/rc.d/rc3.d
100  mkdir -p ${D}${sysconfdir}/rc.d/rc5.d
101  ln -s ${sysconfdir}/rc.d/init.d/bluetooth-address ${D}${sysconfdir}/rc.d/rc3.d/S60bluetooth-address
102  ln -s ${sysconfdir}/rc.d/init.d/bluetooth-address ${D}${sysconfdir}/rc.d/rc5.d/S60bluetooth-address
103  
104  mkdir -p ${D}${systemd_unitdir}/system/multi-user.target.wants
105  install -m 0644 ${S}/packaging/bluetooth-address.service ${D}${systemd_unitdir}/system
106  ln -s ../bluetooth-address.service ${D}${systemd_unitdir}/system/multi-user.target.wants/bluetooth-address.service
107  
108  mkdir -p ${D}${prefix}/etc/bluetooth/
109  install -m 0755 scripts/bt-dev-start.sh ${D}${prefix}/etc/bluetooth/bt-dev-start.sh
110  install -m 0755 scripts/bt-dev-end.sh ${D}${prefix}/etc/bluetooth/bt-dev-end.sh
111  
112  
113 }
114
115 PACKAGES = "${PN}-dbg ${PN}-doc ${PN}-locale"
116 PACKAGES += " bluetooth-tools-no-firmware "
117 PACKAGES += " bluetooth-tools "
118
119 bluetooth-tools-no-firmware_files = ""
120 bluetooth-tools-no-firmware_files += "${prefix}/etc/bluetooth/bt-dev-end.sh"
121 bluetooth-tools-no-firmware_files += "${prefix}/etc/bluetooth/bt-dev-start.sh"
122 MANIFESTFILES_${PN}-no-firmware = "bluetooth-tools.manifest"
123
124 bluetooth-tools_files = ""
125 bluetooth-tools_files += "${sysconfdir}/rc.d/init.d/bluetooth-address"
126 bluetooth-tools_files += "${sysconfdir}/rc.d/rc3.d/S60bluetooth-address"
127 bluetooth-tools_files += "${sysconfdir}/rc.d/rc5.d/S60bluetooth-address"
128 bluetooth-tools_files += "${prefix}/etc/bluetooth/bt-stack-up.sh"
129 bluetooth-tools_files += "${prefix}/etc/bluetooth/bt-stack-down.sh"
130 bluetooth-tools_files += "${prefix}/etc/bluetooth/bt-reset-env.sh"
131 bluetooth-tools_files += "${prefix}/etc/bluetooth/bt-edutm-on.sh"
132 bluetooth-tools_files += "${prefix}/etc/bluetooth/bt-edutm-dev-up.sh"
133 bluetooth-tools_files += "${prefix}/etc/bluetooth/bt-edutm-mode-on.sh"
134 bluetooth-tools_files += "${prefix}/etc/bluetooth/bt-edutm-off.sh"
135 bluetooth-tools_files += "${systemd_unitdir}/system/multi-user.target.wants/bluetooth-address.service"
136 bluetooth-tools_files += "${systemd_unitdir}/system/bluetooth-address.service"
137 MANIFESTFILES_${PN} = "bluetooth-tools.manifest"
138
139 FILES_${PN}-no-firmware = "${bluetooth-tools-no-firmware_files}"
140 FILES_${PN} = "${bluetooth-tools_files}"
141
142 PKG_bluetooth-tools-no-firmware= "bluetooth-tools-no-firmware"
143 PKG_bluetooth-tools= "bluetooth-tools"
144
145 require bluetooth-tools-extraconf.inc
146