build: Clone from git repo instead of gerrit
[scm/bb/meta-tizen.git] / meta-tizen-common-base / recipes-connectivity / download-provider / download-provider.inc
1 DESCRIPTION = "Download the contents in background"
2 HOMEPAGE = "http://nohomepage.org"
3 SECTION = "System/Libraries"
4 LICENSE = "Apache-2.0"
5 PV = "1.1.6"
6
7 SRC_URI = ""
8 SRC_URI += "file://0001-po-do-not-use-absolute-path-for-msgfmt.patch"
9
10 S = "${WORKDIR}/git"
11
12 inherit manifest autotools-brokensep
13
14 BBCLASSEXTEND = ""
15 PROVIDES = ""
16
17 #PROVIDES by download-provider
18
19
20 #PROVIDES by download-provider-dev
21 PROVIDES += "download-provider-dev"
22
23
24 RDEPENDS = ""
25 #RDEPENDS of download-provider (${PN})
26 RDEPENDS_${PN} += "sqlite3"
27 RDEPENDS_${PN} += "connman"
28 RDEPENDS_${PN} += "glibc"
29 RDEPENDS_${PN} += "vconf"
30 RDEPENDS_${PN} += "net-config"
31
32 #RDEPENDS of download-provider-dev (${PN}-dev)
33 RDEPENDS_${PN}-dev += "download-provider"
34
35
36 DEPENDS = ""
37 #DEPENDS of download-provider
38 DEPENDS += "dlog"
39 DEPENDS += "xdgmime"
40 DEPENDS += "systemd"
41 inherit tizen_cmake
42 DEPENDS += "notification"
43 DEPENDS += "app-svc"
44 inherit pkgconfig
45 #Replace "DEPENDS" on gettext by "inherit gettext"
46 inherit gettext
47 DEPENDS += "glib-2.0"
48 DEPENDS += "libsoup-2.4"
49 DEPENDS += "sqlite3"
50 DEPENDS += "libprivilege-control"
51 DEPENDS += "capi-appfw-app-manager"
52 DEPENDS += "tizen-platform-config"
53 DEPENDS += "bundle"
54 DEPENDS += "smack"
55 DEPENDS += "vconf"
56 DEPENDS += "libwifi-direct"
57 DEPENDS += "capi-network-connection"
58 DEPENDS_append_class-native = " fdupes-native"
59 DEPENDS_append_class-target = " fdupes-native"
60 DEPENDS += "capi-base-common"
61
62 do_prep() {
63  cd ${S}
64  chmod -Rf a+rX,u+w,g-w,o-w ${S}
65  #setup -q
66  
67  
68 }
69 do_patch_append() {
70     bb.build.exec_func('do_prep', d)
71 }
72
73 do_configure() {
74 }
75
76 do_compile() {
77  cd ${S}
78  LANG=C
79  export LANG
80  unset DISPLAY
81  LD_AS_NEEDED=1; export LD_AS_NEEDED ;
82  
83  
84  CFLAGS="${CFLAGS:-$CFLAGS} -fPIC -D_REENTRANT -fvisibility=hidden"; export CFLAGS
85  FFLAGS="${FFLAGS:-$CFLAGS} -fPIC -fvisibility=hidden"; export FFLAGS
86  LDFLAGS="${LDFLAGS} -Wl,--as-needed -Wl,--hash-style=both"; export LDFLAGS
87  
88  
89    cmake \
90          -DCMAKE_VERBOSE_MAKEFILE=ON \
91          -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
92          -DCMAKE_INSTALL_LIBDIR:PATH=${prefix}/lib \
93          -DINCLUDE_INSTALL_DIR:PATH=${prefix}/include \
94          -DLIB_INSTALL_DIR:PATH=${prefix}/lib \
95          -DSYSCONF_INSTALL_DIR:PATH=${sysconfdir} \
96          -DSHARE_INSTALL_PREFIX:PATH=${prefix}/share \
97          -DCMAKE_SKIP_RPATH:BOOL=ON \
98          -DBUILD_SHARED_LIBS:BOOL=ON \
99          -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake \
100          ${EXTRA_OECMAKE} . \
101           -DBIN_INSTALL_DIR:PATH=${prefix}/bin \
102           -DPKG_NAME=download-provider \
103           -DPKG_VERSION=1.1.6 \
104           -DPKG_RELEASE=0 \
105           -DIMAGE_DIR:PATH=${prefix}/share/download-provider/images \
106           -DLOCALE_DIR:PATH=${prefix}/share/locale \
107           -DSYSTEMD_DIR:PATH=${systemd_unitdir}/system \
108           -DDATABASE_SCHEMA_DIR=${prefix}/share/download-provider/sql \
109           -DDATABASE_SCHEMA_FILE=${prefix}/share/download-provider/sql/download-provider-schema.sql \
110           -DSUPPORT_WIFI_DIRECT:BOOL=OFF \
111           -DSUPPORT_LOG_MESSAGE:BOOL=ON \
112           -DSUPPORT_CHECK_IPC:BOOL=ON
113  
114  oe_runmake
115  
116  
117  
118 }
119
120 do_install() {
121  export RPM_BUILD_ROOT=${D}
122  cd ${S}
123  LANG=C
124  export LANG
125  unset DISPLAY
126  rm -rf ${D}
127  mkdir -p ${D}
128  
129  
130    oe_runmake \
131          DESTDIR=${D} \
132          INSTALL_ROOT=${D} \
133          BINDIR=${prefix}/bin \
134    install  
135    rm -f ${D}${infodir}/dir 
136    find ${D} -regex ".*\.la$" | xargs rm -f -- 
137    find ${D} -regex ".*\.a$" | xargs rm -f --
138  mkdir -p ${D}${prefix}/share/download-provider
139  mkdir -p ${D}${systemd_unitdir}/system/default.target.wants
140  mkdir -p ${D}${systemd_unitdir}/system/sockets.target.wants
141  ln -s ../download-provider.service ${D}${systemd_unitdir}/system/default.target.wants/
142  ln -s ../download-provider.socket ${D}${systemd_unitdir}/system/sockets.target.wants/
143  
144  #find_lang download-provider
145  
146  #fdupes ${D}${prefix}/share/locale
147  
148  
149 }
150
151 pkg_postinst_${PN}() {
152     #!/bin/sh -e
153
154     [ "x$D" == "x" ] && ldconfig
155     if [ $1 -eq 1 ] ; then 
156             # Initial installation 
157             /usr/bin/systemctl preset download-provider.service >/dev/null 2>&1 || : 
158     fi 
159     vconftool set -t int db/setting/default_memory/wap 0
160
161 }
162
163 pkg_prerm_${PN}() {
164     #!/bin/sh -e
165
166     if [ $1 -eq 0 ] ; then 
167             # Package removal, not upgrade 
168             /usr/bin/systemctl --no-reload disable download-provider.service > /dev/null 2>&1 || : 
169             /usr/bin/systemctl stop download-provider.service > /dev/null 2>&1 || : 
170     fi 
171
172 }
173
174 pkg_postrm_${PN}() {
175     #!/bin/sh -e
176
177     [ "x$D" == "x" ] && ldconfig
178     /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || : 
179
180 }
181
182 PACKAGES = "${PN}-dbg ${PN}-doc ${PN}-locale"
183 PACKAGES += " download-provider "
184 PACKAGES += " download-provider-dev "
185
186 download-provider_files = ""
187 download-provider_files += "${prefix}/bin/download-provider"
188 download-provider_files += "${prefix}/share/download-provider/images/*.png"
189 download-provider_files += "${prefix}/share/download-provider/images/*.gif"
190 download-provider_files += "${prefix}/lib/libdownloadagent2.so*"
191 download-provider_files += "${prefix}/lib/libdownload-provider-interface.so*"
192 download-provider_files += "${systemd_unitdir}/system/download-provider.service"
193 download-provider_files += "${systemd_unitdir}/system/default.target.wants/download-provider.service"
194 download-provider_files += "${systemd_unitdir}/system/download-provider.socket"
195 download-provider_files += "${systemd_unitdir}/system/sockets.target.wants/download-provider.socket"
196 download-provider_files += "${prefix}/share/download-provider/sql/download-provider-schema.sql"
197 MANIFESTFILES_${PN} = "download-provider.manifest"
198
199 download-provider-dev_files = ""
200 download-provider-dev_files += "${prefix}/lib/libdownloadagent2.so"
201 download-provider-dev_files += "${prefix}/lib/libdownload-provider-interface.so"
202 download-provider-dev_files += "${prefix}/include/download-provider/download-provider-defs.h"
203 download-provider-dev_files += "${prefix}/include/download-provider/download-provider-interface.h"
204 download-provider-dev_files += "${prefix}/lib/pkgconfig/download-provider.pc"
205 download-provider-dev_files += "${prefix}/lib/pkgconfig/download-provider-interface.pc"
206 MANIFESTFILES_${PN}-dev = "download-provider.manifest"
207
208 FILES_${PN} = "${download-provider_files}"
209 FILES_${PN}-dev = "${download-provider-dev_files}"
210
211 PKG_download-provider= "download-provider"
212 PKG_download-provider-dev= "download-provider-dev"
213
214 require download-provider-extraconf.inc
215