f8d816c9ab70e1cdc5d860a6bdde03f3a12aab07
[packages.git] / libs / curl / Makefile
1 #
2 # Copyright (C) 2007-2013 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=curl
11 PKG_VERSION:=7.33.0
12 PKG_RELEASE:=3
13
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
22
23 PKG_LICENSE:=MIT
24 PKG_LICENSE_FILES:=COPYING
25
26 PKG_FIXUP:=autoreconf
27 PKG_BUILD_PARALLEL:=1
28
29 PKG_CONFIG_DEPENDS := \
30   LIBCURL_COOKIES \
31   LIBCURL_CRYPTO_AUTH \
32   LIBCURL_DICT \
33   LIBCURL_FILE \
34   LIBCURL_FTP \
35   LIBCURL_GNUTLS \
36   LIBCURL_GOPHER \
37   LIBCURL_HTTP \
38   LIBCURL_IMAP \
39   LIBCURL_LDAP \
40   LIBCURL_LDAPS \
41   LIBCURL_LIBCURL_OPTION \
42   LIBCURL_NOSSL \
43   LIBCURL_OPENSSL \
44   LIBCURL_POLARSSL \
45   LIBCURL_POP3 \
46   LIBCURL_PROXY \
47   LIBCURL_RTSP \
48   LIBCURL_SMTP \
49   LIBCURL_SSPI \
50   LIBCURL_TELNET \
51   LIBCURL_TFTP \
52   LIBCURL_THREADED_RESOLVER \
53   LIBCURL_TLS-SRP \
54   LIBCURL_ZLIB
55
56 include $(INCLUDE_DIR)/package.mk
57
58 define Package/curl/Default
59   SECTION:=net
60   CATEGORY:=Network
61   URL:=http://curl.haxx.se/
62   MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>
63 endef
64
65 define Package/curl
66   $(call Package/curl/Default)
67   SUBMENU:=File Transfer
68   DEPENDS:=+libcurl
69   TITLE:=A client-side URL transfer utility
70 endef
71
72 define Package/libcurl
73   $(call Package/curl/Default)
74   SECTION:=libs
75   CATEGORY:=Libraries
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)
78   MENU:=1
79 endef
80
81
82 define Package/libcurl/config
83   source "$(SOURCE)/Config.in"
84 endef
85
86 TARGET_CFLAGS += $(FPIC)
87
88 CONFIGURE_ARGS += \
89         --enable-shared \
90         --enable-static \
91         --disable-thread \
92         --enable-nonblocking \
93         --disable-ares \
94         --disable-debug \
95         --disable-manual \
96         --disable-verbose \
97         --without-ca-bundle \
98         --without-krb4 \
99         --without-libidn \
100         --without-nss \
101         --without-libssh2 \
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) \
127
128 define Build/Compile
129         +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
130                 DESTDIR="$(PKG_INSTALL_DIR)" \
131                 CC="$(TARGET_CC)" \
132                 install
133 endef
134
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/
144 endef
145
146 define Package/curl/install
147         $(INSTALL_DIR) $(1)/usr/bin
148         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/curl $(1)/usr/bin/
149 endef
150
151 define Package/libcurl/install
152         $(INSTALL_DIR) $(1)/usr/lib
153         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.so.* $(1)/usr/lib/
154 endef
155
156 $(eval $(call BuildPackage,curl))
157 $(eval $(call BuildPackage,libcurl))