| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 |
|
| 22 | (define-module (gnu packages lsof)
|
| 23 | #:use-module ((guix licenses) #:prefix license:)
|
| 24 | #:use-module (guix packages)
|
| 25 | #:use-module (guix download)
|
| 26 | #:use-module (guix build-system gnu)
|
| 27 | #:use-module (gnu packages perl))
|
| 28 |
|
| 29 | (define-public lsof
|
| 30 | (package
|
| 31 | (name "lsof")
|
| 32 | (version "4.91")
|
| 33 | (source
|
| 34 | (origin
|
| 35 | (method url-fetch)
|
| 36 | (uri
|
| 37 | (apply append
|
| 38 | (map
|
| 39 | (lambda (mirror-uri)
|
| 40 | (let ((tarball (string-append name "_" version ".tar.bz2")))
|
| 41 | (list
|
| 42 | (string-append mirror-uri "/" tarball)
|
| 43 | |
| 44 | (string-append mirror-uri "/OLD/" tarball))))
|
| 45 | (list
|
| 46 | "ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/"
|
| 47 |
|
| 48 | |
| 49 | |
| 50 | |
| 51 | "ftp://ftp.fu-berlin.de/pub/unix/tools/lsof/"
|
| 52 | (string-append "http://www.mirrorservice.org/sites/"
|
| 53 | "lsof.itap.purdue.edu/pub/tools/unix/lsof")
|
| 54 | (string-append "ftp://ftp.mirrorservice.org/sites/"
|
| 55 | "lsof.itap.purdue.edu/pub/tools/unix/lsof")))))
|
| 56 | (sha256
|
| 57 | (base32 "18sh4hbl9jw2szkf0gvgan8g13f3g4c6s2q9h3zq5gsza9m99nn9"))))
|
| 58 | (build-system gnu-build-system)
|
| 59 | (native-inputs `(("perl" ,perl)))
|
| 60 | (arguments
|
| 61 | `(#:phases
|
| 62 | (modify-phases %standard-phases
|
| 63 | (replace 'unpack
|
| 64 | (lambda* (#:key source #:allow-other-keys)
|
| 65 | (let ((unpack (assoc-ref %standard-phases 'unpack)))
|
| 66 | (unpack #:source source)
|
| 67 | (unpack #:source (car (find-files "." "\\.tar$"))))))
|
| 68 | (replace 'configure
|
| 69 | (lambda _
|
| 70 | (setenv "LSOF_CC" "gcc")
|
| 71 | (setenv "LSOF_MAKE" "make")
|
| 72 |
|
| 73 | |
| 74 | |
| 75 | (setenv "LSOF_SYSINFO"
|
| 76 | (string-append "GNU/" (utsname:sysname (uname))
|
| 77 | " (GNU Guix)"))
|
| 78 |
|
| 79 | (invoke "./Configure" "linux")
|
| 80 | #t))
|
| 81 | (add-after 'configure 'patch-timestamps
|
| 82 | (lambda _
|
| 83 | (substitute* "Makefile"
|
| 84 | (("`date`") "`date --date=@1`"))
|
| 85 | #t))
|
| 86 | (add-before 'check 'disable-failing-tests
|
| 87 | (lambda _
|
| 88 | |
| 89 | |
| 90 | (substitute* "tests/LTlib.c"
|
| 91 | (("#ifndef lint")
|
| 92 | "#include <sys/sysmacros.h>\n\n#ifndef lint"))
|
| 93 |
|
| 94 | (substitute* "tests/Makefile"
|
| 95 | |
| 96 | (("(STDTST=.*) LTsock" _ prefix) prefix)
|
| 97 | |
| 98 | (("(OPTTST=.*) LTnfs" _ prefix) prefix))
|
| 99 | #t))
|
| 100 | (replace 'check
|
| 101 | (lambda _
|
| 102 | (with-directory-excursion "tests"
|
| 103 | |
| 104 | (make-file-writable "TestDB")
|
| 105 | (invoke "./Add2TestDB")
|
| 106 |
|
| 107 | |
| 108 | (invoke "make" "standard" "optional")
|
| 109 | #t)))
|
| 110 | (replace 'install
|
| 111 | (lambda* (#:key outputs #:allow-other-keys)
|
| 112 | (let ((out (assoc-ref outputs "out")))
|
| 113 | (install-file "lsof" (string-append out "/bin"))
|
| 114 | (install-file "lsof.8" (string-append out "/share/man/man8")))
|
| 115 | #t)))))
|
| 116 | (synopsis "Display information about open files")
|
| 117 | (description
|
| 118 | "Lsof stands for LiSt Open Files, and it does just that.
|
| 119 | It lists information about files that are open by the processes running
|
| 120 | on the system.")
|
| 121 | (license (license:fsf-free
|
| 122 | "file://00FAQ"
|
| 123 | "License inspired by zlib, see point 1.9 of 00FAQ in the distribution."))
|
| 124 | (home-page "https://people.freebsd.org/~abe/")))
|