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:=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:=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. include $(INCLUDE_DIR)/package.mk
  25. include ../../lang/python/python3-package.mk
  26. NMAP_DEPENDS:=+libpcap +libstdcpp +zlib +libpcre
  27. NCAT_DEPENDS:=+libpcap
  28. NPING_DEPENDS:=+libpcap +libpthread +libstdcpp
  29. define Package/nmap/default
  30. SUBMENU:=NMAP Suite
  31. SECTION:=net
  32. CATEGORY:=Network
  33. URL:=https://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/nmap-full
  48. $(call Package/nmap/default)
  49. DEPENDS:=$(NMAP_DEPENDS) +libopenssl +liblua5.3 +libssh2
  50. VARIANT:=full
  51. TITLE:=Nmap (with OpenSSL and scripting support)
  52. endef
  53. define Package/ncat
  54. $(call Package/nmap/default)
  55. DEPENDS:=$(NCAT_DEPENDS)
  56. VARIANT:=nossl
  57. TITLE:=Much-improved reimplementation of Netcat
  58. endef
  59. define Package/ncat-ssl
  60. $(call Package/nmap/default)
  61. DEPENDS:=$(NCAT_DEPENDS) +libopenssl
  62. VARIANT:=ssl
  63. TITLE:=Ncat (with OpenSSL support)
  64. endef
  65. define Package/ncat-full
  66. $(call Package/nmap/default)
  67. DEPENDS:=$(NCAT_DEPENDS) +libopenssl +liblua5.3
  68. VARIANT:=full
  69. TITLE:=Ncat (with OpenSSL and scripting support)
  70. endef
  71. define Package/nping
  72. $(call Package/nmap/default)
  73. DEPENDS:=$(NPING_DEPENDS)
  74. VARIANT:=nossl
  75. TITLE:=Network packet generation tool / ping utility
  76. endef
  77. define Package/nping-ssl
  78. $(call Package/nmap/default)
  79. DEPENDS:=$(NPING_DEPENDS) +libopenssl
  80. VARIANT:=ssl
  81. TITLE:=Nping (with OpenSSL support)
  82. endef
  83. define Package/ndiff
  84. $(call Package/nmap/default)
  85. DEPENDS:=+python3-light +python3-xml
  86. VARIANT:=python3
  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. ifeq ($(BUILD_VARIANT),python3)
  128. Build/Configure:=:
  129. Build/Install:=:
  130. endif
  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))