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.

146 lines
3.7 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_CPE_ID:=cpe:/a:nmap:nmap
  22. PKG_INSTALL:=1
  23. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  24. include $(INCLUDE_DIR)/package.mk
  25. NMAP_DEPENDS:=+libpcap +libstdcpp +zlib +libpcre
  26. NCAT_DEPENDS:=+libpcap
  27. NPING_DEPENDS:=+libpcap +libpthread +libstdcpp
  28. NDIFF_DEPENDS:=+python
  29. define Package/nmap/default
  30. SUBMENU:=NMAP Suite
  31. SECTION:=net
  32. CATEGORY:=Network
  33. URL:=http://nmap.org/
  34. endef
  35. define Package/nmap
  36. $(call Package/nmap/default)
  37. DEPENDS:=$(NMAP_DEPENDS)
  38. VARIANT:=nossl
  39. TITLE:=Utility for network exploration or security auditing
  40. endef
  41. define Package/nmap-ssl
  42. $(call Package/nmap/default)
  43. DEPENDS:=$(NMAP_DEPENDS) +libopenssl
  44. VARIANT:=ssl
  45. TITLE:=Nmap (with OpenSSL support)
  46. endef
  47. define Package/ncat
  48. $(call Package/nmap/default)
  49. DEPENDS:=$(NCAT_DEPENDS)
  50. VARIANT:=nossl
  51. TITLE:=Much-improved reimplementation of Netcat
  52. endef
  53. define Package/ncat-ssl
  54. $(call Package/nmap/default)
  55. DEPENDS:=$(NCAT_DEPENDS) +libopenssl
  56. VARIANT:=ssl
  57. TITLE:=Ncat (with OpenSSL support)
  58. endef
  59. define Package/nping
  60. $(call Package/nmap/default)
  61. DEPENDS:=$(NPING_DEPENDS)
  62. VARIANT:=nossl
  63. TITLE:=Network packet generation tool / ping utility
  64. endef
  65. define Package/ndiff
  66. $(call Package/nmap/default)
  67. DEPENDS:=$(NDIFF_DEPENDS)
  68. VARIANT:=nossl
  69. TITLE:=Utility to compare the results of Nmap scans
  70. endef
  71. CONFIGURE_ARGS += \
  72. --with-libdnet=included \
  73. --with-libpcre="$(STAGING_DIR)/usr" \
  74. --with-libpcap="$(STAGING_DIR)/usr" \
  75. --without-liblua \
  76. --without-zenmap
  77. CONFIGURE_VARS += \
  78. ac_cv_dnet_bsd_bpf=no \
  79. CXXFLAGS="$$$$CXXFLAGS -fno-builtin"
  80. ifeq ($(BUILD_VARIANT),ssl)
  81. CONFIGURE_ARGS += --with-openssl="$(STAGING_DIR)/usr" --without-libssh2
  82. else
  83. CONFIGURE_ARGS += --without-openssl
  84. endif
  85. define Package/nmap/install
  86. $(INSTALL_DIR) $(1)/usr/bin
  87. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nmap $(1)/usr/bin/
  88. $(INSTALL_DIR) $(1)/usr/share/nmap
  89. $(CP) $(PKG_INSTALL_DIR)/usr/share/nmap/* $(1)/usr/share/nmap/
  90. endef
  91. define Package/nmap-ssl/install
  92. $(INSTALL_DIR) $(1)/usr/bin
  93. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nmap $(1)/usr/bin/
  94. $(INSTALL_DIR) $(1)/usr/share/nmap
  95. $(CP) $(PKG_INSTALL_DIR)/usr/share/nmap/* $(1)/usr/share/nmap/
  96. endef
  97. define Package/ncat/install
  98. $(INSTALL_DIR) $(1)/usr/bin
  99. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ncat $(1)/usr/bin/
  100. endef
  101. define Package/ncat-ssl/install
  102. $(INSTALL_DIR) $(1)/usr/bin
  103. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ncat $(1)/usr/bin/
  104. $(INSTALL_DIR) $(1)/usr/share/ncat
  105. $(CP) $(PKG_INSTALL_DIR)/usr/share/ncat/ca-bundle.crt $(1)/usr/share/ncat/
  106. endef
  107. define Package/ndiff/install
  108. $(INSTALL_DIR) $(1)/usr/bin
  109. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ndiff $(1)/usr/bin/
  110. endef
  111. define Package/nping/install
  112. $(INSTALL_DIR) $(1)/usr/bin
  113. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nping $(1)/usr/bin/
  114. endef
  115. $(eval $(call BuildPackage,nmap))
  116. $(eval $(call BuildPackage,nmap-ssl))
  117. $(eval $(call BuildPackage,ncat))
  118. $(eval $(call BuildPackage,ncat-ssl))
  119. $(eval $(call BuildPackage,nping))
  120. $(eval $(call BuildPackage,ndiff))