wget: split into two packages. One package with SSL support and one without.
authorOliver Ertl <oliver@ertl-net.net>
Sat, 25 Aug 2007 19:59:22 +0000 (19:59 +0000)
committerOliver Ertl <oliver@ertl-net.net>
Sat, 25 Aug 2007 19:59:22 +0000 (19:59 +0000)
SVN-Revision: 8490

net/wget/Makefile

index 32d0fb9..01e0e34 100644 (file)
@@ -1,5 +1,5 @@
 # 
-# Copyright (C) 2006 OpenWrt.org
+# Copyright (C) 2007 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -10,48 +10,67 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=wget
 PKG_VERSION:=1.10.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
 PKG_MD5SUM:=795fefbb7099f93e2d346b026785c4b8
-PKG_CAT:=zcat
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
 
-define Package/wget
+define Package/wget/Default
   SECTION:=net
   CATEGORY:=Network
-  DEPENDS:=+libopenssl
   TITLE:=Non-interactive network downloader
-  DESCRIPTION:=\
-       Wget is a network utility to retrieve files from the Web \\\
-       using http and ftp, the two most widely used Internet \\\
-       protocols. It works non-interactively, so it will work in \\\
-       the background, after having logged off. The program supports \\\
-       recursive retrieval of web-authoring pages as well as ftp \\\
-       sites -- you can use wget to make mirrors of archives and \\\
-       home pages or to travel the Web like a WWW robot.
   URL:=http://www.gnu.org/software/wget/index.html
 endef
 
-define Build/Configure
-       $(call Build/Configure/Default, \
-               --disable-rpath \
-               --with-ssl \
-               --with-libssl-prefix="$(STAGING_DIR)/usr" \
-       )
+define Package/wget/Default/description
+       Wget is a network utility to retrieve files from the Web
+       using http and ftp, the two most widely used Internet
+       protocols. It works non-interactively, so it will work in
+       the background, after having logged off. The program supports
+       recursive retrieval of web-authoring pages as well as ftp
+       sites -- you can use wget to make mirrors of archives and
+       home pages or to travel the Web like a WWW robot.
 endef
 
-define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR)
+define Package/wget
+$(call Package/wget/Default)
+  DEPENDS+= +libopenssl
+  TITLE+= (with SSL support)
+endef
+
+define Package/wget/description
+$(call Package/wget/Default/description)
+ This package is built with SSL support.
+endef
+
+define Package/wget-nossl
+$(call Package/wget/Default)
+  TITLE+= (without SSL support)
+endef
+
+define Package/wget-nossl/description
+$(call Package/wget/Default/description)
+ This package is built without SSL support.
 endef
 
-define Package/wget/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/wget $(1)/usr/bin/
+
+define Build/Template
+
+$(STAMP_BUILT)-$(2): $(STAMP_PREPARED)
+       -$(MAKE) -C $(PKG_BUILD_DIR) clean
+       $(call Build/Configure/Default,$(3))
+       $(MAKE) -C $(PKG_BUILD_DIR)
+       ( cd $(PKG_BUILD_DIR)/src; mv -f wget wget-$(2) )
+       touch $$@
+
+$(STAMP_BUILT): $(STAMP_BUILT)-$(2)
+
+define Package/$(1)/install
+       $(INSTALL_DIR) $$(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/wget-$(2) $$(1)/usr/bin/wget
 endef
 
 # FIXME: check if busybox really provides a wget applet
@@ -60,4 +79,29 @@ define Package/wget/postrm
 ln -sf ../../bin/busybox $${IPKG_INSTROOT}/usr/bin/wget
 endef
 
+endef
+
+CONFIGURE_ARGS += \
+       --disable-rpath
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_wget),)
+  define Build/with-ssl
+    $(call Build/Template,wget,with-ssl, \
+       --with-ssl \
+       --with-libssl-prefix="$(STAGING_DIR)/usr" \
+    )
+  endef
+endif
+$(eval $(Build/with-ssl))
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_wget-nossl),)
+  define Build/without-ssl
+    $(call Build/Template,wget-nossl,without-ssl, \
+       --without-ssl \
+    )  
+  endef
+endif
+$(eval $(Build/without-ssl))
+
 $(eval $(call BuildPackage,wget))
+$(eval $(call BuildPackage,wget-nossl))