[Packages] net/wifidog:
[openwrt/svn-archive/archive.git] / net / netcat / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=netcat
4 PKG_VERSION:=0.7.1
5 PKG_RELEASE:=1
6
7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
8 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
9 PKG_MD5SUM:=0a29eff1736ddb5effd0b1ec1f6fe0ef
10
11 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
12 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
13
14 include $(INCLUDE_DIR)/package.mk
15
16 define Package/netcat
17 SECTION:=net
18 CATEGORY:=Network
19 TITLE:=A feature-rich network debugging and exploration tool.
20 URL:=http://netcat.sourceforge.net/
21 endef
22
23 define Package/netcat/description
24 Netcat is a featured networking utility which reads and writes data across network connections, using the TCP/IP protocol.
25 It is designed to be a reliable "back-end" tool that can be used directly or easily driven by other programs and scripts. At the same time, it is a feature-rich network debugging and exploration tool, since it can create almost any kind of connection you would need and has several interesting built-in capabilities.
26 endef
27
28 define Build/Configure
29 $(call Build/Configure/Default, \
30 --disable-rpath \
31 --with-included-getopt \
32 )
33 endef
34
35 define Build/Compile
36 DESTDIR="$(PKG_INSTALL_DIR)" \
37 $(MAKE) -C $(PKG_BUILD_DIR) \
38 all install
39 endef
40
41 define Package/netcat/install
42 $(INSTALL_DIR) $(1)/usr/bin
43 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/netcat \
44 $(1)/usr/bin
45 endef
46
47 define Package/netcat/postinst
48 #!/bin/sh
49 if [ -e $${IPKG_INSTROOT}/usr/bin/nc ]; then
50 rm -rf $${IPKG_INSTROOT}/usr/bin/nc;
51 fi
52 ln -s ./netcat $${IPKG_INSTROOT}/usr/bin/nc
53 endef
54
55 define Package/netcat/postrm
56 #!/bin/sh
57 rm $${IPKG_INSTROOT}/usr/bin/nc
58 ln -s ../../bin/busybox $${IPKG_INSTROOT}/usr/bin/nc
59 $${IPKG_INSTROOT}/usr/bin/nc 2>&1 | grep 'applet not found' > /dev/null 2>&1 && rm $${IPKG_INSTROOT}/usr/bin/nc
60 exit 0
61 endef
62
63
64 $(eval $(call BuildPackage,netcat))