Makefile 1.8 KB

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