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.

131 lines
3.4 KiB

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