gnu: fish: Update to 2.7.1.
[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>
938081b9
AE
4;;;
5;;; This file is part of GNU Guix.
6;;;
7;;; GNU Guix is free software; you can redistribute it and/or modify it
8;;; under the terms of the GNU General Public License as published by
9;;; the Free Software Foundation; either version 3 of the License, or (at
10;;; your option) any later version.
11;;;
12;;; GNU Guix is distributed in the hope that it will be useful, but
13;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;;; GNU General Public License for more details.
16;;;
17;;; You should have received a copy of the GNU General Public License
18;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20(define-module (gnu packages lsof)
b5b73a82 21 #:use-module ((guix licenses) #:prefix license:)
938081b9
AE
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system gnu)
25 #:use-module (gnu packages perl))
26
9a0569aa
LC
27(define %ftp-base
28 "ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/")
29
938081b9
AE
30(define-public lsof
31 (package
32 (name "lsof")
e18e17ea 33 (version "4.89")
938081b9
AE
34 (source (origin
35 (method url-fetch)
9a0569aa
LC
36 (uri (list (string-append %ftp-base "lsof_"
37 version ".tar.bz2")
38 (string-append %ftp-base "OLD/lsof_"
d45d8904
LC
39 version ".tar.bz2")
40
41 ;; Add mirrors because the FTP server at purdue.edu
42 ;; bails out when it cannot do a reverse DNS lookup, as
43 ;; noted at <http://people.freebsd.org/~abe/>.
44 (string-append
45 "ftp://ftp.fu-berlin.de/pub/unix/tools/lsof/lsof_"
46 version ".tar.bz2")
d5fa9fd1
EF
47 (string-append
48 "ftp://ftp.fu-berlin.de/pub/unix/tools/lsof/OLD/lsof_"
49 version ".tar.bz2")
d45d8904
LC
50 (string-append
51 "ftp://sunsite.ualberta.ca/pub/Mirror/lsof/lsof_"
52 version ".tar.bz2")))
9a0569aa
LC
53 (sha256
54 (base32
e18e17ea 55 "061p18v0mhzq517791xkjs8a5dfynq1418a1mwxpji69zp2jzb41"))))
938081b9
AE
56 (build-system gnu-build-system)
57 (inputs `(("perl" ,perl)))
58 (arguments
59 `(#:tests? #f ; no test target
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")
71 (zero? (system* "./Configure" "linux"))))
72 (replace 'install
73 (lambda* (#:key outputs #:allow-other-keys)
74 (let ((out (assoc-ref outputs "out")))
4ae3549f
EF
75 (install-file "lsof" (string-append out "/bin"))
76 (install-file "lsof.8" (string-append out "/share/man/man8")))
77 #t)))))
35b9e423 78 (synopsis "Display information about open files")
938081b9
AE
79 (description
80 "Lsof stands for LiSt Open Files, and it does just that.
81It lists information about files that are open by the processes running
82on the system.")
83 (license (license:fsf-free
84 "file://00FAQ"
85 "License inspired by zlib, see point 1.9 of 00FAQ in the distribution."))
86 (home-page "http://people.freebsd.org/~abe/")))