[packages_10.03.1] curl: update to v7.21.7 (CVE-2011-2192)
[openwrt/svn-archive/archive.git] / libs / curl / Makefile
index e429276ad1523984f8ce0bf0bf68d685ddce4c76..905fa45bc9c5e653ad9b82f9c31e0f43c0c14f6f 100644 (file)
@@ -1,15 +1,14 @@
 # 
-# Copyright (C) 2006 OpenWrt.org
+# Copyright (C) 2007-2009 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
-# $Id$
 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=curl
-PKG_VERSION:=7.14.0
+PKG_VERSION:=7.21.7
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
@@ -20,11 +19,10 @@ PKG_SOURCE_URL:=http://curl.haxx.se/download/ \
        ftp://ftp.planetmirror.com/pub/curl/ \
        http://www.mirrormonster.com/curl/download/ \
        http://curl.mirrors.cyberservers.net/download/
-PKG_MD5SUM:=46ce665e47d37fce1a0bad935cce58a9
-PKG_CAT:=bzcat
+PKG_MD5SUM:=5f6d50c4d4ee38c57fe37e3cff75adbd
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
-PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
+PKG_FIXUP:=libtool
+PKG_BUILD_PARALLEL:=1
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -36,8 +34,9 @@ endef
 
 define Package/curl
   $(call Package/curl/Default)
+  SUBMENU:=File Transfer
   DEPENDS:=+libcurl
-  TITLE:=A client-side URL transfer library
+  TITLE:=A client-side URL transfer utility
 endef
 
 define Package/libcurl
@@ -45,69 +44,78 @@ define Package/libcurl
   SECTION:=libs
   CATEGORY:=Libraries
   DEPENDS:=+libopenssl +zlib
-  TITLE:=A client-side URL transfer utility
+  TITLE:=A client-side URL transfer library
 endef
 
-define Build/Configure
-       $(call Build/Configure/Default, \
-               --enable-shared \
-               --enable-static \
-               --disable-thread \
-               --enable-cookies \
-               --enable-crypto-auth \
-               --enable-nonblocking \
-               --enable-file \
-               --enable-ftp \
-               --enable-http \
-               --enable-ipv6 \
-               --disable-ares \
-               --disable-debug \
-               --disable-dict \
-               --disable-gopher \
-               --disable-ldap \
-               --disable-manual \
-               --disable-sspi \
-               --disable-telnet \
-               --disable-verbose \
-               --with-random="/dev/urandom" \
-               --with-ssl="$(STAGING_DIR)/usr" \
-               --without-ca-bundle \
-               --without-gnutls \
-               --without-libidn \
-               --with-zlib="$(STAGING_DIR)/usr" \
-       );
-endef
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+       --disable-thread \
+       --enable-cookies \
+       --enable-crypto-auth \
+       --enable-nonblocking \
+       --enable-file \
+       --enable-ftp \
+       --enable-http \
+       --disable-ares \
+       --disable-debug \
+       --disable-dict \
+       --disable-gopher \
+       --disable-ldap \
+       --disable-manual \
+       --disable-sspi \
+       --disable-telnet \
+       --enable-tftp \
+       --disable-verbose \
+       --with-random="/dev/urandom" \
+       --with-ssl="$(STAGING_DIR)/usr" \
+       --without-ca-bundle \
+       --without-gnutls \
+       --without-krb4 \
+       --without-libidn \
+       --without-nss \
+       --without-libssh2 \
+       --with-zlib="$(STAGING_DIR)/usr" \
+       $(call autoconf_bool,CONFIG_IPV6,ipv6) \
+
+CONFIGURE_VARS += \
+       LDFLAGS="$$$$LDFLAGS -lcrypto -lssl -lz" \
+       CC="$(filter-out ccache,$(TARGET_CC))"
+
+#define Build/Configure
+#      (cd $(PKG_BUILD_DIR); \
+#              autoreconf -v --install || exit 1 \
+#      );
+#      $(call Build/Configure/Default)
+#endef
 
 define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR) \
+       $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
                DESTDIR="$(PKG_INSTALL_DIR)" \
-               all install
+               CC="$(TARGET_CC)" \
+               install
 endef
 
 define Build/InstallDev
-       mkdir -p $(STAGING_DIR)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/curl-config $(STAGING_DIR)/usr/bin/
-       mkdir -p $(STAGING_DIR)/usr/include
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/curl $(STAGING_DIR)/usr/include/
-       mkdir -p $(STAGING_DIR)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.{a,so*} $(STAGING_DIR)/usr/lib/
-       $(SED) 's,-I/usr/include,,g' $(STAGING_DIR)/usr/bin/curl-config
-       $(SED) 's,-L/usr/lib,,g' $(STAGING_DIR)/usr/bin/curl-config
-endef
-
-define Build/UninstallDev
-       rm -rf  $(STAGING_DIR)/usr/bin/curl-config \
-               $(STAGING_DIR)/usr/include/curl \
-               $(STAGING_DIR)/usr/lib/libcurl.{a,so*}
+       $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/curl-config $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/curl $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.{a,so*} $(1)/usr/lib/
+       $(CP) $(PKG_BUILD_DIR)/libcurl.pc $(1)/usr/lib/pkgconfig/
+       $(SED) 's,-L$$$${exec_prefix}/lib,,g' $(1)/usr/bin/curl-config
+       $(SED) 's#$(TARGET_LDFLAGS)##g' $(1)/usr/lib/pkgconfig/libcurl.pc
+       ln -sf $(STAGING_DIR)/usr/bin/curl-config $(2)/bin/
 endef
 
 define Package/curl/install
-       install -d -m0755 $(1)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/curl $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/curl $(1)/usr/bin/
 endef
 
 define Package/libcurl/install
-       install -d -m0755 $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.so.* $(1)/usr/lib/
 endef