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>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (gnu packages nfs)
24 #:use-module (gnu packages)
25 #:use-module (gnu packages crypto)
26 #:use-module (gnu packages linux)
27 #:use-module (gnu packages libevent)
28 #:use-module (gnu packages kerberos)
29 #:use-module (gnu packages onc-rpc)
30 #:use-module (gnu packages pkg-config)
31 #:use-module (gnu packages python)
32 #:use-module (gnu packages sqlite)
33 #:use-module (guix build-system cmake)
34 #:use-module (guix build-system gnu)
35 #:use-module (guix build-system python)
36 #:use-module (guix build-system trivial)
37 #:use-module (guix download)
38 #:use-module ((guix licenses) #:prefix license:)
39 #:use-module (guix packages)
40 #:use-module (guix utils)
41 #:use-module (srfi srfi-1)
42 #:use-module (srfi srfi-2)
43 #:use-module (srfi srfi-26)
44 #:use-module (ice-9 match))
46 (define-public nfs-utils
53 "mirror://kernel.org/linux/utils/nfs-utils/" version
54 "/nfs-utils-" version ".tar.xz"))
57 "16b5y82cjy1cvijg5zmdvivc6sfdlv2slyynxbwwyw43vpjzqrdg"))))
58 (build-system gnu-build-system)
61 `("--without-tcp-wrappers"
62 ,(string-append "--with-start-statd="
63 (assoc-ref %outputs "out") "/sbin/start-statd")
64 ,(string-append "--with-krb5=" (assoc-ref %build-inputs "mit-krb5"))
65 ,(string-append "--with-pluginpath="
66 (assoc-ref %outputs "out")
70 (modify-phases %standard-phases
71 (add-before 'configure 'adjust-command-file-names
73 ;; Remove assumptions of FHS from start-statd script
74 (substitute* `("utils/statd/start-statd")
78 (assoc-ref %build-inputs "util-linux")
81 (string-append "exec "
82 (assoc-ref %outputs "out") "/sbin/rpc.statd")))
85 (substitute* "configure"
86 (("/usr/local/bin/rpcgen")
89 ;; This hook tries to write to /var
90 ;; That needs to be done by a service too.
91 (substitute* `("Makefile.in")
92 (("^install-data-hook:")
93 "install-data-hook-disabled-for-guix:"))
95 ;; Replace some hard coded paths.
96 (substitute* `("utils/nfsd/nfssvc.c")
99 (assoc-ref %build-inputs "util-linux")
101 (substitute* `("utils/statd/statd.c")
103 (string-append (assoc-ref %outputs "out") "/sbin/")))
104 (substitute* `("utils/mount/Makefile.in"
105 "utils/nfsdcld/Makefile.in"
106 "utils/nfsdcltrack/Makefile.in")
107 (("^sbindir = /sbin")
108 (string-append "sbindir = "
109 (assoc-ref %outputs "out") "/sbin")))
112 `(("keyutils" ,keyutils)
113 ("libevent" ,libevent)
114 ("libnfsidmap" ,libnfsidmap)
115 ("rpcsvc-proto" ,rpcsvc-proto) ;for 'rpcgen'
118 ("util-linux" ,util-linux "lib")
119 ("mit-krb5" ,mit-krb5)
120 ("libtirpc" ,libtirpc)
121 ("python-wrapper" ,python-wrapper))) ;for the Python based tools
123 `(("pkg-config" ,pkg-config)))
124 (home-page "https://www.kernel.org/pub/linux/utils/nfs-utils/")
125 (synopsis "Tools for loading and managing Linux NFS mounts")
126 (description "The Network File System (NFS) was developed to allow
127 machines to mount a disk partition on a remote machine as if it were a local
128 disk. It allows for fast, seamless sharing of files across a network.")
129 ;; It is hard to be sure what the licence is. Most of the source files
130 ;; contain no licence notice at all. A few have a licence notice for a 3
131 ;; clause non-copyleft licence. However the tarball has a COPYING file
132 ;; with the text of GPLv2 -- It seems then that GLPv2 is the most
133 ;; restrictive licence, and until advice to the contrary we must assume
134 ;; that is what is intended.
135 (license license:gpl2)))