;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013 Andreas Enge ;;; Copyright © 2017 Efraim Flashner ;;; Copyright © 2018 Tobias Geerinckx-Rice ;;; Copyright © 2018, 2019 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu packages lsof) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system gnu) #:use-module (gnu packages perl)) (define-public lsof (package (name "lsof") (version "4.91") (source (origin (method url-fetch) (uri (apply append (map (lambda (mirror-uri) (let ((tarball (string-append name "_" version ".tar.bz2"))) (list (string-append mirror-uri "/" tarball) ;; Upon every new release, the previous one is moved here: (string-append mirror-uri "/OLD/" tarball)))) (list "ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/" ;; Add mirrors because the canonical FTP server at purdue.edu ;; bails out when it cannot do a reverse DNS lookup, as noted ;; at . "ftp://ftp.fu-berlin.de/pub/unix/tools/lsof/" (string-append "http://www.mirrorservice.org/sites/" "lsof.itap.purdue.edu/pub/tools/unix/lsof") (string-append "ftp://ftp.mirrorservice.org/sites/" "lsof.itap.purdue.edu/pub/tools/unix/lsof"))))) (sha256 (base32 "18sh4hbl9jw2szkf0gvgan8g13f3g4c6s2q9h3zq5gsza9m99nn9")))) (build-system gnu-build-system) (native-inputs `(("perl" ,perl))) (arguments `(#:phases (modify-phases %standard-phases (replace 'unpack (lambda* (#:key source #:allow-other-keys) (let ((unpack (assoc-ref %standard-phases 'unpack))) (unpack #:source source) (unpack #:source (car (find-files "." "\\.tar$")))))) (replace 'configure (lambda _ (setenv "LSOF_CC" "gcc") (setenv "LSOF_MAKE" "make") ;; By default, the makefile captures the output of 'uname -a'. ;; Provide a fixed output instead to make builds reproducible. (setenv "LSOF_SYSINFO" (string-append "GNU/" (utsname:sysname (uname)) " (GNU Guix)")) (invoke "./Configure" "linux") #t)) (add-after 'configure 'patch-timestamps (lambda _ (substitute* "Makefile" (("`date`") "`date --date=@1`")) #t)) (add-before 'check 'disable-failing-tests (lambda _ ;; In libc 2.28, the 'major' and 'minor' macros are provided by ;; only so include it. (substitute* "tests/LTlib.c" (("#ifndef lint") "#include \n\n#ifndef lint")) (substitute* "tests/Makefile" ;; Fails with ‘ERROR!!! client gethostbyaddr() failure’. (("(STDTST=.*) LTsock" _ prefix) prefix) ;; Fails without access to a remote NFS server. (("(OPTTST=.*) LTnfs" _ prefix) prefix)) #t)) (replace 'check (lambda _ (with-directory-excursion "tests" ;; Tests refuse to run on ‘unvalidated’ platforms. (make-file-writable "TestDB") (invoke "./Add2TestDB") ;; The ‘standard’ tests suggest running ‘optional’ ones as well. (invoke "make" "standard" "optional") #t))) (replace 'install (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) (install-file "lsof" (string-append out "/bin")) (install-file "lsof.8" (string-append out "/share/man/man8"))) #t))))) (synopsis "Display information about open files") (description "Lsof stands for LiSt Open Files, and it does just that. It lists information about files that are open by the processes running on the system.") (license (license:fsf-free "file://00FAQ" "License inspired by zlib, see point 1.9 of 00FAQ in the distribution.")) (home-page "https://people.freebsd.org/~abe/"))) , gnu/packages/databases.scm, gnu/packages/django.scm, gnu/packages/dns.scm, gnu/packages/elixir.scm, gnu/packages/emacs-xyz.scm, gnu/packages/emacs.scm, gnu/packages/enlightenment.scm, gnu/packages/erlang.scm, gnu/packages/fonts.scm, gnu/packages/fontutils.scm, gnu/packages/forth.scm, gnu/packages/fvwm.scm, gnu/packages/games.scm, gnu/packages/gl.scm, gnu/packages/gnome.scm, gnu/packages/gnunet.scm, gnu/packages/gnupg.scm, gnu/packages/gtk.scm, gnu/packages/guile-wm.scm, gnu/packages/guile-xyz.scm, gnu/packages/haskell-apps.scm, gnu/packages/haskell-check.scm, gnu/packages/haskell-crypto.scm, gnu/packages/haskell-xyz.scm, gnu/packages/haskell.scm, gnu/packages/image-viewers.scm, gnu/packages/image.scm, gnu/packages/irc.scm, gnu/packages/language.scm, gnu/packages/libcanberra.scm, gnu/packages/linux.scm, gnu/packages/lisp-xyz.scm, gnu/packages/lisp.scm, gnu/packages/lolcode.scm, gnu/packages/lxde.scm, gnu/packages/lxqt.scm, gnu/packages/mail.scm, gnu/packages/markup.scm, gnu/packages/mate.scm, gnu/packages/maths.scm, gnu/packages/mc.scm, gnu/packages/messaging.scm, gnu/packages/music.scm, gnu/packages/ncurses.scm, gnu/packages/networking.scm, gnu/packages/nickle.scm, gnu/packages/openbox.scm, gnu/packages/pdf.scm, gnu/packages/perl-check.scm, gnu/packages/perl.scm, gnu/packages/python-compression.scm, gnu/packages/python-crypto.scm, gnu/packages/python-web.scm, gnu/packages/python-xyz.scm, gnu/packages/python.scm, gnu/packages/qt.scm, gnu/packages/ruby.scm, gnu/packages/rust.scm, gnu/packages/scheme.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/ssh.scm, gnu/packages/suckless.scm, gnu/packages/tbb.scm, gnu/packages/telephony.scm, gnu/packages/text-editors.scm, gnu/packages/textutils.scm, gnu/packages/time.scm, gnu/packages/tls.scm, gnu/packages/tor.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/vim.scm, gnu/packages/web.scm, gnu/packages/wm.scm, gnu/packages/xdisorg.scm, gnu/packages/xfce.scm, gnu/packages/xml.scm, gnu/packages/xorg.scm, gnu/services/certbot.scm, gnu/services/desktop.scm, gnu/services/version-control.scm, gnu/services/web.scm, guix/import/hackage.scm, guix/licenses.scm: Likewise. Signed-off-by: Efraim Flashner <efraim@flashner.co.il> nikita