2 # Copyright (C) 2007-2014 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://curl.haxx.se/download/ \
16 http://www.mirrorspace.org/curl/ \
17 ftp://ftp.sunet.se/pub/www/utilities/curl/ \
18 ftp://ftp.planetmirror.com/pub/curl/ \
19 http://www.mirrormonster.com/curl/download/ \
20 http://curl.mirrors.cyberservers.net/download/
21 PKG_MD5SUM:=af6b3c299bd891f43cb5f76c4091b7b4
24 PKG_LICENSE_FILES:=COPYING
29 PKG_CONFIG_DEPENDS := \
44 LIBCURL_LIBCURL_OPTION \
55 LIBCURL_THREADED_RESOLVER \
59 include $(INCLUDE_DIR)/package.mk
61 define Package/curl/Default
64 URL:=http://curl.haxx.se/
65 MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>
69 $(call Package/curl/Default)
70 SUBMENU:=File Transfer
72 TITLE:=A client-side URL transfer utility
75 define Package/libcurl
76 $(call Package/curl/Default)
79 DEPENDS:=+LIBCURL_POLARSSL:libpolarssl +LIBCURL_CYASSL:libcyassl +LIBCURL_AXTLS:libaxtls +LIBCURL_OPENSSL:libopenssl +LIBCURL_GNUTLS:libgnutls +LIBCURL_ZLIB:zlib +LIBCURL_THREADED_RESOLVER:libpthread
80 TITLE:=A client-side URL transfer library using $(if $(CONFIG_LIBCURL_POLARSSL),PolarSSL)$(if $(CONFIG_LIBCURL_OPENSSL),OpenSSL)$(if $(CONFIG_LIBCURL_GNUTLS),GNUTLS)$(if $(CONFIG_LIBCURL_NOSSL),no SSL)
85 define Package/libcurl/config
86 source "$(SOURCE)/Config.in"
89 TARGET_CFLAGS += $(FPIC)
95 --enable-nonblocking \
100 --without-ca-bundle \
101 $(if $(CONFIG_LIBCURL_OPENSSL),--with-ca-path=/etc/ssl/certs/) \
106 $(call autoconf_bool,CONFIG_IPV6,ipv6) \
107 $(if $(CONFIG_LIBCURL_AXTLS),--with-axtls="$(STAGING_DIR)/usr",--without-axtls) \
108 $(if $(CONFIG_LIBCURL_COOKIES),--enable,--disable)-cookies \
109 $(if $(CONFIG_LIBCURL_CRYPTO-AUTH),--enable,--disable)-crypto-auth \
110 $(if $(CONFIG_LIBCURL_CYASSL),--with-cyassl="$(STAGING_DIR)/usr",--without-cyassl) \
111 $(if $(CONFIG_LIBCURL_DICT),--enable,--disable)-dict \
112 $(if $(CONFIG_LIBCURL_FILE),--enable,--disable)-file \
113 $(if $(CONFIG_LIBCURL_FTP),--enable,--disable)-ftp \
114 $(if $(CONFIG_LIBCURL_GOPHER),--enable,--disable)-gopher \
115 $(if $(CONFIG_LIBCURL_GNUTLS),--with-gnutls="$(STAGING_DIR)/usr",--without-gnutls) \
116 $(if $(CONFIG_LIBCURL_HTTP),--enable,--disable)-http \
117 $(if $(CONFIG_LIBCURL_HTTPS),--enable,--disable)-https \
118 $(if $(CONFIG_LIBCURL_IMAP),--enable,--disable)-imap \
119 $(if $(CONFIG_LIBCURL_LDAP),--enable,--disable)-ldap \
120 $(if $(CONFIG_LIBCURL_LDAPS),--enable,--disable)-ldaps \
121 $(if $(CONFIG_LIBCURL_LIBCURL-OPTION),--enable,--disable)-libcurl-option \
122 $(if $(CONFIG_LIBCURL_OPENSSL),--with-ssl="$(STAGING_DIR)/usr",--without-ssl) \
123 $(if $(CONFIG_LIBCURL_POLARSSL),--with-polarssl="$(STAGING_DIR)/usr",--without-polarssl) \
124 $(if $(CONFIG_LIBCURL_POP3),--enable,--disable)-pop3 \
125 $(if $(CONFIG_LIBCURL_PROXY),--enable,--disable)-proxy \
126 $(if $(CONFIG_LIBCURL_RTSP),--enable,--disable)-rtsp \
127 $(if $(CONFIG_LIBCURL_TELNET),--enable,--disable)-telnet \
128 $(if $(CONFIG_LIBCURL_TFTP),--enable,--disable)-tftp \
129 $(if $(CONFIG_LIBCURL_SMTP),--enable,--disable)-smtp \
130 $(if $(CONFIG_LIBCURL_SSPI),--enable,--disable)-sspi \
131 $(if $(CONFIG_LIBCURL_THREADED_RESOLVER),--enable,--disable)-threaded-resolver \
132 $(if $(CONFIG_LIBCURL_TLS-SRP),--enable,--disable)-tls-srp \
133 $(if $(CONFIG_LIBCURL_ZLIB),--with-zlib="$(STAGING_DIR)/usr",--without-zlib) \
136 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
137 DESTDIR="$(PKG_INSTALL_DIR)" \
142 define Build/InstallDev
143 $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig
144 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/curl-config $(1)/usr/bin/
145 $(CP) $(PKG_INSTALL_DIR)/usr/include/curl $(1)/usr/include/
146 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.{a,so*} $(1)/usr/lib/
147 $(CP) $(PKG_BUILD_DIR)/libcurl.pc $(1)/usr/lib/pkgconfig/
148 $(SED) 's,-L$$$${exec_prefix}/lib,,g' $(1)/usr/bin/curl-config
149 [ -n "$(TARGET_LDFLAGS)" ] && $(SED) 's#$(TARGET_LDFLAGS)##g' $(1)/usr/lib/pkgconfig/libcurl.pc || true
150 $(LN) $(STAGING_DIR)/usr/bin/curl-config $(2)/bin/
153 define Package/curl/install
154 $(INSTALL_DIR) $(1)/usr/bin
155 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/curl $(1)/usr/bin/
158 define Package/libcurl/install
159 $(INSTALL_DIR) $(1)/usr/lib
160 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.so.* $(1)/usr/lib/
163 $(eval $(call BuildPackage,curl))
164 $(eval $(call BuildPackage,libcurl))