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.

204 lines
5.0 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.91
  14. PKG_RELEASE:=$(AUTORELEASE)
  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:=18cc4b5070511c51eb243cdd2b0b30ff9b2c4dc4544c6312f75ce3a67a593300
  19. PKG_LICENSE:=GPL-2.0-only
  20. PKG_LICENSE_FILES:=COPYING
  21. PKG_CPE_ID:=cpe:/a:nmap:nmap
  22. PKG_BUILD_PARALLEL:=1
  23. PKG_INSTALL:=1
  24. PYTHON3_PKG_BUILD:=0
  25. include $(INCLUDE_DIR)/package.mk
  26. include ../../lang/python/python3-package.mk
  27. NMAP_DEPENDS:=+libpcap +libstdcpp +zlib +libpcre
  28. NCAT_DEPENDS:=+libpcap
  29. NPING_DEPENDS:=+libpcap +libpthread +libstdcpp
  30. define Package/nmap/default
  31. SUBMENU:=NMAP Suite
  32. SECTION:=net
  33. CATEGORY:=Network
  34. URL:=https://nmap.org/
  35. endef
  36. define Package/nmap
  37. $(call Package/nmap/default)
  38. DEPENDS:=$(NMAP_DEPENDS)
  39. VARIANT:=nossl
  40. TITLE:=Utility for network exploration or security auditing
  41. endef
  42. define Package/nmap-ssl
  43. $(call Package/nmap/default)
  44. DEPENDS:=$(NMAP_DEPENDS) +libopenssl
  45. VARIANT:=ssl
  46. TITLE:=Nmap (with OpenSSL support)
  47. endef
  48. define Package/nmap-full
  49. $(call Package/nmap/default)
  50. DEPENDS:=$(NMAP_DEPENDS) +libopenssl +liblua5.3 +libssh2
  51. VARIANT:=full
  52. TITLE:=Nmap (with OpenSSL and scripting support)
  53. endef
  54. define Package/ncat
  55. $(call Package/nmap/default)
  56. DEPENDS:=$(NCAT_DEPENDS)
  57. VARIANT:=nossl
  58. TITLE:=Much-improved reimplementation of Netcat
  59. endef
  60. define Package/ncat-ssl
  61. $(call Package/nmap/default)
  62. DEPENDS:=$(NCAT_DEPENDS) +libopenssl
  63. VARIANT:=ssl
  64. TITLE:=Ncat (with OpenSSL support)
  65. endef
  66. define Package/ncat-full
  67. $(call Package/nmap/default)
  68. DEPENDS:=$(NCAT_DEPENDS) +libopenssl +liblua5.3
  69. VARIANT:=full
  70. TITLE:=Ncat (with OpenSSL and scripting support)
  71. endef
  72. define Package/nping
  73. $(call Package/nmap/default)
  74. DEPENDS:=$(NPING_DEPENDS)
  75. VARIANT:=nossl
  76. TITLE:=Network packet generation tool / ping utility
  77. endef
  78. define Package/nping-ssl
  79. $(call Package/nmap/default)
  80. DEPENDS:=$(NPING_DEPENDS) +libopenssl
  81. VARIANT:=ssl
  82. TITLE:=Nping (with OpenSSL support)
  83. endef
  84. define Package/ndiff
  85. $(call Package/nmap/default)
  86. DEPENDS:=+python3-light +python3-xml
  87. TITLE:=Utility to compare the results of Nmap scans
  88. endef
  89. CONFIGURE_ARGS += \
  90. --with-libdnet=included \
  91. --with-liblinear=included \
  92. --with-libpcap="$(STAGING_DIR)/usr" \
  93. --with-libpcre="$(STAGING_DIR)/usr" \
  94. --with-libz="$(STAGING_DIR)/usr" \
  95. --with-ncat \
  96. --without-localdirs \
  97. --without-ndiff \
  98. --without-zenmap
  99. # --with-libnbase=included
  100. # --with-libnsock=included
  101. ifeq ($(BUILD_VARIANT),full)
  102. CONFIGURE_ARGS += \
  103. --with-liblua="$(STAGING_DIR)/usr" \
  104. --with-libssh2="$(STAGING_DIR)/usr" \
  105. --with-openssl="$(STAGING_DIR)/usr" \
  106. --without-nping
  107. else ifeq ($(BUILD_VARIANT),ssl)
  108. CONFIGURE_ARGS += \
  109. --with-nping \
  110. --with-openssl="$(STAGING_DIR)/usr" \
  111. --without-liblua \
  112. --without-libssh2
  113. else # nossl
  114. CONFIGURE_ARGS += \
  115. --with-nping \
  116. --without-liblua \
  117. --without-libssh2 \
  118. --without-openssl
  119. endif
  120. CONFIGURE_VARS += \
  121. ac_cv_dnet_bsd_bpf=no
  122. PYTHON3_PKG_SETUP_DIR:=ndiff
  123. PYTHON3_PKG_SETUP_ARGS:=
  124. define Build/Compile
  125. $(call Build/Compile/Default,)
  126. $(call Py3Build/Compile)
  127. endef
  128. define Package/nmap/install
  129. $(INSTALL_DIR) $(1)/usr/bin
  130. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nmap $(1)/usr/bin/
  131. $(INSTALL_DIR) $(1)/usr/share/nmap
  132. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/nmap/nmap* $(1)/usr/share/nmap/
  133. endef
  134. Package/nmap-ssl/install=$(Package/nmap/install)
  135. define Package/nmap-full/install
  136. $(call Package/nmap/install,$(1))
  137. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/nmap/nse_main.lua $(1)/usr/share/nmap/
  138. $(CP) $(PKG_INSTALL_DIR)/usr/share/nmap/{nselib,scripts} $(1)/usr/share/nmap/
  139. endef
  140. define Package/ncat/install
  141. $(INSTALL_DIR) $(1)/usr/bin
  142. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ncat $(1)/usr/bin/
  143. endef
  144. define Package/ncat-ssl/install
  145. $(call Package/ncat/install,$(1))
  146. $(INSTALL_DIR) $(1)/usr/share/ncat
  147. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/ncat/ca-bundle.crt $(1)/usr/share/ncat/
  148. endef
  149. Package/ncat-full/install=$(Package/ncat-ssl/install)
  150. define Package/nping/install
  151. $(INSTALL_DIR) $(1)/usr/bin
  152. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nping $(1)/usr/bin/
  153. endef
  154. Package/nping-ssl/install=$(Package/nping/install)
  155. define Py3Package/ndiff/install
  156. $(INSTALL_DIR) $(1)/usr/bin
  157. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ndiff $(1)/usr/bin/
  158. endef
  159. $(eval $(call BuildPackage,nmap))
  160. $(eval $(call BuildPackage,nmap-ssl))
  161. $(eval $(call BuildPackage,nmap-full))
  162. $(eval $(call BuildPackage,ncat))
  163. $(eval $(call BuildPackage,ncat-ssl))
  164. $(eval $(call BuildPackage,ncat-full))
  165. $(eval $(call BuildPackage,nping))
  166. $(eval $(call BuildPackage,nping-ssl))
  167. $(eval $(call Py3Package,ndiff))
  168. $(eval $(call BuildPackage,ndiff))
  169. $(eval $(call BuildPackage,ndiff-src))