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