Update according to the actual Q1 tizen common release
[scm/bb/meta-tizen.git] / meta-tizen-common-base / recipes-connectivity / nfc-manager-neard / nfc-manager-neard.inc
1 DESCRIPTION = "NFC framework manager"
2 HOMEPAGE = "http://nohomepage.org"
3 SECTION = "Network & Connectivity/NFC"
4 LICENSE = "Apache-2.0"
5 PV = "0.1.6"
6
7 SRC_URI = ""
8
9 S = "${WORKDIR}/git"
10
11 inherit manifest autotools-brokensep
12
13 BBCLASSEXTEND = ""
14 PROVIDES = ""
15
16 #PROVIDES by nfc-common-neard-dev
17 PROVIDES += "nfc-common-neard-dev"
18
19
20 #PROVIDES by nfc-client-lib-neard
21 PROVIDES += "nfc-client-lib-neard"
22
23
24 #PROVIDES by nfc-manager-neard
25
26
27 #PROVIDES by nfc-client-lib-neard-dev
28 PROVIDES += "nfc-client-lib-neard-dev"
29
30
31 RDEPENDS = ""
32 #RDEPENDS of nfc-client-lib-neard-dev (nfc-client-lib-neard-dev)
33 RDEPENDS_nfc-client-lib-neard-dev += "nfc-client-lib-neard"
34
35 #RDEPENDS of nfc-manager-neard (${PN})
36 RDEPENDS_${PN} += "neardal"
37 RDEPENDS_${PN} += "neard"
38 RDEPENDS_${PN} += "glibc"
39 RDEPENDS_${PN} += "nfc-client-lib-neard"
40 RDEPENDS_${PN} += "vconf"
41
42
43 DEPENDS = ""
44 #DEPENDS of nfc-manager-neard
45 DEPENDS += "pkgmgr"
46 DEPENDS += "security-server"
47 DEPENDS += "aul"
48 DEPENDS += "capi-network-bluetooth"
49 DEPENDS += "dlog"
50 DEPENDS += "curl"
51 inherit tizen_cmake
52 DEPENDS += "capi-network-wifi"
53 DEPENDS += "app-svc"
54 inherit pkgconfig
55 DEPENDS += "capi-media-wav-player"
56 DEPENDS += "glib-2.0"
57 DEPENDS += "deviced"
58 inherit pythonnative
59 DEPENDS += "libsvi"
60 DEPENDS += "tizen-platform-config"
61 #Replace "DEPENDS" on gettext by "inherit gettext"
62 inherit gettext
63 DEPENDS += "pkgmgr-info"
64 DEPENDS += "libtapi"
65 DEPENDS += "python-xml"
66 DEPENDS += "ecore"
67 DEPENDS += "vconf"
68 DEPENDS += "libmm-sound"
69 DEPENDS += "openssl"
70 DEPENDS += "neardal"
71
72 do_prep() {
73  cd ${S}
74  chmod -Rf a+rX,u+w,g-w,o-w ${S}
75  #setup -q
76  cp ${S}/packaging/nfc-manager-neard.manifest .
77  
78  
79 }
80 do_patch_append() {
81     bb.build.exec_func('do_prep', d)
82 }
83
84 do_configure() {
85 }
86
87 do_compile() {
88  cd ${S}
89  LANG=C
90  export LANG
91  unset DISPLAY
92  LD_AS_NEEDED=1; export LD_AS_NEEDED ;
93  
94  MAJORVER=`echo 0.1.6 | awk 'BEGIN {FS="."}{print $1}'`
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} . -DMAJORVER=${MAJORVER} -DFULLVER=0.1.6  \
108  -DWAYLAND_SUPPORT=On \
109  -DX11_SUPPORT=Off
110  
111  
112  
113  
114 }
115
116 do_install() {
117  export RPM_BUILD_ROOT=${D}
118  cd ${S}
119  LANG=C
120  export LANG
121  unset DISPLAY
122  rm -rf ${D}
123  mkdir -p ${D}
124  
125  
126    oe_runmake \
127          DESTDIR=${D} \
128          INSTALL_ROOT=${D} \
129          BINDIR=${prefix}/bin \
130    install  
131    rm -f ${D}${infodir}/dir 
132    find ${D} -regex ".*\.la$" | xargs rm -f -- 
133    find ${D} -regex ".*\.a$" | xargs rm -f --
134  
135  install -d ${D}${systemd_unitdir}/system
136  install -d ${D}${systemd_unitdir}/system/multi-user.target.wants/
137  install -m 644 ${S}/packaging/nfc-manager-neard.service ${D}${systemd_unitdir}/system/nfc-manager-neard.service
138  ln -s ../nfc-manager-neard.service ${D}${systemd_unitdir}/system/multi-user.target.wants/nfc-manager-neard.service
139  
140  
141 }
142
143 pkg_postinst_nfc-client-lib-neard() {
144     #!/bin/sh -e
145
146     [ "x$D" == "x" ] && ldconfig
147     USER_GROUP_ID=$(getent group users | cut -d: -f3)
148     vconftool set -t bool db/nfc/feature 0 -g $USER_GROUP_ID -f
149     vconftool set -t bool db/nfc/predefined_item_state 0 -g $USER_GROUP_ID -f
150     vconftool set -t string db/nfc/predefined_item "None" -g $USER_GROUP_ID -f
151     vconftool set -t bool db/nfc/enable 0 -g $USER_GROUP_ID -f
152     vconftool set -t int db/nfc/se_type 0 -g $USER_GROUP_ID -f
153
154 }
155
156 pkg_postinst_${PN}() {
157     #!/bin/sh -e
158
159     [ "x$D" == "x" ] && ldconfig
160     systemctl daemon-reload
161     if [ $1 == 1 ]; then
162         systemctl restart nfc-manager-neard.service
163     fi
164
165 }
166
167 pkg_postrm_${PN}() {
168     #!/bin/sh -e
169
170     [ "x$D" == "x" ] && ldconfig
171     if [ $1 == 0 ]; then
172         systemctl stop nfc-manager-neard.service
173     fi
174     systemctl daemon-reload
175
176 }
177
178 pkg_postrm_nfc-client-lib-neard() {
179     #!/bin/sh -e
180
181     [ "x$D" == "x" ] && ldconfig
182 }
183
184 PACKAGES = "${PN}-dbg ${PN}-doc ${PN}-locale"
185 PACKAGES += " nfc-client-lib-neard "
186 PACKAGES += " nfc-client-lib-neard-dev "
187 PACKAGES += " nfc-manager-neard "
188 PACKAGES += " nfc-common-neard-dev "
189
190 nfc-client-lib-neard_files = ""
191 nfc-client-lib-neard_files += "${prefix}/lib/libnfc.so.*"
192 MANIFESTFILES_nfc-client-lib-neard = "nfc-manager-neard.manifest"
193
194 nfc-client-lib-neard-dev_files = ""
195 nfc-client-lib-neard-dev_files += "${prefix}/lib/libnfc.so"
196 nfc-client-lib-neard-dev_files += "${prefix}/lib/pkgconfig/nfc.pc"
197 nfc-client-lib-neard-dev_files += "${prefix}/include/nfc/*.h"
198
199 nfc-manager-neard_files = ""
200 nfc-manager-neard_files += "${prefix}/bin/nfc-manager-daemon"
201 nfc-manager-neard_files += "${systemd_unitdir}/system/nfc-manager-neard.service"
202 nfc-manager-neard_files += "${systemd_unitdir}/system/multi-user.target.wants/nfc-manager-neard.service"
203 nfc-manager-neard_files += "${prefix}/share/dbus-1/system-services/org.tizen.NetNfcService.service"
204 nfc-manager-neard_files += "${prefix}/share/packages/nfc-manager.xml"
205 nfc-manager-neard_files += "${prefix}/share/nfc-manager-daemon/sounds/*"
206 MANIFESTFILES_${PN} = "nfc-manager-neard.manifest"
207
208 nfc-common-neard-dev_files = ""
209 nfc-common-neard-dev_files += "${prefix}/lib/pkgconfig/nfc-common.pc"
210 nfc-common-neard-dev_files += "${prefix}/include/nfc-common/*.h"
211
212 FILES_nfc-client-lib-neard = "${nfc-client-lib-neard_files}"
213 FILES_nfc-client-lib-neard-dev = "${nfc-client-lib-neard-dev_files}"
214 FILES_${PN} = "${nfc-manager-neard_files}"
215 FILES_nfc-common-neard-dev = "${nfc-common-neard-dev_files}"
216
217 PKG_nfc-client-lib-neard= "nfc-client-lib-neard"
218 PKG_nfc-client-lib-neard-dev= "nfc-client-lib-neard-dev"
219 PKG_nfc-manager-neard= "nfc-manager-neard"
220 PKG_nfc-common-neard-dev= "nfc-common-neard-dev"
221
222 require nfc-manager-neard-extraconf.inc
223