netcat package
authorpavlov <pavlov@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 2 May 2007 19:45:09 +0000 (19:45 +0000)
committerpavlov <pavlov@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 2 May 2007 19:45:09 +0000 (19:45 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@7081 3c298f89-4303-0410-b956-a3cf2f4a3e73

net/netcat/Makefile [new file with mode: 0644]

diff --git a/net/netcat/Makefile b/net/netcat/Makefile
new file mode 100644 (file)
index 0000000..c5bd1fe
--- /dev/null
@@ -0,0 +1,63 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=netcat
+PKG_VERSION:=0.7.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@SF/$(PKG_NAME)
+PKG_MD5SUM:=0a29eff1736ddb5effd0b1ec1f6fe0ef
+PKG_CAT:=bzcat
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/netcat
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=A feature-rich network debugging and exploration tool.
+  DESCRIPTION:=\
+               Netcat is a featured networking utility which reads and writes data across network connections, using the TCP/IP protocol. \\\
+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.
+  URL:=http://netcat.sourceforge.net/
+endef
+
+define Build/Configure
+       $(call Build/Configure/Default, \
+               --disable-rpath \
+               --with-included-getopt \
+       )
+endef
+
+define Build/Compile
+       DESTDIR="$(PKG_INSTALL_DIR)" \
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+       all install
+endef
+
+define Package/netcat/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/netcat \
+               $(1)/usr/bin
+endef
+
+define Package/netcat/postinst
+#!/bin/sh
+if [ -e $${IPKG_INSTROOT}/usr/bin/nc ]; then
+  rm -rf $${IPKG_INSTROOT}/usr/bin/nc;
+fi
+ln -s ./netcat $${IPKG_INSTROOT}/usr/bin/nc
+endef
+
+define Package/netcat/postrm
+#!/bin/sh
+rm $${IPKG_INSTROOT}/usr/bin/nc
+ln -s ../../bin/busybox $${IPKG_INSTROOT}/usr/bin/nc
+$${IPKG_INSTROOT}/usr/bin/nc 2>&1 | grep 'applet not found' > /dev/null 2>&1 && rm $${IPKG_INSTROOT}/usr/bin/nc
+exit 0
+endef
+
+
+$(eval $(call BuildPackage,netcat))