mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
gnu: nmap: Update to 7.96.
* gnu/packages/admin.scm (nmap): Update to 7.96. [inputs]: Remove lua, pcre, and python-2; add lua-5.4, pcre2, perl, and python-wrapper. [native-inputs]: Add python-pypa-build, python-setuptools, and python-wheel. [arguments]: Use GEXPs. Remove "patch-Makefile" phase. Add "patch-Makefile.in" phase. Update "install" phase. Change-Id: I31da6982da6ced4489e6f330d5e7eeabe1e648cc
This commit is contained in:
parent
770c9078fa
commit
2d2a921e99
1 changed files with 60 additions and 46 deletions
|
@ -3744,14 +3744,14 @@ rules is done with the @code{auditctl} utility.")
|
|||
(define-public nmap
|
||||
(package
|
||||
(name "nmap")
|
||||
(version "7.93")
|
||||
(version "7.96")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append "https://nmap.org/dist/nmap-" version
|
||||
".tar.bz2"))
|
||||
(sha256
|
||||
(base32
|
||||
"0lb6s4nmmicfnc221mzgx2w51dcd4b2dhx22pabcqnp2jd3zxg2m"))
|
||||
"12lcvyzfl1hblbklcss44dr92fr86w0z1y1a90yilv5n5x7pmblq"))
|
||||
(modules '((guix build utils)))
|
||||
(snippet
|
||||
'(begin
|
||||
|
@ -3766,55 +3766,69 @@ rules is done with the @code{auditctl} utility.")
|
|||
(build-system gnu-build-system)
|
||||
(outputs '("out" "ndiff")) ; TODO Add zenmap output
|
||||
(arguments
|
||||
`(#:configure-flags '("--without-zenmap")
|
||||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-after 'configure 'patch-Makefile
|
||||
(lambda _
|
||||
(substitute* "Makefile"
|
||||
;; Do not attempt to build lua.
|
||||
(("build-dnet build-lua") "build-dnet"))))
|
||||
(replace 'install
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(define (make out . args)
|
||||
(apply invoke "make"
|
||||
(string-append "prefix=" out)
|
||||
args))
|
||||
(define (python-path dir)
|
||||
(string-append dir "/lib/python"
|
||||
,(version-major+minor
|
||||
(package-version python))
|
||||
"/site-packages"))
|
||||
(let ((out (assoc-ref outputs "out"))
|
||||
(ndiff (assoc-ref outputs "ndiff")))
|
||||
(for-each mkdir-p (list out ndiff))
|
||||
(make out
|
||||
"install-nmap"
|
||||
"install-nse"
|
||||
"install-ncat"
|
||||
"install-nping")
|
||||
(make ndiff "install-ndiff")
|
||||
(wrap-program (string-append ndiff "/bin/ndiff")
|
||||
`("GUIX_PYTHONPATH" prefix
|
||||
(,(python-path ndiff)))))))
|
||||
;; These are the tests that do not require network access.
|
||||
(replace 'check
|
||||
(lambda* (#:key tests? #:allow-other-keys)
|
||||
(when tests?
|
||||
(invoke "make"
|
||||
"check-nse"
|
||||
"check-ndiff"
|
||||
"check-dns")))))
|
||||
;; Nmap can't cope with out-of-source building.
|
||||
#:out-of-source? #f))
|
||||
(list
|
||||
#:configure-flags #~(list "--without-zenmap")
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(add-after 'unpack 'patch-Makefile.in
|
||||
(lambda _
|
||||
(substitute* "Makefile.in"
|
||||
(("\\$\\(PYTHON\\) -m build \\$\\(NDIFFDIR\\)/")
|
||||
"$(PYTHON) -m build --wheel --no-isolation $(NDIFFDIR)/")
|
||||
(("\\$\\(PYTHON\\) -m pip install \\$\\(NDIFFDIR\\).*")
|
||||
(string-append "pip"
|
||||
" --no-cache-dir"
|
||||
" --no-input"
|
||||
" install"
|
||||
" --no-build-isolation"
|
||||
" --no-deps"
|
||||
" --prefix"
|
||||
" $(prefix)"
|
||||
" $(NDIFFDIR)/\n")))))
|
||||
(replace 'install
|
||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||
(define (make out . args)
|
||||
(apply invoke "make"
|
||||
(string-append "PYTHON="
|
||||
(search-input-file inputs "/bin/python"))
|
||||
(string-append "CC=" #$(cc-for-target))
|
||||
(string-append "prefix=" out)
|
||||
args))
|
||||
(define (python-path dir)
|
||||
(string-append dir "/lib/python"
|
||||
#$(version-major+minor
|
||||
(package-version python))
|
||||
"/site-packages"))
|
||||
(let ((ndiff (assoc-ref outputs "ndiff")))
|
||||
(for-each mkdir-p (list #$output ndiff))
|
||||
(make #$output
|
||||
"install-nmap"
|
||||
"install-nse"
|
||||
"install-ncat"
|
||||
"install-nping")
|
||||
(make ndiff "install-ndiff")
|
||||
(wrap-program (string-append ndiff "/bin/ndiff")
|
||||
`("GUIX_PYTHONPATH" prefix
|
||||
(,(python-path ndiff)))))))
|
||||
;; These are the tests that do not require network access.
|
||||
(replace 'check
|
||||
(lambda* (#:key tests? #:allow-other-keys)
|
||||
(when tests?
|
||||
(invoke "make"
|
||||
"check-nse"
|
||||
"check-ndiff")))))
|
||||
;; Nmap can't cope with out-of-source building.
|
||||
#:out-of-source? #f))
|
||||
(native-inputs (list python-pypa-build python-setuptools python-wheel))
|
||||
(inputs
|
||||
(list bash-minimal ;for wrap-program
|
||||
libpcap
|
||||
lua
|
||||
lua-5.4
|
||||
openssl-3.0
|
||||
pcre
|
||||
pcre2
|
||||
zlib ; for NSE compression
|
||||
python-2)) ; for ndiff
|
||||
perl
|
||||
python-wrapper)) ; for ndiff
|
||||
(home-page "https://nmap.org/")
|
||||
(synopsis "Network discovery and security auditing tool")
|
||||
(description
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue