1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
4 ;;; This file is part of GNU Guix.
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19 (define-module (gnu packages lsof)
20 #:use-module ((guix licenses) #:prefix license:)
21 #:use-module (guix packages)
22 #:use-module (guix download)
23 #:use-module (guix build-system gnu)
24 #:use-module (gnu packages perl))
27 "ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/")
35 (uri (list (string-append %ftp-base "lsof_"
37 (string-append %ftp-base "OLD/lsof_"
40 ;; Add mirrors because the FTP server at purdue.edu
41 ;; bails out when it cannot do a reverse DNS lookup, as
42 ;; noted at <http://people.freebsd.org/~abe/>.
44 "ftp://ftp.fu-berlin.de/pub/unix/tools/lsof/lsof_"
47 "ftp://sunsite.ualberta.ca/pub/Mirror/lsof/lsof_"
51 "16y9wm26rg81mihnzcbdg8h8vhxmq8kn62ssxb8cqydp4q79nvzy"))))
52 (build-system gnu-build-system)
53 (inputs `(("perl" ,perl)))
55 `(#:tests? #f ; no test target
59 (lambda* (#:key source #:allow-other-keys)
60 (let ((unpack (assoc-ref %standard-phases 'unpack)))
61 (unpack #:source source)
62 (unpack #:source (car (find-files "." "\\.tar$")))))
66 (setenv "LSOF_CC" "gcc")
67 (setenv "LSOF_MAKE" "make")
68 (system* "./Configure" "linux"))
71 (lambda* (#:key outputs #:allow-other-keys)
72 (let ((out (assoc-ref outputs "out")))
74 (mkdir (string-append out "/bin"))
75 (copy-file "lsof" (string-append out "/bin/lsof"))
76 (mkdir (string-append out "/share"))
77 (mkdir (string-append out "/share/man"))
78 (mkdir (string-append out "/share/man/man8"))
79 (copy-file "lsof.8" (string-append out "/share/man/man8/lsof.8"))
82 (synopsis "Display information about open files")
84 "Lsof stands for LiSt Open Files, and it does just that.
85 It lists information about files that are open by the processes running
87 (license (license:fsf-free
89 "License inspired by zlib, see point 1.9 of 00FAQ in the distribution."))
90 (home-page "http://people.freebsd.org/~abe/")))