gnu: r-gviz: Update to 1.24.0.
[jackhill/guix/guix.git] / gnu / packages / lsof.scm
CommitLineData
938081b9
AE
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
b6ea329a 3;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
5ae76e8f 4;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
938081b9
AE
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21(define-module (gnu packages lsof)
b5b73a82 22 #:use-module ((guix licenses) #:prefix license:)
938081b9
AE
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix build-system gnu)
26 #:use-module (gnu packages perl))
27
28(define-public lsof
29 (package
30 (name "lsof")
e18e17ea 31 (version "4.89")
cb443e55
TGR
32 (source
33 (origin
34 (method url-fetch)
35 (uri
36 (apply append
37 (map
38 (lambda (mirror-uri)
39 (let ((tarball (string-append name "_" version ".tar.bz2")))
40 (list
41 (string-append mirror-uri "/" tarball)
42 ;; Upon every new release, the previous one is moved here:
43 (string-append mirror-uri "/OLD/" tarball))))
44 (list
45 "ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/"
d45d8904 46
cb443e55
TGR
47 ;; Add mirrors because the canonical FTP server at purdue.edu
48 ;; bails out when it cannot do a reverse DNS lookup, as noted
49 ;; at <http://people.freebsd.org/~abe/>.
50 "ftp://ftp.fu-berlin.de/pub/unix/tools/lsof/"
51 (string-append "http://www.mirrorservice.org/sites/"
52 "lsof.itap.purdue.edu/pub/tools/unix/lsof")
53 (string-append "ftp://ftp.mirrorservice.org/sites/"
54 "lsof.itap.purdue.edu/pub/tools/unix/lsof")))))
55 (sha256
56 (base32 "061p18v0mhzq517791xkjs8a5dfynq1418a1mwxpji69zp2jzb41"))))
938081b9 57 (build-system gnu-build-system)
57774ae1 58 (native-inputs `(("perl" ,perl)))
938081b9 59 (arguments
16cb3b8f 60 `(#:phases
b6ea329a
EF
61 (modify-phases %standard-phases
62 (replace 'unpack
63 (lambda* (#:key source #:allow-other-keys)
64 (let ((unpack (assoc-ref %standard-phases 'unpack)))
65 (unpack #:source source)
66 (unpack #:source (car (find-files "." "\\.tar$"))))))
67 (replace 'configure
68 (lambda _
69 (setenv "LSOF_CC" "gcc")
70 (setenv "LSOF_MAKE" "make")
b7fd3e96
TGR
71 (invoke "./Configure" "linux")
72 #t))
c2799070
TGR
73 (add-after 'configure 'patch-timestamps
74 (lambda _
75 (substitute* "Makefile"
76 (("`date`") "`date --date=@1`"))))
16cb3b8f
TGR
77 (add-before 'check 'disable-failing-tests
78 (lambda _
79 (substitute* "tests/Makefile"
80 ;; Fails with ‘ERROR!!! client gethostbyaddr() failure’.
81 (("(STDTST=.*) LTsock" _ prefix) prefix)
82 ;; Fails without access to a remote NFS server.
83 (("(OPTTST=.*) LTnfs" _ prefix) prefix))))
84 (replace 'check
85 (lambda _
86 (with-directory-excursion "tests"
87 ;; Tests refuse to run on ‘unvalidated’ platforms.
88 (make-file-writable "TestDB")
89 (invoke "./Add2TestDB")
90
91 ;; The ‘standard’ tests suggest running ‘optional’ ones as well.
92 (invoke "make" "standard" "optional")
93 #t)))
b6ea329a
EF
94 (replace 'install
95 (lambda* (#:key outputs #:allow-other-keys)
96 (let ((out (assoc-ref outputs "out")))
4ae3549f
EF
97 (install-file "lsof" (string-append out "/bin"))
98 (install-file "lsof.8" (string-append out "/share/man/man8")))
99 #t)))))
35b9e423 100 (synopsis "Display information about open files")
938081b9
AE
101 (description
102 "Lsof stands for LiSt Open Files, and it does just that.
103It lists information about files that are open by the processes running
104on the system.")
105 (license (license:fsf-free
106 "file://00FAQ"
107 "License inspired by zlib, see point 1.9 of 00FAQ in the distribution."))
108 (home-page "http://people.freebsd.org/~abe/")))