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