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.

132 lines
3.4 KiB

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