Tizen recipes : Fix tizen common build and get little more closer to current Tizen...
[scm/bb/meta-tizen.git] / meta-tizen-common-base / recipes-application-framework / ail / ail.inc
1 DESCRIPTION = "Application Information Library"
2 HOMEPAGE = "http://nohomepage.org"
3 SECTION = "Application Framework/Libraries"
4 LICENSE = "Apache-2.0"
5 PV = "0.2.80"
6
7 SRC_URI = ""
8
9 S = "${WORKDIR}/git"
10
11 inherit manifest autotools-brokensep
12
13 BBCLASSEXTEND = ""
14 PROVIDES = ""
15
16 #PROVIDES by ail
17 # the PROVIDES rules is ignore "libail = 0.2.80-0"
18 PROVIDES += "libail"
19 RPROVIDES_ail += "libail"
20
21
22 #PROVIDES by ail-dev
23 PROVIDES += "ail-dev"
24
25
26 #PROVIDES by ail-vconf-dev
27 PROVIDES += "ail-vconf-dev"
28
29
30 RDEPENDS = ""
31 #RDEPENDS of ail-dev (${PN}-dev)
32 RDEPENDS_${PN}-dev += "tizen-platform-config"
33 RDEPENDS_${PN}-dev += "libail"
34 RDEPENDS_${PN}-dev += "smack"
35
36 #RDEPENDS of ail-vconf-dev (${PN}-vconf-dev)
37 RDEPENDS_${PN}-vconf-dev += "libail"
38
39
40 DEPENDS = ""
41 #DEPENDS of ail
42 inherit tizen_cmake
43 DEPENDS += "tizen-platform-config"
44 inherit pkgconfig
45 DEPENDS += "dlog"
46 DEPENDS += "smack"
47 DEPENDS += "sqlite3"
48 DEPENDS += "xdgmime"
49 DEPENDS += "vconf"
50 DEPENDS += "libslp-db-util"
51
52 do_prep() {
53  cd ${S}
54  chmod -Rf a+rX,u+w,g-w,o-w ${S}
55  #setup -q
56  cp ${S}/packaging/ail.manifest .
57  
58  
59 }
60 do_patch_append() {
61     bb.build.exec_func('do_prep', d)
62 }
63
64 do_configure() {
65 }
66
67 do_compile() {
68  cd ${S}
69  LANG=C
70  export LANG
71  unset DISPLAY
72  LD_AS_NEEDED=1; export LD_AS_NEEDED ;
73  
74  CFLAGS="$CFLAGS -fpic"
75  
76  
77  
78    cmake \
79          -DCMAKE_VERBOSE_MAKEFILE=ON \
80          -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
81          -DCMAKE_INSTALL_LIBDIR:PATH=${prefix}/lib \
82          -DINCLUDE_INSTALL_DIR:PATH=${prefix}/include \
83          -DLIB_INSTALL_DIR:PATH=${prefix}/lib \
84          -DSYSCONF_INSTALL_DIR:PATH=${sysconfdir} \
85          -DSHARE_INSTALL_PREFIX:PATH=${prefix}/share \
86          -DCMAKE_SKIP_RPATH:BOOL=ON \
87          -DBUILD_SHARED_LIBS:BOOL=ON \
88          -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake \
89          ${EXTRA_OECMAKE} .  -DTZ_SYS_RW_DESKTOP_APP=${prefix}/share/applications \
90            -DBUILD_PKGTYPE=rpm
91  
92  oe_runmake -j16
93  
94  
95  
96 }
97
98 do_install() {
99  export RPM_BUILD_ROOT=${D}
100  cd ${S}
101  LANG=C
102  export LANG
103  unset DISPLAY
104  rm -rf ${D}
105  mkdir -p ${D}
106  
107  
108    oe_runmake \
109          DESTDIR=${D} \
110          INSTALL_ROOT=${D} \
111          BINDIR=${prefix}/bin \
112    install  
113    rm -f ${D}${infodir}/dir 
114    find ${D} -regex ".*\.la$" | xargs rm -f -- 
115    find ${D} -regex ".*\.a$" | xargs rm -f --
116  
117  
118 }
119
120 pkg_postinst_${PN}() {
121     #!/bin/sh -e
122
123     ldconfig
124     # Create tizenglobalapp user needed for global installation
125     useradd -d $D${prefix}/apps -m tizenglobalapp -r -c "system user for common applications" -g root
126     #mkdir -p %TZ_SYS_RW_APP/.config/xwalk-service/applications
127     #cd %TZ_SYS_RW_APP/
128     #ln -s .config/xwalk-service/applications/
129     vconftool set -t string db/ail/ail_info "0" -f -s User
130     vconftool set -t string db/menuscreen/desktop "0" -f -s User
131     vconftool set -t string db/menu_widget/language "en_US.utf8" -f -s User
132     mkdir -p $D${prefix}/share/applications
133     mkdir -p $D${prefix}/share/applications
134     mkdir -p $D${prefix}/apps
135     mkdir -p $D${prefix}/dbspace
136     mkdir -p $D${prefix}/share/icons/default/small
137     chsmack -a '*' $D${prefix}/dbspace
138     chsmack -a '*' $D${prefix}/apps
139     chsmack -a '*' $D${prefix}/share/applications
140     chsmack -a '*' $D${prefix}/share/applications
141     chsmack -a '*' $D${prefix}/share/icons
142     chsmack -a '*' $D${prefix}/share/icons/default
143     chsmack -a '*' $D${prefix}/share/icons/default/small/
144     chmod g+w $D${prefix}/share/applications
145     chmod g+w $D${prefix}/share/applications
146     chown tizenglobalapp:root $D${prefix}/share/applications
147     chown tizenglobalapp:root $D${prefix}/share/applications
148     chown tizenglobalapp:root $D${prefix}/apps
149     chown tizenglobalapp:root $D${prefix}/dbspace
150     chown tizenglobalapp:root $D${prefix}/dbspace
151     chown tizenglobalapp:root -R $D${prefix}/share/icons
152     ail_createdb 2>/dev/null
153     ail_syncdb 2>/dev/null
154     chsmack -a '*' $D${prefix}/dbspace/.app_info.db*
155      
156
157 }
158
159 pkg_postrm_${PN}() {
160     #!/bin/sh -e
161
162     [ "x$D" == "x" ] && ldconfig
163     if [ $1 == 0 ]; then
164         rm -f $D${prefix}/dbspace/.app_info.db*
165     fi
166
167 }
168
169 PACKAGES = "${PN}-dbg ${PN}-doc ${PN}-locale"
170 PACKAGES += " ail "
171 PACKAGES += " ail-dev "
172 PACKAGES += " ail-vconf-dev "
173
174 ail_files = ""
175 ail_files += "${prefix}/bin/ail_createdb"
176 ail_files += "${prefix}/bin/ail_createdb_user"
177 ail_files += "${prefix}/bin/ail_syncdb"
178 ail_files += "${prefix}/bin/ail_syncdb_user"
179 ail_files += "${prefix}/bin/ail_initdb"
180 ail_files += "${prefix}/bin/ail_initdb_user"
181 ail_files += "${prefix}/bin/ail_fota"
182 ail_files += "${prefix}/bin/ail_desktop"
183 ail_files += "${prefix}/bin/ail_filter"
184 ail_files += "${prefix}/bin/ail_list"
185 ail_files += "${prefix}/bin/ail_package"
186 ail_files += "${prefix}/share/install-info/*"
187 ail_files += "${prefix}/lib/libail.so.0"
188 ail_files += "${prefix}/lib/libail.so.0.1.0"
189 MANIFESTFILES_${PN} = "ail.manifest"
190
191 ail-dev_files = ""
192 ail-dev_files += "${prefix}/include/ail.h"
193 ail-dev_files += "${prefix}/lib/libail.so"
194 ail-dev_files += "${prefix}/lib/pkgconfig/ail.pc"
195 MANIFESTFILES_${PN}-dev = "ail.manifest"
196
197 ail-vconf-dev_files = ""
198 ail-vconf-dev_files += "${prefix}/include/ail_vconf.h"
199
200 FILES_${PN} = "${ail_files}"
201 FILES_${PN}-dev = "${ail-dev_files}"
202 FILES_${PN}-vconf-dev = "${ail-vconf-dev_files}"
203
204 PKG_ail= "ail"
205 PKG_ail-dev= "ail-dev"
206 PKG_ail-vconf-dev= "ail-vconf-dev"
207
208 require ail-extraconf.inc
209