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.

145 lines
3.6 KiB

  1. #
  2. # Copyright (C) 2006-2017 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #TODO
  7. #
  8. # * uClibcpp not supported, performance +100x slower. libstdcpp is being used. https://bugs.busybox.net/show_bug.cgi?id=2545
  9. # * liblua is still not recognized/blindly accepted. Impossible to compile with support
  10. #
  11. include $(TOPDIR)/rules.mk
  12. PKG_NAME:=nmap
  13. PKG_VERSION:=7.70
  14. PKG_RELEASE:=1
  15. PKG_MAINTAINER:=Nuno Goncalves <nunojpg@gmail.com>
  16. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  17. PKG_SOURCE_URL:=https://nmap.org/dist/
  18. PKG_HASH:=847b068955f792f4cc247593aca6dc3dc4aae12976169873247488de147a6e18
  19. PKG_LICENSE:=GPL-2.0
  20. PKG_LICENSE_FILES:=COPYING
  21. PKG_INSTALL:=1
  22. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  23. include $(INCLUDE_DIR)/package.mk
  24. NMAP_DEPENDS:=+libpcap +libstdcpp +zlib +libpcre
  25. NCAT_DEPENDS:=+libpcap
  26. NPING_DEPENDS:=+libpcap +libpthread +libstdcpp
  27. NDIFF_DEPENDS:=+python
  28. define Package/nmap/default
  29. SUBMENU:=NMAP Suite
  30. SECTION:=net
  31. CATEGORY:=Network
  32. URL:=http://nmap.org/
  33. endef
  34. define Package/nmap
  35. $(call Package/nmap/default)
  36. DEPENDS:=$(NMAP_DEPENDS)
  37. VARIANT:=nossl
  38. TITLE:=Utility for network exploration or security auditing
  39. endef
  40. define Package/nmap-ssl
  41. $(call Package/nmap/default)
  42. DEPENDS:=$(NMAP_DEPENDS) +libopenssl
  43. VARIANT:=ssl
  44. TITLE:=Nmap (with OpenSSL support)
  45. endef
  46. define Package/ncat
  47. $(call Package/nmap/default)
  48. DEPENDS:=$(NCAT_DEPENDS)
  49. VARIANT:=nossl
  50. TITLE:=Much-improved reimplementation of Netcat
  51. endef
  52. define Package/ncat-ssl
  53. $(call Package/nmap/default)
  54. DEPENDS:=$(NCAT_DEPENDS) +libopenssl
  55. VARIANT:=ssl
  56. TITLE:=Ncat (with OpenSSL support)
  57. endef
  58. define Package/nping
  59. $(call Package/nmap/default)
  60. DEPENDS:=$(NPING_DEPENDS)
  61. VARIANT:=nossl
  62. TITLE:=Network packet generation tool / ping utility
  63. endef
  64. define Package/ndiff
  65. $(call Package/nmap/default)
  66. DEPENDS:=$(NDIFF_DEPENDS)
  67. VARIANT:=nossl
  68. TITLE:=Utility to compare the results of Nmap scans
  69. endef
  70. CONFIGURE_ARGS += \
  71. --with-libdnet=included \
  72. --with-libpcre="$(STAGING_DIR)/usr" \
  73. --with-libpcap="$(STAGING_DIR)/usr" \
  74. --without-liblua \
  75. --without-zenmap
  76. CONFIGURE_VARS += \
  77. ac_cv_dnet_bsd_bpf=no \
  78. CXXFLAGS="$$$$CXXFLAGS -fno-builtin"
  79. ifeq ($(BUILD_VARIANT),ssl)
  80. CONFIGURE_ARGS += --with-openssl="$(STAGING_DIR)/usr" --without-libssh2
  81. else
  82. CONFIGURE_ARGS += --without-openssl
  83. endif
  84. define Package/nmap/install
  85. $(INSTALL_DIR) $(1)/usr/bin
  86. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nmap $(1)/usr/bin/
  87. $(INSTALL_DIR) $(1)/usr/share/nmap
  88. $(CP) $(PKG_INSTALL_DIR)/usr/share/nmap/* $(1)/usr/share/nmap/
  89. endef
  90. define Package/nmap-ssl/install
  91. $(INSTALL_DIR) $(1)/usr/bin
  92. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nmap $(1)/usr/bin/
  93. $(INSTALL_DIR) $(1)/usr/share/nmap
  94. $(CP) $(PKG_INSTALL_DIR)/usr/share/nmap/* $(1)/usr/share/nmap/
  95. endef
  96. define Package/ncat/install
  97. $(INSTALL_DIR) $(1)/usr/bin
  98. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ncat $(1)/usr/bin/
  99. endef
  100. define Package/ncat-ssl/install
  101. $(INSTALL_DIR) $(1)/usr/bin
  102. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ncat $(1)/usr/bin/
  103. $(INSTALL_DIR) $(1)/usr/share/ncat
  104. $(CP) $(PKG_INSTALL_DIR)/usr/share/ncat/ca-bundle.crt $(1)/usr/share/ncat/
  105. endef
  106. define Package/ndiff/install
  107. $(INSTALL_DIR) $(1)/usr/bin
  108. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ndiff $(1)/usr/bin/
  109. endef
  110. define Package/nping/install
  111. $(INSTALL_DIR) $(1)/usr/bin
  112. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nping $(1)/usr/bin/
  113. endef
  114. $(eval $(call BuildPackage,nmap))
  115. $(eval $(call BuildPackage,nmap-ssl))
  116. $(eval $(call BuildPackage,ncat))
  117. $(eval $(call BuildPackage,ncat-ssl))
  118. $(eval $(call BuildPackage,nping))
  119. $(eval $(call BuildPackage,ndiff))