You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.9 KiB

  1. #
  2. # Copyright (C) 2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=netcat
  9. PKG_VERSION:=0.7.1
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  12. PKG_SOURCE_URL:=@SF/$(PKG_NAME)
  13. PKG_HASH:=b55af0bbdf5acc02d1eb6ab18da2acd77a400bafd074489003f3df09676332bb
  14. PKG_MAINTAINER:=Adam Gensler <openwrt@a.gnslr.us>
  15. PKG_LICENSE:=GPL-2.0
  16. PKG_CPE_ID:=cpe:/a:netcat:netcat
  17. PKG_INSTALL:=1
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/netcat
  20. SECTION:=net
  21. CATEGORY:=Network
  22. TITLE:=A feature-rich network debugging and exploration tool.
  23. URL:=http://netcat.sourceforge.net/
  24. endef
  25. define Package/netcat/description
  26. Netcat is a featured networking utility which reads and writes data across network connections, using the TCP/IP protocol.
  27. 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.
  28. endef
  29. define Build/Configure
  30. $(call Build/Configure/Default, \
  31. --disable-rpath \
  32. --with-included-getopt \
  33. )
  34. endef
  35. define Package/netcat/install
  36. $(INSTALL_DIR) $(1)/usr/bin
  37. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/netcat \
  38. $(1)/usr/bin
  39. endef
  40. define Package/netcat/postinst
  41. #!/bin/sh
  42. if [ -e $${IPKG_INSTROOT}/usr/bin/nc ]; then
  43. rm -rf $${IPKG_INSTROOT}/usr/bin/nc;
  44. fi
  45. ln -s ./netcat $${IPKG_INSTROOT}/usr/bin/nc
  46. endef
  47. define Package/netcat/postrm
  48. #!/bin/sh
  49. rm $${IPKG_INSTROOT}/usr/bin/nc
  50. ln -s ../../bin/busybox $${IPKG_INSTROOT}/usr/bin/nc
  51. $${IPKG_INSTROOT}/usr/bin/nc 2>&1 | grep 'applet not found' > /dev/null 2>&1 && rm $${IPKG_INSTROOT}/usr/bin/nc
  52. exit 0
  53. endef
  54. $(eval $(call BuildPackage,netcat))