bmon: Bump to 3.5 and add myself as maintainer
[feed/packages.git] / net / wget / Makefile
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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=wget
11 PKG_VERSION:=1.15
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
16 PKG_MD5SUM:=7a279d5ac5594919124d5526e7143e28
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
70 CONFIGURE_VARS += \
71 ac_cv_header_uuid_uuid_h=no
72
73 ifeq ($(BUILD_VARIANT),ssl)
74 CONFIGURE_ARGS+= \
75 --with-ssl=openssl \
76 --with-libssl-prefix="$(STAGING_DIR)/usr"
77 endif
78
79 ifeq ($(BUILD_VARIANT),nossl)
80 CONFIGURE_ARGS+= \
81 --disable-ntlm \
82 --without-ssl
83 endif
84
85 define Package/wget/install
86 $(INSTALL_DIR) $(1)/usr/bin
87 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/wget $(1)/usr/bin/wget-ssl
88 endef
89
90 define Package/wget-nossl/install
91 $(INSTALL_DIR) $(1)/usr/bin
92 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/wget $(1)/usr/bin/wget-nossl
93 endef
94
95 define Package/wget/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 -sf ./wget-ssl $${IPKG_INSTROOT}/usr/bin/wget
101 endef
102
103 define Package/wget/postrm
104 #!/bin/sh
105 rm $${IPKG_INSTROOT}/usr/bin/wget
106 [ -x $${IPKG_INSTROOT}/usr/bin/wget-nossl ] && ln -s ./wget-nossl $${IPKG_INSTROOT}/usr/bin/wget || {
107 ln -s ../../bin/busybox $${IPKG_INSTROOT}/usr/bin/wget
108 $${IPKG_INSTROOT}/usr/bin/wget 2>&1 | grep 'applet not found' > /dev/null 2>&1 && rm $${IPKG_INSTROOT}/usr/bin/wget
109 }
110 exit 0
111 endef
112
113 define Package/wget-nossl/postinst
114 #!/bin/sh
115 if [ -e $${IPKG_INSTROOT}/usr/bin/wget ]; then
116 rm -rf $${IPKG_INSTROOT}/usr/bin/wget;
117 fi
118 ln -s ./wget-nossl $${IPKG_INSTROOT}/usr/bin/wget
119 endef
120
121 define Package/wget-nossl/postrm
122 #!/bin/sh
123 rm $${IPKG_INSTROOT}/usr/bin/wget
124 [ -x $${IPKG_INSTROOT}/usr/bin/wget-ssl ] && ln -s ./wget-ssl $${IPKG_INSTROOT}/usr/bin/wget || {
125 ln -s ../../bin/busybox $${IPKG_INSTROOT}/usr/bin/wget
126 $${IPKG_INSTROOT}/usr/bin/wget 2>&1 | grep 'applet not found' > /dev/null 2>&1 && rm $${IPKG_INSTROOT}/usr/bin/wget
127 }
128 exit 0
129 endef
130
131 $(eval $(call BuildPackage,wget))
132 $(eval $(call BuildPackage,wget-nossl))