ce4f5f2a8e3f405e00b881b4fb791d4c52c1ef80
[openembedded.git] / recipes / curl / curl-common.inc
1 DESCRIPTION = "Command line tool and library for client-side URL transfers."
2 LICENSE = "MIT"
3 SECTION = "console/network"
4
5 SRC_URI = "http://curl.haxx.se/download/curl-${PV}.tar.bz2 \
6            file://pkgconfig_fix.patch;patch=1"
7 S = "${WORKDIR}/curl-${PV}"
8
9 CURL_FEATURES ?= "zlib,gnutls,cookies,crypto-auth,dict,file,ftp,http,telnet,tftp"
10 # other allowed features: ipv6, ares
11
12 inherit autotools pkgconfig binconfig
13
14 EXTRA_OECONF = " \
15                 --without-libssh2 \
16                 --with-random=/dev/urandom \
17                 --without-libidn \
18                 --without-ssl \
19                 "
20
21 python __anonymous() {
22         f = bb.data.getVar("CURL_FEATURES", d, True).split(",")
23         oeconf = bb.data.getVar("EXTRA_OECONF", d, False)
24         deps = bb.data.getVar("DEPENDS", d, False).split()
25         for x in [ 'cookies', 'crypto-auth', 'dict', 'file', 'ftp', 'http', 'telnet', 'tftp', 'ipv6' ]:
26                 if x in f:
27                         oeconf += " --enable-%s" % x
28                 else:
29                         oeconf += " --disable-%s" % x
30         if 'zlib' in f:
31                 oeconf += " --with-zlib=${STAGING_LIBDIR}/../"
32                 deps.append("zlib")
33         else:
34                 oeconf += " --without-zlib"
35         if 'gnutls' in f:
36                 oeconf += " --with-gnutls=${STAGING_BINDIR_CROSS}"
37                 deps.append("gnutls")
38         else:
39                 oeconf += " --without-gnutls"
40         if 'ares' in f:
41                 oeconf += " --enable-ares"
42                 deps.append("c-ares")
43         else:
44                 oeconf += " --disable-ares"
45         bb.data.setVar('EXTRA_OECONF', oeconf, d)
46         bb.data.setVar('DEPENDS', " ".join(deps), d)
47 }
48
49 do_configure_prepend() {
50         sed -i s:OPT_GNUTLS/bin:OPT_GNUTLS:g configure.ac
51 }
52
53 do_stage () {
54         install -d ${STAGING_INCDIR}/curl
55         install -m 0644 ${S}/include/curl/*.h ${STAGING_INCDIR}/curl/
56         oe_libinstall -so -a -C lib libcurl ${STAGING_LIBDIR}
57 }