1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
3 ;;; Copyright © 2017, 2018 Leo Famulari <leo@famulari.name>
4 ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2020 Ricardo Wurmus <rekado@elephly.net>
6 ;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2020 Lars-Dominik Braun <ldb@leibniz-psychology.org>
9 ;;; This file is part of GNU Guix.
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24 (define-module (gnu packages nfs)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages attr)
27 #:use-module (gnu packages autotools)
28 #:use-module (gnu packages crypto)
29 #:use-module (gnu packages linux)
30 #:use-module (gnu packages libevent)
31 #:use-module (gnu packages kerberos)
32 #:use-module (gnu packages onc-rpc)
33 #:use-module (gnu packages pkg-config)
34 #:use-module (gnu packages python)
35 #:use-module (gnu packages sqlite)
36 #:use-module (guix build-system cmake)
37 #:use-module (guix build-system gnu)
38 #:use-module (guix build-system python)
39 #:use-module (guix build-system trivial)
40 #:use-module (guix download)
41 #:use-module (guix git-download)
42 #:use-module ((guix licenses) #:prefix license:)
43 #:use-module (guix packages)
44 #:use-module (guix utils)
45 #:use-module (srfi srfi-1)
46 #:use-module (srfi srfi-2)
47 #:use-module (srfi srfi-26)
48 #:use-module (ice-9 match))
50 (define-public nfs-utils
57 "mirror://kernel.org/linux/utils/nfs-utils/" version
58 "/nfs-utils-" version ".tar.xz"))
61 "16b5y82cjy1cvijg5zmdvivc6sfdlv2slyynxbwwyw43vpjzqrdg"))))
62 (build-system gnu-build-system)
65 `("--without-tcp-wrappers"
66 ,(string-append "--with-start-statd="
67 (assoc-ref %outputs "out") "/sbin/start-statd")
68 ,(string-append "--with-krb5=" (assoc-ref %build-inputs "mit-krb5"))
69 ,(string-append "--with-pluginpath="
70 (assoc-ref %outputs "out")
74 (modify-phases %standard-phases
75 (add-before 'configure 'adjust-command-file-names
77 ;; Remove assumptions of FHS from start-statd script
78 (substitute* `("utils/statd/start-statd")
82 (assoc-ref %build-inputs "util-linux")
85 (string-append "exec "
86 (assoc-ref %outputs "out") "/sbin/rpc.statd")))
89 (substitute* "configure"
90 (("/usr/local/bin/rpcgen")
93 ;; This hook tries to write to /var
94 ;; That needs to be done by a service too.
95 (substitute* `("Makefile.in")
96 (("^install-data-hook:")
97 "install-data-hook-disabled-for-guix:"))
99 ;; Replace some hard coded paths.
100 (substitute* `("utils/nfsd/nfssvc.c")
103 (assoc-ref %build-inputs "util-linux")
105 (substitute* `("utils/statd/statd.c")
107 (string-append (assoc-ref %outputs "out") "/sbin/")))
108 (substitute* `("utils/mount/Makefile.in"
109 "utils/nfsdcld/Makefile.in"
110 "utils/nfsdcltrack/Makefile.in")
111 (("^sbindir = /sbin")
112 (string-append "sbindir = "
113 (assoc-ref %outputs "out") "/sbin")))
116 `(("keyutils" ,keyutils)
117 ("libevent" ,libevent)
118 ("libnfsidmap" ,libnfsidmap)
119 ("rpcsvc-proto" ,rpcsvc-proto) ;for 'rpcgen'
122 ("util-linux" ,util-linux "lib")
123 ("mit-krb5" ,mit-krb5)
124 ("libtirpc" ,libtirpc)
125 ("python-wrapper" ,python-wrapper))) ;for the Python based tools
127 `(("pkg-config" ,pkg-config)))
128 (home-page "https://www.kernel.org/pub/linux/utils/nfs-utils/")
129 (synopsis "Tools for loading and managing Linux NFS mounts")
130 (description "The Network File System (NFS) was developed to allow
131 machines to mount a disk partition on a remote machine as if it were a local
132 disk. It allows for fast, seamless sharing of files across a network.")
133 ;; It is hard to be sure what the licence is. Most of the source files
134 ;; contain no licence notice at all. A few have a licence notice for a 3
135 ;; clause non-copyleft licence. However the tarball has a COPYING file
136 ;; with the text of GPLv2 -- It seems then that GLPv2 is the most
137 ;; restrictive licence, and until advice to the contrary we must assume
138 ;; that is what is intended.
139 (license license:gpl2)))
141 (define-public nfs4-acl-tools
143 (name "nfs4-acl-tools")
147 ;; tarballs are available here:
148 ;; http://linux-nfs.org/~bfields/nfs4-acl-tools/
150 (url "git://git.linux-nfs.org/projects/bfields/nfs4-acl-tools.git")
151 (commit (string-append name "-" version))))
152 (file-name (git-file-name name version))
155 "0lq9xdaskxysggs918vs8x42xvmg9nj7lla21ni2scw5ljld3h1i"))
156 (patches (search-patches "nfs4-acl-tools-0.3.7-fixpaths.patch"))))
157 (build-system gnu-build-system)
159 `(#:tests? #f ; no tests
161 (modify-phases %standard-phases
162 (add-after 'unpack 'fix-bin-sh
164 (substitute* "include/buildmacros"
165 (("/bin/sh") (which "sh")))
168 `(("automake" ,automake)
169 ("autoconf" ,autoconf)
170 ("libtool" ,libtool)))
173 (home-page "https://linux-nfs.org/wiki/index.php/Main_Page")
174 (synopsis "Commandline ACL utilities for the Linux NFSv4 client")
175 (description "This package provides the commandline utilities
176 @command{nfs4_getfacl} and @command{nfs4_setfacl}, which are similar to their
177 POSIX equivalents @command{getfacl} and @command{setfacl}. They fetch and
178 manipulate access control lists for files and directories on NFSv4 mounts.")
179 (license license:bsd-3)))