2 # Copyright (C) 2007-2013 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:=57409d6bf0bd97053b8378dbe0cadcef
24 PKG_LICENSE_FILES:=COPYING
29 PKG_CONFIG_DEPENDS := \
41 LIBCURL_LIBCURL_OPTION \
52 LIBCURL_THREADED_RESOLVER \
56 include $(INCLUDE_DIR)/package.mk
58 define Package/curl/Default
61 URL:=http://curl.haxx.se/
62 MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>
66 $(call Package/curl/Default)
67 SUBMENU:=File Transfer
69 TITLE:=A client-side URL transfer utility
72 define Package/libcurl
73 $(call Package/curl/Default)
76 DEPENDS:=+LIBCURL_POLARSSL:libpolarssl +LIBCURL_OPENSSL:libopenssl +LIBCURL_GNUTLS:libgnutls +LIBCURL_ZLIB:zlib +LIBCURL_THREADED_RESOLVER:libpthread
77 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)
82 define Package/libcurl/config
83 source "$(SOURCE)/Config.in"
86 TARGET_CFLAGS += $(FPIC)
92 --enable-nonblocking \
102 $(call autoconf_bool,CONFIG_IPV6,ipv6) \
103 $(if $(CONFIG_LIBCURL_COOKIES),--enable,--disable)-cookies \
104 $(if $(CONFIG_LIBCURL_CRYPTO-AUTH),--enable,--disable)-crypto-auth \
105 $(if $(CONFIG_LIBCURL_DICT),--enable,--disable)-dict \
106 $(if $(CONFIG_LIBCURL_FILE),--enable,--disable)-file \
107 $(if $(CONFIG_LIBCURL_FTP),--enable,--disable)-ftp \
108 $(if $(CONFIG_LIBCURL_GOPHER),--enable,--disable)-gopher \
109 $(if $(CONFIG_LIBCURL_GNUTLS),--with-gnutls="$(STAGING_DIR)/usr",--without-gnutls) \
110 $(if $(CONFIG_LIBCURL_HTTP),--enable,--disable)-http \
111 $(if $(CONFIG_LIBCURL_IMAP),--enable,--disable)-imap \
112 $(if $(CONFIG_LIBCURL_LDAP),--enable,--disable)-ldap \
113 $(if $(CONFIG_LIBCURL_LDAPS),--enable,--disable)-ldaps \
114 $(if $(CONFIG_LIBCURL_LIBCURL-OPTION),--enable,--disable)-libcurl-option \
115 $(if $(CONFIG_LIBCURL_OPENSSL),--with-ssl="$(STAGING_DIR)/usr",--without-ssl) \
116 $(if $(CONFIG_LIBCURL_POLARSSL),--with-polarssl="$(STAGING_DIR)/usr",--without-polarssl) \
117 $(if $(CONFIG_LIBCURL_POP3),--enable,--disable)-pop3 \
118 $(if $(CONFIG_LIBCURL_PROXY),--enable,--disable)-proxy \
119 $(if $(CONFIG_LIBCURL_RTSP),--enable,--disable)-rtsp \
120 $(if $(CONFIG_LIBCURL_TELNET),--enable,--disable)-telnet \
121 $(if $(CONFIG_LIBCURL_TFTP),--enable,--disable)-tftp \
122 $(if $(CONFIG_LIBCURL_SMTP),--enable,--disable)-smtp \
123 $(if $(CONFIG_LIBCURL_SSPI),--enable,--disable)-sspi \
124 $(if $(CONFIG_LIBCURL_THREADED_RESOLVER),--enable,--disable)-threaded-resolver \
125 $(if $(CONFIG_LIBCURL_TLS-SRP),--enable,--disable)-tls-srp \
126 $(if $(CONFIG_LIBCURL_ZLIB),--with-zlib="$(STAGING_DIR)/usr",--without-zlib) \
129 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
130 DESTDIR="$(PKG_INSTALL_DIR)" \
135 define Build/InstallDev
136 $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig
137 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/curl-config $(1)/usr/bin/
138 $(CP) $(PKG_INSTALL_DIR)/usr/include/curl $(1)/usr/include/
139 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.{a,so*} $(1)/usr/lib/
140 $(CP) $(PKG_BUILD_DIR)/libcurl.pc $(1)/usr/lib/pkgconfig/
141 $(SED) 's,-L$$$${exec_prefix}/lib,,g' $(1)/usr/bin/curl-config
142 [ -n "$(TARGET_LDFLAGS)" ] && $(SED) 's#$(TARGET_LDFLAGS)##g' $(1)/usr/lib/pkgconfig/libcurl.pc || true
143 ln -sf $(STAGING_DIR)/usr/bin/curl-config $(2)/bin/
146 define Package/curl/install
147 $(INSTALL_DIR) $(1)/usr/bin
148 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/curl $(1)/usr/bin/
151 define Package/libcurl/install
152 $(INSTALL_DIR) $(1)/usr/lib
153 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.so.* $(1)/usr/lib/
156 $(eval $(call BuildPackage,curl))
157 $(eval $(call BuildPackage,libcurl))