aboutsummaryrefslogtreecommitdiff
path: root/ports/nmap
diff options
context:
space:
mode:
Diffstat (limited to 'ports/nmap')
-rw-r--r--ports/nmap/CONTROL4
-rw-r--r--ports/nmap/portfile.cmake33
-rw-r--r--ports/nmap/vcpkg.json25
3 files changed, 42 insertions, 20 deletions
diff --git a/ports/nmap/CONTROL b/ports/nmap/CONTROL
deleted file mode 100644
index a703b496f..000000000
--- a/ports/nmap/CONTROL
+++ /dev/null
@@ -1,4 +0,0 @@
-Source: nmap
-Version: 7.70-4
-Build-Depends: winpcap (windows), libpcap (!windows), lua, openssl, python2 (windows), libssh2, zlib, pcre
-Description: A library for scanning network ports.
diff --git a/ports/nmap/portfile.cmake b/ports/nmap/portfile.cmake
index 829153310..c0252af8d 100644
--- a/ports/nmap/portfile.cmake
+++ b/ports/nmap/portfile.cmake
@@ -58,59 +58,60 @@ if(VCPKG_TARGET_IS_WINDOWS)
endif()
else()
set(ENV{LDFLAGS} "$ENV{LDFLAGS} -pthread")
- foreach(BUILD_TYPE rel dbg)
- file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE})
- file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE})
- # Since nmap makefile has strong relationshop with codes, copy codes to obj path
- vcpkg_extract_source_archive(${ARCHIVE} ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE})
-
- endforeach()
set(OPTIONS --without-nmap-update --with-openssl=${CURRENT_INSTALLED_DIR} --with-libssh2=${CURRENT_INSTALLED_DIR} --with-libz=${CURRENT_INSTALLED_DIR} --with-libpcre=${CURRENT_INSTALLED_DIR})
message(STATUS "Building Options: ${OPTIONS}")
if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL Release)
+ # Since nmap makefile has strong relationshop with codes, copy codes to obj path
message(STATUS "Configuring ${TARGET_TRIPLET}-rel")
- set(SOURCE_PATH_RELEASE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/nmap-7.70)
+ vcpkg_extract_source_archive(source_path_release
+ ARCHIVE "${ARCHIVE}"
+ WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel"
+ )
vcpkg_execute_required_process(
COMMAND "./configure" ${OPTIONS}
- WORKING_DIRECTORY ${SOURCE_PATH_RELEASE}
+ WORKING_DIRECTORY "${source_path_release}"
LOGNAME config-${TARGET_TRIPLET}-rel
)
message(STATUS "Building ${TARGET_TRIPLET}-rel")
vcpkg_execute_required_process(
COMMAND make
- WORKING_DIRECTORY ${SOURCE_PATH_RELEASE}
+ WORKING_DIRECTORY "${source_path_release}"
LOGNAME build-${TARGET_TRIPLET}-rel
)
message(STATUS "Installing ${TARGET_TRIPLET}-rel")
- file(INSTALL ${SOURCE_PATH_RELEASE}/nmap DESTINATION ${CURRENT_PACKAGES_DIR}/tools)
+ file(INSTALL ${source_path_release}/nmap DESTINATION ${CURRENT_PACKAGES_DIR}/tools)
endif()
if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL Debug)
+ # Since nmap makefile has strong relationshop with codes, copy codes to obj path
message(STATUS "Configuring ${TARGET_TRIPLET}-dbg")
- set(SOURCE_PATH_DEBUG ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/nmap-7.70)
+ vcpkg_extract_source_archive(source_path_debug
+ ARCHIVE "${ARCHIVE}"
+ WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel"
+ )
vcpkg_execute_required_process(
COMMAND "./configure" ${OPTIONS}
- WORKING_DIRECTORY ${SOURCE_PATH_DEBUG}
+ WORKING_DIRECTORY ${source_path_debug}
LOGNAME config-${TARGET_TRIPLET}-dbg
)
message(STATUS "Building ${TARGET_TRIPLET}-dbg")
vcpkg_execute_required_process(
COMMAND make
- WORKING_DIRECTORY ${SOURCE_PATH_DEBUG}
+ WORKING_DIRECTORY ${source_path_debug}
LOGNAME build-${TARGET_TRIPLET}-dbg
)
message(STATUS "Installing ${TARGET_TRIPLET}-dbg")
- file(INSTALL ${SOURCE_PATH_RELEASE}/nmap DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools)
+ file(INSTALL ${source_path_release}/nmap DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools)
endif()
- set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/nmap-7.70)
+ set(SOURCE_PATH "${source_path_release}")
endif()
vcpkg_copy_pdbs()
diff --git a/ports/nmap/vcpkg.json b/ports/nmap/vcpkg.json
new file mode 100644
index 000000000..6aba23611
--- /dev/null
+++ b/ports/nmap/vcpkg.json
@@ -0,0 +1,25 @@
+{
+ "name": "nmap",
+ "version": "7.70",
+ "port-version": 5,
+ "description": "A library for scanning network ports.",
+ "dependencies": [
+ {
+ "name": "libpcap",
+ "platform": "!windows"
+ },
+ "libssh2",
+ "lua",
+ "openssl",
+ "pcre",
+ {
+ "name": "python2",
+ "platform": "windows"
+ },
+ {
+ "name": "winpcap",
+ "platform": "windows"
+ },
+ "zlib"
+ ]
+}