first commit
[scm/bb/meta-tizen.git] / recipes-tizen / curl / curl.inc
1 DESCRIPTION = "A utility for getting files from remote servers (FTP, HTTP, and others)"
2 HOMEPAGE = "http://curl.haxx.se/"
3 SECTION = "Base/Utilities"
4 LICENSE = "MIT"
5
6 SRC_URI = ""
7
8 S = "${WORKDIR}/git"
9
10 PROVIDES = ""
11
12 #PROVIDES by libcurl 
13 PROVIDES += "libcurl"
14 RPROVIDES_libcurl += "libcurl"
15
16 #PROVIDES by curl 
17 PROVIDES += "curl"
18 RPROVIDES_curl += "curl"
19 # the PROVIDES rules is ignore "webclient  "
20 PROVIDES += "webclient"
21 RPROVIDES_curl += "webclient"
22
23 #PROVIDES by libcurl-devel 
24 PROVIDES += "libcurl-devel"
25 RPROVIDES_libcurl-devel += "libcurl-devel"
26 RPROVIDES_libcurl-devel += "libcurl-dev"
27 # the PROVIDES rules is ignore "curl-devel = 7.32.0"
28 PROVIDES += "curl-devel"
29 RPROVIDES_libcurl-devel += "curl-devel"
30 RPROVIDES_libcurl-devel += "curl-dev"
31
32 RDEPENDS = ""
33 #RDEPENDS of libcurl-devel (lib${PN}-devel)
34 RDEPENDS_lib${PN}-devel += "libcurl"
35 RDEPENDS_lib${PN}-devel += "libidn-dev"
36
37
38 DEPENDS = ""
39 #DEPENDS of curl 
40 DEPENDS += "pkgconfig(libidn)"
41 DEPENDS += "pkgconfig(nss)"
42 DEPENDS += "c-ares"
43 DEPENDS += "zlib-devel"
44 DEPENDS += "pkgconfig(openssl)"
45
46 do_patch() {
47  chmod -Rf a+rX,u+w,g-w,o-w ${S}
48  #setup -q
49  cp ${S}/packaging/curl.manifest .
50  
51  
52 }
53
54 do_configure() {
55 }
56
57 do_compile() {
58  LANG=C
59  export LANG
60  unset DISPLAY
61  CFLAGS="-O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables" ; export CFLAGS ; 
62  CXXFLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CXXFLAGS ; 
63  FFLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -I%_fmoddir}" ; export FFLAGS ; 
64  LD_AS_NEEDED=1; export LD_AS_NEEDED ; 
65  
66  export CPPFLAGS="$(pkg-config --cflags nss) -DHAVE_PK11_CREATEGENERICOBJECT"
67  
68  
69    CFLAGS="${CFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CFLAGS ; 
70    CXXFLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CXXFLAGS ; 
71    FFLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -I%_fmoddir}" ; export FFLAGS ; 
72    autotools_do_configure --build=${TARGET_SYS} --host=${HOST_SYS} \
73          --target=x86_64-tizen-linux \
74          --program-prefix= \
75          --prefix=/usr \
76          --exec-prefix=/usr \
77          --bindir=/usr/bin \
78          --sbindir=/usr/sbin \
79          --sysconfdir=/etc \
80          --datadir=/usr/share \
81          --includedir=/usr/include \
82          --libdir=/usr/lib \
83          --libexecdir=/usr/libexec \
84          --localstatedir=/var \
85          --sharedstatedir=/usr/com \
86          --mandir=/usr/share/man \
87          --infodir=/usr/share/info --without-nss \
88          --without-gnutls \
89          --with-openssl \
90          --disable-ipv6 \
91          --with-ca-path=/etc/ssl/certs \
92          --with-libidn \
93          --with-lber-lib=lber \
94          --enable-manual \
95          --enable-versioned-symbols \
96          --enable-ares \
97          --enable-debug \
98          --enable-curldebug \
99          --disable-static
100  
101  sed -i -e 's,-L/usr/lib ,,g;s,-L/usr/lib64 ,,g;s,-L/usr/lib$,,g;s,-L/usr/lib64$,,g' \
102  Makefile libcurl.pc
103  
104  # Remove bogus rpath
105  sed -i \
106  -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
107  -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
108  
109  make -j16
110  
111  
112  
113 }
114
115 do_install() {
116  echo export RPM_BUILD_ROOT=${D}
117  LANG=C
118  export LANG
119  unset DISPLAY
120  rm -rf ${D} 
121  mkdir -p ${D} 
122  
123  make DESTDIR=${D} INSTALL="install -p" install
124  
125  rm -f ${D}/usr/lib/libcurl.la
126  install -d ${D}//usr/share/aclocal
127  install -m 644 docs/libcurl/libcurl.m4 ${D}//usr/share/aclocal
128  
129  # don't need curl's copy of the certs; use openssl's
130  find ${D} -name ca-bundle.crt -exec rm -f '{}' \;
131  rm -rf ${D}/usr/share/man
132  
133  
134 }
135
136 PACKAGES = ""
137 PACKAGES += "libcurl"
138 PACKAGES += "curl"
139 PACKAGES += "libcurl-devel"
140
141 libcurl_files = ""
142 libcurl_files += "curl.manifest"
143 libcurl_files += "/usr/lib/libcurl.so.*"
144
145 curl_files = ""
146 curl_files += "curl.manifest"
147 curl_files += "/usr/bin/curl"
148
149 libcurl-devel_files = ""
150 libcurl-devel_files += "curl.manifest"
151 libcurl-devel_files += "/usr/bin/curl-config*"
152 libcurl-devel_files += "/usr/include/curl"
153 libcurl-devel_files += "/usr/lib/*.so"
154 libcurl-devel_files += "/usr/lib/pkgconfig/*.pc"
155 libcurl-devel_files += "/usr/share/aclocal/libcurl.m4"
156
157 FILES_lib${PN} = "${libcurl_files}"
158 FILES_${PN} = "${curl_files}"
159 FILES_lib${PN}-devel = "${libcurl-devel_files}"
160
161 PKG_libcurl= "libcurl"
162 PKG_curl= "curl"
163 PKG_libcurl-devel= "libcurl-devel"
164
165 require curl-extraconf.inc