aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018, 2019 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;;
;;; 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 <http://www.gnu.org/licenses/>.

(define-module (gnu packages lsof)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix git-download)
  #:use-module (guix build-system gnu)
  #:use-module (guix utils)
  #:use-module (gnu packages)
  #:use-module (gnu packages groff)
  #:use-module (gnu packages perl))

(define-public lsof
  (package
    (name "lsof")
    (version "4.94.0")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/lsof-org/lsof")
             (commit version)))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0yxv2jg6rnzys49lyrz9yjb4knamah4xvlqj596y6ix3vm4k3chp"))
       (patches (search-patches "lsof-fatal-test-failures.patch"))))
    (build-system gnu-build-system)
    (native-inputs
     (list groff ; for soelim
           perl))
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (replace 'configure
           (lambda _
             (setenv "LSOF_CC" ,(cc-for-target))
             ,@(if (%current-target-system)
                   '((setenv "LINUX_CONF_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")))
         (add-after 'configure 'patch-timestamps
           (lambda _
             (substitute* "Makefile"
               (("`date`") "`date --date=@1`"))))
         (add-after 'build 'build-man-page
           (lambda _
             (with-output-to-file "lsof.8"
               (lambda _ (invoke "soelim" "Lsof.8")))))
         (add-before 'check 'disable-failing-tests
           (lambda _
             (substitute* "tests/Makefile"
               ;; Fails with ‘ERROR!!! client gethostbyaddr() failure’.
               (("(STDTST=.*) LTsock" _ prefix) prefix)
               ;; LTnfs fails without access to a remote NFS server, and LTlock
               ;; fails when run on a Btrfs file system (see:
               ;; https://github.com/lsof-org/lsof/issues/152).
               (("OPTTST=[[:space:]]*LTbigf LTdnlc LTlock LTnfs")
                "OPTTST = LTbigf LTdnlc"))))
         (replace 'check
           (lambda* (#:key tests? #:allow-other-keys)
             (when tests?
               (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")))))
         (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"))))))))
    (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/")))
/packages/python-xyz.scm (python-requests-file)[description]: Likewise & mark up. * gnu/packages/rails.scm (ruby-with-advisory-lock)[description]: Likewise. * gnu/packages/ruby.scm (ruby-rerun)[description]: Likewise. * guix/build/go-build-system.scm (setup-go-environment)<docstring>: Likewise. * guix/store/deduplication.scm (get-temp-link)<docstring>: Likewise. 2019-04-04gnu: Move nss & co. to nss.scm.Ludovic Courtès * gnu/packages/gnuzilla.scm (nspr, nss): Move to... * gnu/packages/nss.scm: ... here. New file. * gnu/packages/chromium.scm, gnu/packages/disk.scm, gnu/packages/freedesktop.scm, gnu/packages/gnome.scm, gnu/packages/gnunet.scm, gnu/packages/java.scm, gnu/packages/libreoffice.scm, gnu/packages/linux.scm, gnu/packages/mate.scm, gnu/packages/openldap.scm, gnu/packages/package-management.scm, gnu/packages/password-utils.scm, gnu/packages/polkit.scm, gnu/packages/qt.scm, gnu/packages/sssd.scm, gnu/packages/storage.scm, gnu/packages/vpn.scm, gnu/packages/web.scm, gnu/packages/xml.scm: Adjust accordingly. * gnu/local.mk (GNU_SYSTEM_MODULES): Add nss.scm. 2019-02-27gnu: libblockdev: Update to 2.21.Tobias Geerinckx-Rice * gnu/packages/disk.scm (libblockdev): Update to 2.21. 2019-02-27gnu: ddrescue: Update to 1.24.Tobias Geerinckx-Rice * gnu/packages/disk.scm (ddrescue): Update to 1.24. 2019-02-15gnu: ndctl: Update to 64.1.Tobias Geerinckx-Rice * gnu/packages/disk.scm (ndctl): Update to 64.1. [inputs]: Add keyutils. 2019-02-13gnu: gparted: Update to 0.33.0.Tobias Geerinckx-Rice * gnu/packages/disk.scm (gparted): Update to 0.33.0. 2019-02-13gnu: duperemove: Don't use unstable tarball.Tobias Geerinckx-Rice * gnu/packages/disk.scm (duperemove)[source]: Use GIT-FETCH and GIT-FILE-NAME. 2019-02-13gnu: duperemove: Update to 0.11.1.Tobias Geerinckx-Rice * gnu/packages/disk.scm (duperemove): Update to 0.11.1. 2019-01-16gnu: Move sqlite to separate module.Ricardo Wurmus * gnu/packages/databases.scm (sqlite, sqlite-3.26.0, sqlite-with-fts5, sqlite-with-column-metadata): Move variables from here... * gnu/packages/sqlite.scm: ...to this new module. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. * gnu/packages/apl.scm, gnu/packages/bittorrent.scm, gnu/packages/calendar.scm, gnu/packages/code.scm, gnu/packages/crypto.scm, gnu/packages/databases.scm, gnu/packages/dc.scm, gnu/packages/disk.scm, gnu/packages/ebook.scm, gnu/packages/education.scm, gnu/packages/emacs.scm, gnu/packages/emulators.scm, gnu/packages/file-systems.scm, gnu/packages/freedesktop.scm, gnu/packages/ftp.scm, gnu/packages/games.scm, gnu/packages/geo.scm, gnu/packages/gnome.scm, gnu/packages/gnunet.scm, gnu/packages/gnupg.scm, gnu/packages/gnuzilla.scm, gnu/packages/gps.scm, gnu/packages/guile.scm, gnu/packages/ibus.scm, gnu/packages/kerberos.scm, gnu/packages/kodi.scm, gnu/packages/lisp.scm, gnu/packages/mail.scm, gnu/packages/messaging.scm, gnu/packages/mpd.scm, gnu/packages/music.scm, gnu/packages/networking.scm, gnu/packages/nfs.scm, gnu/packages/ocaml.scm, gnu/packages/package-management.scm, gnu/packages/pdf.scm, gnu/packages/photo.scm, gnu/packages/php.scm, gnu/packages/python.scm, gnu/packages/qt.scm, gnu/packages/ruby.scm, gnu/packages/scheme.scm, gnu/packages/sync.scm, gnu/packages/syndication.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/web-browsers.scm, gnu/packages/webkit.scm: Adjust module references. 2019-01-15gnu: Separate Python core packages from the rest.Ricardo Wurmus * gnu/packages/python.scm: Move hundreds of package definitions from here... * gnu/packages/python-xyz.scm: ...to this new module. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. * gnu/packages/ada.scm, gnu/packages/admin.scm, gnu/packages/android.scm, gnu/packages/audio.scm, gnu/packages/backup.scm, gnu/packages/benchmark.scm, gnu/packages/bioinformatics.scm, gnu/packages/bittorrent.scm, gnu/packages/calendar.scm, gnu/packages/check.scm, gnu/packages/chemistry.scm, gnu/packages/cluster.scm, gnu/packages/compression.scm, gnu/packages/connman.scm, gnu/packages/crypto.scm, gnu/packages/cups.scm, gnu/packages/databases.scm, gnu/packages/dav.scm, gnu/packages/direct-connect.scm, gnu/packages/disk.scm, gnu/packages/django.scm, gnu/packages/dlang.scm, gnu/packages/docker.scm, gnu/packages/ebook.scm, gnu/packages/elf.scm, gnu/packages/emacs.scm, gnu/packages/emulators.scm, gnu/packages/engineering.scm, gnu/packages/enlightenment.scm, gnu/packages/finance.scm, gnu/packages/fltk.scm, gnu/packages/fontutils.scm, gnu/packages/freedesktop.scm, gnu/packages/game-development.scm, gnu/packages/games.scm, gnu/packages/geo.scm, gnu/packages/gl.scm, gnu/packages/glib.scm, gnu/packages/gnome.scm, gnu/packages/gnupg.scm, gnu/packages/gnuzilla.scm, gnu/packages/graph.scm, gnu/packages/graphics.scm, gnu/packages/graphviz.scm, gnu/packages/gtk.scm, gnu/packages/ham-radio.scm, gnu/packages/image-processing.scm, gnu/packages/image-viewers.scm, gnu/packages/image.scm, gnu/packages/irc.scm, gnu/packages/jrnl.scm, gnu/packages/julia.scm, gnu/packages/kde-frameworks.scm, gnu/packages/key-mon.scm, gnu/packages/libffi.scm, gnu/packages/libreoffice.scm, gnu/packages/libusb.scm, gnu/packages/lirc.scm, gnu/packages/logging.scm, gnu/packages/machine-learning.scm, gnu/packages/mail.scm, gnu/packages/mate.scm, gnu/packages/maths.scm, gnu/packages/medical.scm, gnu/packages/messaging.scm, gnu/packages/monitoring.scm, gnu/packages/mp3.scm, gnu/packages/mpd.scm, gnu/packages/music.scm, gnu/packages/networking.scm, gnu/packages/nutrition.scm, gnu/packages/openldap.scm, gnu/packages/openstack.scm, gnu/packages/package-management.scm, gnu/packages/password-utils.scm, gnu/packages/patchutils.scm, gnu/packages/pdf.scm, gnu/packages/photo.scm, gnu/packages/polkit.scm, gnu/packages/protobuf.scm, gnu/packages/python-crypto.scm, gnu/packages/python-web.scm, gnu/packages/qt.scm, gnu/packages/rdf.scm, gnu/packages/ruby.scm, gnu/packages/search.scm, gnu/packages/selinux.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/simulation.scm, gnu/packages/ssh.scm, gnu/packages/statistics.scm, gnu/packages/storage.scm, gnu/packages/sync.scm, gnu/packages/terminals.scm, gnu/packages/textutils.scm, gnu/packages/time.scm, gnu/packages/tls.scm, gnu/packages/tor.scm, gnu/packages/tryton.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/virtualization.scm, gnu/packages/vpn.scm, gnu/packages/web-browsers.scm, gnu/packages/web.scm, gnu/packages/wicd.scm, gnu/packages/xdisorg.scm, gnu/packages/xorg.scm: Update module references. 2019-01-07gnu: Add rmlint.Pierre Neidhardt * gnu/packages/disk.scm (rmlint): New variable. 2018-10-17Merge branch 'master' into core-updatesMarius Bakke 2018-10-10gnu: ranger: More test tweaks.Tobias Geerinckx-Rice There's no functional difference between 'make test_pytest' and running 'py.test' directly, but there may be in future. This follows up on commit 14173b3c6765bd8fcb2b12ea28fc27226645c7e1. * gnu/packages/disk.scm (ranger)[arguments]: Use #:test-target to run the (same) tests through 'make'. [native-inputs]: Remove left-over python-flake8 and python-pylint. 2018-10-10gnu: ranger: Update to 1.9.2.Tobias Geerinckx-Rice * gnu/packages/disk.scm (ranger): Update to 1.9.2. [native-inputs]: Order alphabetically. [arguments]: Actually run tests and remove useless #:test-target. 2018-10-10Order (gnu packages disk) module imports alphabetically.Tobias Geerinckx-Rice * gnu/packages/disk.scm (define-module): Order module imports alphabetically. 2018-10-10gnu: ndctl: Update to 63.Tobias Geerinckx-Rice * gnu/packages/disk.scm (ndctl): Update to 63. [source]: Use GIT-FILE-NAME. [native-inputs]: Add bash-completion. [arguments]: Add '--disable-asciidoctor' and '--without-systemd' #:configure-flags. Don't bother patching unused ./autogen.sh in 'patch-FHS-file-names' phase. 2018-10-10gnu: libblockdev: Update to 2.20.Tobias Geerinckx-Rice * gnu/packages/disk.scm (libblockdev): Update to 2.20. [license]: Update to match fixed licence headers. 2018-10-10gnu: volume-key: Update to 0.3.12.Tobias Geerinckx-Rice * gnu/packages/disk.scm (volume-key): Update to 0.3.12. 2018-10-05Merge branch 'master' into core-updatesMarius Bakke 2018-10-04gnu: ndctl: Return #t from phases.Tobias Geerinckx-Rice * gnu/packages/disk (ndctl)[arguments]: Rename inaccurately named 'autogen' phase to 'patch-FHS-file-names'. Explicitly return #t. 2018-09-03Merge branch 'master' into core-updatesMarius Bakke