ail: Prevent running ldconfig if not on system
[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 useradd
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
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     [ "" != "$D" ] || ldconfig
124     # Create tizenglobalapp user needed for global installation
125     #mkdir -p %TZ_SYS_RW_APP/.config/xwalk-service/applications
126     #cd %TZ_SYS_RW_APP/
127     #ln -s .config/xwalk-service/applications/
128     vconftool set -t string db/ail/ail_info "0" -f -s User
129     vconftool set -t string db/menuscreen/desktop "0" -f -s User
130     vconftool set -t string db/menu_widget/language "en_US.utf8" -f -s User
131     mkdir -p $D${prefix}/share/applications
132     mkdir -p $D${prefix}/share/applications
133     mkdir -p $D${prefix}/apps
134     mkdir -p $D${prefix}/dbspace
135     mkdir -p $D${prefix}/share/icons/default/small
136     chsmack -a '*' $D${prefix}/dbspace
137     chsmack -a '*' $D${prefix}/apps
138     chsmack -a '*' $D${prefix}/share/applications
139     chsmack -a '*' $D${prefix}/share/applications
140     chsmack -a '*' $D${prefix}/share/icons
141     chsmack -a '*' $D${prefix}/share/icons/default
142     chsmack -a '*' $D${prefix}/share/icons/default/small/
143     chmod g+w $D${prefix}/share/applications
144     chmod g+w $D${prefix}/share/applications
145     chown 9998:root $D${prefix}/share/applications
146     chown 9998:root $D${prefix}/share/applications
147     chown 9998:root $D${prefix}/apps
148     chown 9998:root $D${prefix}/dbspace
149     chown 9998:root $D${prefix}/dbspace
150     chown 9998:root -R $D${prefix}/share/icons
151     ail_createdb 2>/dev/null
152     chsmack -a '*' $D${prefix}/dbspace/.app_info.db*
153      
154
155 }
156
157 pkg_postrm_${PN}() {
158     #!/bin/sh -e
159
160     [ "" != "$D" ] || ldconfig
161
162     if [ $1 == 0 ]; then
163         rm -f $D${prefix}/dbspace/.app_info.db*
164     fi
165
166 }
167
168 PACKAGES = "${PN}-dbg ${PN}-doc ${PN}-locale"
169 PACKAGES += " ail "
170 PACKAGES += " ail-dev "
171 PACKAGES += " ail-vconf-dev "
172
173 ail_files = ""
174 ail_files += "${prefix}/bin/ail_createdb"
175 ail_files += "${prefix}/bin/ail_createdb_user"
176 ail_files += "${prefix}/bin/ail_syncdb"
177 ail_files += "${prefix}/bin/ail_syncdb_user"
178 ail_files += "${prefix}/bin/ail_initdb"
179 ail_files += "${prefix}/bin/ail_initdb_user"
180 ail_files += "${prefix}/bin/ail_fota"
181 ail_files += "${prefix}/bin/ail_desktop"
182 ail_files += "${prefix}/bin/ail_filter"
183 ail_files += "${prefix}/bin/ail_list"
184 ail_files += "${prefix}/bin/ail_package"
185 ail_files += "${prefix}/share/install-info/*"
186 ail_files += "${prefix}/lib/libail.so.0"
187 ail_files += "${prefix}/lib/libail.so.0.1.0"
188 MANIFESTFILES_${PN} = "ail.manifest"
189
190 ail-dev_files = ""
191 ail-dev_files += "${prefix}/include/ail.h"
192 ail-dev_files += "${prefix}/lib/libail.so"
193 ail-dev_files += "${prefix}/lib/pkgconfig/ail.pc"
194 MANIFESTFILES_${PN}-dev = "ail.manifest"
195
196 ail-vconf-dev_files = ""
197 ail-vconf-dev_files += "${prefix}/include/ail_vconf.h"
198
199 FILES_${PN} = "${ail_files}"
200 FILES_${PN}-dev = "${ail-dev_files}"
201 FILES_${PN}-vconf-dev = "${ail-vconf-dev_files}"
202
203 PKG_ail= "ail"
204 PKG_ail-dev= "ail-dev"
205 PKG_ail-vconf-dev= "ail-vconf-dev"
206
207 require ail-extraconf.inc
208
209 USERADD_PACKAGES = "ail"
210
211 USERADD_PARAM_${PN} = "   -u 9998  -m  -d ${prefix}/apps -r  -c 'system user for common applications' -g users tizenglobalapp"
212
213