aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016 John Darrington <jmd@gnu.org>
;;; Copyright © 2017, 2018 Leo Famulari <leo@famulari.name>
;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2020 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2020 Lars-Dominik Braun <ldb@leibniz-psychology.org>
;;;
;;; 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 nfs)
  #:use-module (gnu packages)
  #:use-module (gnu packages attr)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages crypto)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages libevent)
  #:use-module (gnu packages kerberos)
  #:use-module (gnu packages onc-rpc)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages python)
  #:use-module (gnu packages sqlite)
  #:use-module (guix build-system gnu)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix utils)
  #:use-module (srfi srfi-1)
  #:use-module (srfi srfi-2)
  #:use-module (srfi srfi-26)
  #:use-module (ice-9 match))

(define-public nfs-utils
  (package
    (name "nfs-utils")
    (version "2.4.3")
    (source (origin
             (method url-fetch)
             (uri (string-append
                   "mirror://kernel.org/linux/utils/nfs-utils/" version
                   "/nfs-utils-" version ".tar.xz"))
             (sha256
              (base32
               "16b5y82cjy1cvijg5zmdvivc6sfdlv2slyynxbwwyw43vpjzqrdg"))))
    (build-system gnu-build-system)
    (arguments
     `(#:configure-flags
       `("--disable-static"
         "--without-tcp-wrappers"
         ,(string-append "--with-start-statd="
                         (assoc-ref %outputs "out") "/sbin/start-statd")
         ,(string-append "--with-krb5=" (assoc-ref %build-inputs "mit-krb5"))
         ,(string-append "--with-pluginpath="
                         (assoc-ref %outputs "out")
                         "/lib/libnfsidmap")
         "--enable-svcgss")
       #:phases
       (modify-phases %standard-phases
         (add-before 'configure 'adjust-command-file-names
           (lambda _
             ;; Remove assumptions of FHS from start-statd script
             (substitute* `("utils/statd/start-statd")
               (("^PATH=.*") "")
               (("^flock")
                (string-append
                 (assoc-ref %build-inputs "util-linux")
                 "/bin/flock"))
               (("^exec rpc.statd")
                (string-append "exec "
                 (assoc-ref %outputs "out") "/sbin/rpc.statd")))

             ;; find rpcgen
             (substitute* "configure"
               (("/usr/local/bin/rpcgen")
                (which "rpcgen")))

             ;; This hook tries to write to /var
             ;; That needs to be done by a service too.
             (substitute* `("Makefile.in")
               (("^install-data-hook:")
                "install-data-hook-disabled-for-guix:"))

             ;; Replace some hard coded paths.
             (substitute* `("utils/nfsd/nfssvc.c")
               (("/bin/mount")
                (string-append
                 (assoc-ref %build-inputs "util-linux")
                 "/bin/mount")))
             (substitute* `("utils/statd/statd.c")
               (("/usr/sbin/")
                (string-append (assoc-ref %outputs "out") "/sbin/")))
             (substitute* `("utils/mount/Makefile.in"
                            "utils/nfsdcld/Makefile.in"
                            "utils/nfsdcltrack/Makefile.in")
               (("^sbindir = /sbin")
                (string-append "sbindir = "
                               (assoc-ref %outputs "out") "/sbin")))
             #t)))))
    (inputs
     `(("keyutils" ,keyutils)
       ("libevent" ,libevent)
       ("rpcsvc-proto" ,rpcsvc-proto)   ;for 'rpcgen'
       ("sqlite" ,sqlite)
       ("lvm2" ,lvm2)
       ("util-linux" ,util-linux)           ; only for above substitutions
       ("util-linux:lib" ,util-linux "lib") ; for libblkid
       ("mit-krb5" ,mit-krb5)
       ("libtirpc" ,libtirpc)
       ("python-wrapper" ,python-wrapper))) ;for the Python based tools
    (native-inputs
     (list pkg-config))
    (home-page "https://www.kernel.org/pub/linux/utils/nfs-utils/")
    (synopsis "Tools for loading and managing Linux NFS mounts")
    (description "The Network File System (NFS) was developed to allow
machines to mount a disk partition on a remote machine as if it were a local
disk.  It allows for fast, seamless sharing of files across a network.")
    ;; It is hard to be sure what the licence is.  Most of the source files
    ;; contain no licence notice at all.  A few have a licence notice for a 3
    ;; clause non-copyleft licence.  However the tarball has a COPYING file
    ;; with the text of GPLv2 -- It seems then that GLPv2 is the most
    ;; restrictive licence, and until advice to the contrary we must assume
    ;; that is what is intended.
    (license license:gpl2)))

(define-public nfs4-acl-tools
  (package
    (name "nfs4-acl-tools")
    (version "0.3.7")
    (source (origin
              (method git-fetch)
              ;; tarballs are available here:
              ;; http://linux-nfs.org/~bfields/nfs4-acl-tools/
              (uri (git-reference
                    (url "git://git.linux-nfs.org/projects/bfields/nfs4-acl-tools.git")
                    (commit (string-append name "-" version))))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "0lq9xdaskxysggs918vs8x42xvmg9nj7lla21ni2scw5ljld3h1i"))
              (patches (search-patches "nfs4-acl-tools-0.3.7-fixpaths.patch"))))
    (build-system gnu-build-system)
    (arguments
     `(#:tests? #f                      ; no tests
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'fix-bin-sh
           (lambda _
             (substitute* "include/buildmacros"
               (("/bin/sh") (which "sh")))
             #t)))))
    (native-inputs
     (list automake autoconf libtool))
    (inputs
     (list attr))
    (home-page "https://linux-nfs.org/wiki/index.php/Main_Page")
    (synopsis "Commandline ACL utilities for the Linux NFSv4 client")
    (description "This package provides the commandline utilities
@command{nfs4_getfacl} and @command{nfs4_setfacl}, which are similar to their
POSIX equivalents @command{getfacl} and @command{setfacl}.  They fetch and
manipulate access control lists for files and directories on NFSv4 mounts.")
    (license license:bsd-3)))
msg-avail'>...This avoids collisions with '_' when the latter is used as a 'match' pattern for instance. See <https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>. * guix/ui.scm: Rename '_' to 'G_'. * po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly. * build-aux/compile-all.scm (warnings): Remove 'format'. * gnu/packages.scm, gnu/services.scm, gnu/services/shepherd.scm, gnu/system.scm, gnu/system/shadow.scm, guix/gnupg.scm, guix/http-client.scm, guix/import/cpan.scm, guix/import/elpa.scm, guix/import/pypi.scm, guix/nar.scm, guix/scripts.scm, guix/scripts/archive.scm, guix/scripts/authenticate.scm, guix/scripts/build.scm, guix/scripts/challenge.scm, guix/scripts/container.scm, guix/scripts/container/exec.scm, guix/scripts/copy.scm, guix/scripts/download.scm, guix/scripts/edit.scm, guix/scripts/environment.scm, guix/scripts/gc.scm, guix/scripts/graph.scm, guix/scripts/hash.scm, guix/scripts/import.scm, guix/scripts/import/cpan.scm, guix/scripts/import/cran.scm, guix/scripts/import/crate.scm, guix/scripts/import/elpa.scm, guix/scripts/import/gem.scm, guix/scripts/import/gnu.scm, guix/scripts/import/hackage.scm, guix/scripts/import/nix.scm, guix/scripts/import/pypi.scm, guix/scripts/import/stackage.scm, guix/scripts/lint.scm, guix/scripts/offload.scm, guix/scripts/pack.scm, guix/scripts/package.scm, guix/scripts/perform-download.scm, guix/scripts/publish.scm, guix/scripts/pull.scm, guix/scripts/refresh.scm, guix/scripts/size.scm, guix/scripts/substitute.scm, guix/scripts/system.scm, guix/ssh.scm, guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`". Ludovic Courtès 2017-05-01packages: Remove support for PACKAGE-VERSION deprecated syntax....This syntax had been deprecated since 2016-02-28. * gnu/packages.scm (%find-package): Remove #:fallback? parameter and handling. * tests/guix-build.sh: Remove test for "time-1.7" syntax. * doc/guix.texi (Invoking guix lint): Update 'guix lint' output in example. Ludovic Courtès 2017-03-08packages: Use PACKAGE@VERSION syntax when reporting ambiguities....* gnu/packages.scm (%find-package): Upon ambiguity, use the PACKAGE@VERSION syntax instead of 'package-full-name'. Ludovic Courtès 2017-02-27packages: Add 'search-auxiliary-file'....Suggested-by: Ludovic Courtès <ludo@gnu.org> at <http://lists.gnu.org/archive/html/guix-devel/2016-12/msg01174.html>. * gnu/packages.scm (%auxiliary-files-path): New variable. (search-auxiliary-file): New procedure. Alex Kost 2017-01-28Use 'mlambda' instead of 'memoize'....* gnu/packages.scm (find-newest-available-packages): Use 'mlambda' instead of (memoize (lambda ...) ...). * gnu/packages/bootstrap.scm (package-with-bootstrap-guile): Likewise. * guix/build-system/gnu.scm (package-with-explicit-inputs)[rewritten-input]: Likewise. * guix/build-system/python.scm (package-with-explicit-python)[transform]: Likewise. * guix/derivations.scm (derivation->string): Likewise. * guix/gnu-maintenance.scm (gnu-package?): Likewise. * guix/modules.scm (module-file-dependencies): Likewise. * guix/scripts/graph.scm (standard-package-set): Likewise. * guix/scripts/lint.scm (official-gnu-packages*): Likewise. * guix/store.scm (store-regexp*): Likewise. * guix/utils.scm (location): Likewise. Ludovic Courtès 2017-01-28Add (guix memoization)....* guix/combinators.scm (memoize): Remove. * guix/memoization.scm: New file. * Makefile.am (MODULES): Add it. * gnu/packages.scm, gnu/packages/bootstrap.scm, guix/build-system/gnu.scm, guix/build-system/python.scm, guix/derivations.scm, guix/gnu-maintenance.scm, guix/import/cran.scm, guix/import/elpa.scm, guix/modules.scm, guix/scripts/build.scm, guix/scripts/graph.scm, guix/scripts/lint.scm, guix/store.scm, guix/utils.scm: Adjust imports accordingly. Ludovic Courtès 2016-09-20ui: Do not shadow '_' where it's used as a literal syntax match....Fixes compilation with Guile 2.1. Reported by Mu Lei. * guix/ui.scm (report-load-error) (warn-about-load-error, read/eval-package-expression): Use 'rest' instead of '_' as the pattern variable name. * gnu/packages.scm (%find-package): Likewise. * guix/scripts/build.scm (transform-package-inputs): Likewise. * guix/scripts/hash.scm (guix-hash): Likewise. * guix/scripts/import/gnu.scm (%options, guix-import-gnu): Likewise. * guix/scripts/import/nix.scm (guix-import-nix): Likewise. * guix/scripts/offload.scm (build-machines): Likewise. * guix/scripts/refresh.scm (%options): Likewise. * guix/scripts/substitute.scm (narinfo-signature->canonical-sexp): Likewise. Ludovic Courtès 2016-09-06packages: Add 'package-superseded' and associated support....This provides a way to mark a package as superseded by another one. Upgrades replace superseded packages with their replacement. * guix/packages.scm (package-superseded, deprecated-package): New procedures. * gnu/packages.scm (%find-package): Check for 'package-superseded'. * guix/scripts/package.scm (transaction-upgrade-entry)[supersede]: New procedure. Call it when 'package-superseded' is true. * tests/guix-build.sh: Add test for a superseded package. * tests/packages.scm ("package-superseded") ("transaction-upgrade-entry, superseded package"): New tests. Ludovic Courtès 2016-07-28packages: Add 'hidden-package'....* guix/packages.scm (hidden-package, hidden-package?): New procedures. * gnu/packages.scm (fold-packages): Filter out 'hidden-package?'. * tests/packages.scm ("hidden-package"): New test. Ludovic Courtès 2016-06-20packages: Export 'scheme-modules'....* gnu/packages.scm (package-modules): Rename to... (scheme-modules): ... this. Export. Update callers. Ludovic Courtès 2016-05-04utils: Move combinators to (guix combinators)....* guix/utils.scm (compile-time-value, memoize, fold2) (fold-tree, fold-tree-leaves): Move to... * guix/combinators: ... here. New file. * tests/utils.scm ("fold2, 1 list", "fold2, 2 lists") (fold-tree tests): Move to... * tests/combinators.scm: ... here. New file. * Makefile.am (MODULES, SCM_TESTS): Add them. * gnu/packages.scm, gnu/packages/bootstrap.scm, gnu/services/herd.scm, guix/build-system/gnu.scm, guix/build-system/python.scm, guix/derivations.scm, guix/gnu-maintenance.scm, guix/import/elpa.scm, guix/scripts/archive.scm, guix/scripts/build.scm, guix/scripts/graph.scm, guix/scripts/lint.scm, guix/scripts/size.scm, guix/scripts/substitute.scm, guix/serialization.scm, guix/store.scm, guix/ui.scm: Adjust imports accordingly. Ludovic Courtès 2016-04-14packages: Add 'search-patches'....* gnu/packages.scm (search-patches): New macro. Alex Kost 2016-03-08packages: Gracefully report packages not found....Fixes a thinko introduced in 1b846da8c372bee78851439fd9e72b2499115e5a that would lead to a backtrace when looking for an unknown package. * gnu/packages.scm (%find-package): Correct logic when checking for FALLBACK?. Ludovic Courtès 2016-03-08packages: Support the deprecated "NAME-VERSION" syntax....Fixes a typo introduced in 1b846da8c372bee78851439fd9e72b2499115e5a that would lead to a backtrace when using the deprecated syntax. * gnu/packages.scm (%find-package): Turn the first argument to 'call-with-values' into a thunk. Use #:select instead of '@' to select the right 'package-name->name+version' procedure. Ludovic Courtès 2016-03-08packages: Clarify NAME-VERSION deprecation message....* gnu/packages.scm (%find-package): Clarify message; remove trailing period. Ludovic Courtès 2016-03-02utils: Use '@' for separating package names and version numbers....This provides the ability to use numbers in package names. Fixes <http://bugs.gnu.org/19219>. * guix/utils.scm (package-name->name+version): New procedure. * gnu/packages.scm (%find-package): Add a FALLBACK? keyword argument. Use the previous method when no package is found. (specification->package+output, specification->package): Adapt documentation to new syntax. * doc/guix.texi (Invoking guix package, Invoking guix import): Likewise. * guix/ui.scm (package-specification->name+version+output): Likewise. * guix/scripts/import/hackage.scm (show-help): Likewise. * tests/guix-build.sh: Adapt to new syntax. * tests/guix-lint.sh: Likewise. * tests/guix-package.sh: Likewise. * tests/ui.scm ("package-specification->name+version+output"): Likewise. * tests/utils.scm ("package-name->name+version"): Likewise. * NEWS: Mention new syntax. Mathieu Lirzin 2016-03-02packages: Factorize package specification search....* gnu/packages.scm (%find-package): New procedure. (specification->package, specification->package+output): Use it. Mathieu Lirzin 2016-02-24Do not check package freshness during upgrade....Fixes <http://bugs.gnu.org/22740>. Reported by Andreas Enge <andreas@enge.fr>. * gnu/packages.scm (waiting, ftp-open*, check-package-freshness): Remove. * guix/scripts/package.scm (options->installable): Adjust accordingly. * emacs/guix-main.scm (package->manifest-entry*): Likewise. Alex Kost 2015-12-20packages: Remove now redundant graph procedures....These procedures are now redundant with those in (guix graph) and are no longer used since commit a51cbecb. * gnu/packages.scm (vhash-refq, package-dependencies) (package-direct-dependents, package-transitive-dependents) (package-covering-dependents): Remove. Ludovic Courtès 2015-10-21packages: Update 'check-package-freshness' to use (guix upstream)....This is a followup to 0a7c5a0. Reported by Efraim Flashner <efraim@flashner.co.il>. * gnu/packages.scm (check-package-freshness): Update to the new (guix upstream) interface. Ludovic Courtès 2015-06-18Move 'specification->package+output' to (gnu packages)....* guix/scripts/package.scm (specification->package+output): Move to... * gnu/packages.scm (specification->package+output): ... here * guix/scripts/archive.scm (guix): Adjust accordingly. Ludovic Courtès 2015-04-18packages: Allow package lookups with version prefixes....* gnu/packages.scm (find-packages-by-name): Sort MATCHING according to 'version>?'. Use 'string-prefix?' instead of 'string=?' to compare against VERSION. * doc/guix.texi (Invoking guix package): Add example and explanation. Ludovic Courtès 2015-04-08Merge branch 'master' into core-updates宋文武 2015-04-07gnu: Emit a warning when a package module cannot be loaded....* guix/ui.scm (warn-about-load-error): New procedure. * gnu/packages.scm (package-modules): Wrap 'resolve-interface' call in 'catch #t', and call 'warn-about-load-error' in handler. Ludovic Courtès 2015-04-03packages: Fix typo....* gnu/packages.scm: Fix the name of an exported variable (%patch-path). Alex Kost 2015-01-26gnu: Raise an error when a bootstrap binary is not found....* gnu/packages.scm (search-bootstrap-binary): Raise an error when FILE-NAME is not found. Ludovic Courtès 2015-01-20gnu: 'search-patch' raises an error when a patch is not found....* gnu/packages.scm (search-patch): Raise an error condition when 'search-path' returns #f. * tests/packages.scm ("patch not found yields a run-time error"): New test. Ludovic Courtès