You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

134 lines
3.5 KiB

  1. #
  2. # Copyright (C) 2007-2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=wget
  9. PKG_VERSION:=1.17
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
  13. PKG_MD5SUM:=b8cff5a2f88f5ce60a2b0e361e030b46
  14. PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
  15. PKG_LICENSE:=GPL-3.0+
  16. PKG_LICENSE_FILES:=COPYING
  17. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/wget/Default
  20. SECTION:=net
  21. CATEGORY:=Network
  22. DEPENDS:=+libpcre
  23. SUBMENU:=File Transfer
  24. TITLE:=Non-interactive network downloader
  25. URL:=http://www.gnu.org/software/wget/index.html
  26. endef
  27. define Package/wget/Default/description
  28. Wget is a network utility to retrieve files from the Web using http
  29. and ftp, the two most widely used Internet protocols. It works
  30. non-interactively, so it will work in the background, after having
  31. logged off. The program supports recursive retrieval of web-authoring
  32. pages as well as ftp sites -- you can use wget to make mirrors of
  33. archives and home pages or to travel the Web like a WWW robot.
  34. endef
  35. define Package/wget
  36. $(call Package/wget/Default)
  37. DEPENDS+= +libopenssl +librt
  38. TITLE+= (with SSL support)
  39. VARIANT:=ssl
  40. endef
  41. define Package/wget/description
  42. $(call Package/wget/Default/description)
  43. This package is built with SSL support.
  44. endef
  45. define Package/wget-nossl
  46. $(call Package/wget/Default)
  47. TITLE+= (without SSL support)
  48. DEPENDS+= +zlib
  49. VARIANT:=nossl
  50. endef
  51. define Package/wget-nossl/description
  52. $(call Package/wget/Default/description)
  53. This package is built without SSL support.
  54. endef
  55. CONFIGURE_ARGS+= \
  56. --disable-rpath \
  57. --disable-iri \
  58. --without-libuuid
  59. CONFIGURE_VARS += \
  60. ac_cv_header_uuid_uuid_h=no
  61. ifeq ($(BUILD_VARIANT),ssl)
  62. CONFIGURE_ARGS+= \
  63. --with-ssl=openssl \
  64. --with-libssl-prefix="$(STAGING_DIR)/usr"
  65. endif
  66. ifeq ($(BUILD_VARIANT),nossl)
  67. CONFIGURE_ARGS+= \
  68. --disable-ntlm \
  69. --without-ssl
  70. endif
  71. define Package/wget/install
  72. $(INSTALL_DIR) $(1)/usr/bin
  73. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/wget $(1)/usr/bin/wget-ssl
  74. endef
  75. define Package/wget-nossl/install
  76. $(INSTALL_DIR) $(1)/usr/bin
  77. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/wget $(1)/usr/bin/wget-nossl
  78. endef
  79. define Package/wget/postinst
  80. #!/bin/sh
  81. if [ -e $${IPKG_INSTROOT}/usr/bin/wget ]; then
  82. rm -rf $${IPKG_INSTROOT}/usr/bin/wget;
  83. fi
  84. ln -sf ./wget-ssl $${IPKG_INSTROOT}/usr/bin/wget
  85. endef
  86. define Package/wget/postrm
  87. #!/bin/sh
  88. rm $${IPKG_INSTROOT}/usr/bin/wget
  89. [ -x $${IPKG_INSTROOT}/usr/bin/wget-nossl ] && ln -s ./wget-nossl $${IPKG_INSTROOT}/usr/bin/wget || {
  90. ln -s ../../bin/busybox $${IPKG_INSTROOT}/usr/bin/wget
  91. $${IPKG_INSTROOT}/usr/bin/wget 2>&1 | grep 'applet not found' > /dev/null 2>&1 && rm $${IPKG_INSTROOT}/usr/bin/wget
  92. }
  93. exit 0
  94. endef
  95. define Package/wget-nossl/postinst
  96. #!/bin/sh
  97. if [ -e $${IPKG_INSTROOT}/usr/bin/wget ]; then
  98. rm -rf $${IPKG_INSTROOT}/usr/bin/wget;
  99. fi
  100. ln -s ./wget-nossl $${IPKG_INSTROOT}/usr/bin/wget
  101. endef
  102. define Package/wget-nossl/postrm
  103. #!/bin/sh
  104. rm $${IPKG_INSTROOT}/usr/bin/wget
  105. [ -x $${IPKG_INSTROOT}/usr/bin/wget-ssl ] && ln -s ./wget-ssl $${IPKG_INSTROOT}/usr/bin/wget || {
  106. ln -s ../../bin/busybox $${IPKG_INSTROOT}/usr/bin/wget
  107. $${IPKG_INSTROOT}/usr/bin/wget 2>&1 | grep 'applet not found' > /dev/null 2>&1 && rm $${IPKG_INSTROOT}/usr/bin/wget
  108. }
  109. exit 0
  110. endef
  111. $(eval $(call BuildPackage,wget))
  112. $(eval $(call BuildPackage,wget-nossl))