Makefile cleanups, round 6 and last
[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 include $(INCLUDE_DIR)/package.mk
12
13 define Package/netcat
14 SECTION:=net
15 CATEGORY:=Network
16 TITLE:=A feature-rich network debugging and exploration tool.
17 URL:=http://netcat.sourceforge.net/
18 endef
19
20 define Package/netcat/description
21 Netcat is a featured networking utility which reads and writes data across network connections, using the TCP/IP protocol.
22 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.
23 endef
24
25 define Build/Configure
26 $(call Build/Configure/Default, \
27 --disable-rpath \
28 --with-included-getopt \
29 )
30 endef
31
32 define Build/Compile
33 DESTDIR="$(PKG_INSTALL_DIR)" \
34 $(MAKE) -C $(PKG_BUILD_DIR) \
35 all install
36 endef
37
38 define Package/netcat/install
39 $(INSTALL_DIR) $(1)/usr/bin
40 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/netcat \
41 $(1)/usr/bin
42 endef
43
44 define Package/netcat/postinst
45 #!/bin/sh
46 if [ -e $${IPKG_INSTROOT}/usr/bin/nc ]; then
47 rm -rf $${IPKG_INSTROOT}/usr/bin/nc;
48 fi
49 ln -s ./netcat $${IPKG_INSTROOT}/usr/bin/nc
50 endef
51
52 define Package/netcat/postrm
53 #!/bin/sh
54 rm $${IPKG_INSTROOT}/usr/bin/nc
55 ln -s ../../bin/busybox $${IPKG_INSTROOT}/usr/bin/nc
56 $${IPKG_INSTROOT}/usr/bin/nc 2>&1 | grep 'applet not found' > /dev/null 2>&1 && rm $${IPKG_INSTROOT}/usr/bin/nc
57 exit 0
58 endef
59
60
61 $(eval $(call BuildPackage,netcat))