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.

207 lines
5.1 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.80
  14. PKG_RELEASE:=2
  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:=fcfa5a0e42099e12e4bf7a68ebe6fde05553383a682e816a7ec9256ab4773faa
  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-nmap-update \
  99. --without-subversion \
  100. --without-zenmap
  101. # --with-libnbase=included
  102. # --with-libnsock=included
  103. # --without-apr
  104. ifeq ($(BUILD_VARIANT),full)
  105. CONFIGURE_ARGS += \
  106. --with-liblua="$(STAGING_DIR)/usr" \
  107. --with-libssh2="$(STAGING_DIR)/usr" \
  108. --with-openssl="$(STAGING_DIR)/usr" \
  109. --without-nping
  110. else ifeq ($(BUILD_VARIANT),ssl)
  111. CONFIGURE_ARGS += \
  112. --with-nping \
  113. --with-openssl="$(STAGING_DIR)/usr" \
  114. --without-liblua \
  115. --without-libssh2
  116. else # nossl
  117. CONFIGURE_ARGS += \
  118. --with-nping \
  119. --without-liblua \
  120. --without-libssh2 \
  121. --without-openssl
  122. endif
  123. CONFIGURE_VARS += \
  124. ac_cv_dnet_bsd_bpf=no
  125. PYTHON3_PKG_SETUP_DIR:=ndiff
  126. PYTHON3_PKG_SETUP_ARGS:=
  127. define Build/Compile
  128. $(call Build/Compile/Default,)
  129. $(call Py3Build/Compile)
  130. endef
  131. define Package/nmap/install
  132. $(INSTALL_DIR) $(1)/usr/bin
  133. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nmap $(1)/usr/bin/
  134. $(INSTALL_DIR) $(1)/usr/share/nmap
  135. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/nmap/nmap* $(1)/usr/share/nmap/
  136. endef
  137. Package/nmap-ssl/install=$(Package/nmap/install)
  138. define Package/nmap-full/install
  139. $(call Package/nmap/install,$(1))
  140. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/nmap/nse_main.lua $(1)/usr/share/nmap/
  141. $(CP) $(PKG_INSTALL_DIR)/usr/share/nmap/{nselib,scripts} $(1)/usr/share/nmap/
  142. endef
  143. define Package/ncat/install
  144. $(INSTALL_DIR) $(1)/usr/bin
  145. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ncat $(1)/usr/bin/
  146. endef
  147. define Package/ncat-ssl/install
  148. $(call Package/ncat/install,$(1))
  149. $(INSTALL_DIR) $(1)/usr/share/ncat
  150. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/ncat/ca-bundle.crt $(1)/usr/share/ncat/
  151. endef
  152. Package/ncat-full/install=$(Package/ncat-ssl/install)
  153. define Package/nping/install
  154. $(INSTALL_DIR) $(1)/usr/bin
  155. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nping $(1)/usr/bin/
  156. endef
  157. Package/nping-ssl/install=$(Package/nping/install)
  158. define Py3Package/ndiff/install
  159. $(INSTALL_DIR) $(1)/usr/bin
  160. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ndiff $(1)/usr/bin/
  161. endef
  162. $(eval $(call BuildPackage,nmap))
  163. $(eval $(call BuildPackage,nmap-ssl))
  164. $(eval $(call BuildPackage,nmap-full))
  165. $(eval $(call BuildPackage,ncat))
  166. $(eval $(call BuildPackage,ncat-ssl))
  167. $(eval $(call BuildPackage,ncat-full))
  168. $(eval $(call BuildPackage,nping))
  169. $(eval $(call BuildPackage,nping-ssl))
  170. $(eval $(call Py3Package,ndiff))
  171. $(eval $(call BuildPackage,ndiff))
  172. $(eval $(call BuildPackage,ndiff-src))