gnu: linux-libre@4.9: Update to 4.9.208.
[jackhill/guix/guix.git] / gnu / packages / nfs.scm
CommitLineData
e9aba1ea
JD
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2016 John Darrington <jmd@gnu.org>
606e2468 3;;; Copyright © 2017, 2018 Leo Famulari <leo@famulari.name>
1a392ee7 4;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
b224ff4a 5;;; Copyright © 2020 Ricardo Wurmus <rekado@elephly.net>
e9aba1ea
JD
6;;;
7;;; This file is part of GNU Guix.
8;;;
9;;; GNU Guix is free software; you can redistribute it and/or modify it
10;;; under the terms of the GNU General Public License as published by
11;;; the Free Software Foundation; either version 3 of the License, or (at
12;;; your option) any later version.
13;;;
14;;; GNU Guix is distributed in the hope that it will be useful, but
15;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;;; GNU General Public License for more details.
18;;;
19;;; You should have received a copy of the GNU General Public License
20;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22(define-module (gnu packages nfs)
23 #:use-module (gnu packages)
b224ff4a 24 #:use-module (gnu packages crypto)
e9aba1ea 25 #:use-module (gnu packages linux)
e9aba1ea 26 #:use-module (gnu packages libevent)
89e34644 27 #:use-module (gnu packages kerberos)
e9aba1ea
JD
28 #:use-module (gnu packages onc-rpc)
29 #:use-module (gnu packages pkg-config)
cd0322a3 30 #:use-module (gnu packages sqlite)
e9aba1ea
JD
31 #:use-module (guix build-system cmake)
32 #:use-module (guix build-system gnu)
33 #:use-module (guix build-system python)
34 #:use-module (guix build-system trivial)
35 #:use-module (guix download)
36 #:use-module ((guix licenses) #:prefix license:)
37 #:use-module (guix packages)
38 #:use-module (guix utils)
39 #:use-module (srfi srfi-1)
40 #:use-module (srfi srfi-2)
41 #:use-module (srfi srfi-26)
42 #:use-module (ice-9 match))
43
44(define-public nfs-utils
45 (package
46 (name "nfs-utils")
b224ff4a 47 (version "2.4.2")
e9aba1ea
JD
48 (source (origin
49 (method url-fetch)
50 (uri (string-append
51 "mirror://kernel.org/linux/utils/nfs-utils/" version
52 "/nfs-utils-" version ".tar.xz"))
53 (sha256
54 (base32
b224ff4a 55 "0f0hm8jq1p5gra55v621qpbb3mryakaikzpy5znkvxym0dx76r24"))))
e9aba1ea
JD
56 (build-system gnu-build-system)
57 (arguments
58 `(#:configure-flags
59 `("--without-tcp-wrappers"
60 ,(string-append "--with-start-statd="
61 (assoc-ref %outputs "out") "/sbin/start-statd")
b224ff4a
RW
62 ,(string-append "--with-krb5=" (assoc-ref %build-inputs "mit-krb5"))
63 ,(string-append "--with-pluginpath="
64 (assoc-ref %outputs "out")
65 "/lib/libnfsidmap"))
d14b8dbb
LF
66 #:phases
67 (modify-phases %standard-phases
68 (add-before 'configure 'adjust-command-file-names
69 (lambda _
70 ;; Remove assumptions of FHS from start-statd script
71 (substitute* `("utils/statd/start-statd")
72 (("^PATH=.*") "")
73 (("^flock")
74 (string-append
75 (assoc-ref %build-inputs "util-linux")
76 "/bin/flock"))
77 (("^exec rpc.statd")
78 (string-append "exec "
79 (assoc-ref %outputs "out") "/sbin/rpc.statd")))
e9aba1ea 80
b224ff4a
RW
81 ;; find rpcgen
82 (substitute* "configure"
83 (("/usr/local/bin/rpcgen")
84 (which "rpcgen")))
85
d14b8dbb
LF
86 ;; This hook tries to write to /var
87 ;; That needs to be done by a service too.
88 (substitute* `("Makefile.in")
89 (("^install-data-hook:")
90 "install-data-hook-disabled-for-guix:"))
e9aba1ea 91
d14b8dbb
LF
92 ;; Replace some hard coded paths.
93 (substitute* `("utils/nfsd/nfssvc.c")
94 (("/bin/mount")
95 (string-append
96 (assoc-ref %build-inputs "util-linux")
97 "/bin/mount")))
98 (substitute* `("utils/statd/statd.c")
99 (("/usr/sbin/")
100 (string-append (assoc-ref %outputs "out") "/sbin/")))
b224ff4a
RW
101 (substitute* `("utils/mount/Makefile.in"
102 "utils/nfsdcld/Makefile.in"
d14b8dbb
LF
103 "utils/nfsdcltrack/Makefile.in")
104 (("^sbindir = /sbin")
105 (string-append "sbindir = "
106 (assoc-ref %outputs "out") "/sbin")))
107 #t)))))
b224ff4a
RW
108 (inputs
109 `(("keyutils" ,keyutils)
110 ("libevent" ,libevent)
111 ("libnfsidmap" ,libnfsidmap)
112 ("rpcsvc-proto" ,rpcsvc-proto) ;for 'rpcgen'
113 ("sqlite" ,sqlite)
114 ("lvm2" ,lvm2)
115 ("util-linux" ,util-linux)
116 ("mit-krb5" ,mit-krb5)
117 ("libtirpc" ,libtirpc)))
e9aba1ea
JD
118 (native-inputs
119 `(("pkg-config" ,pkg-config)))
120 (home-page "http://www.kernel.org/pub/linux/utils/nfs-utils/")
121 (synopsis "Tools for loading and managing Linux NFS mounts")
122 (description "The Network File System (NFS) was developed to allow
123machines to mount a disk partition on a remote machine as if it were a local
124disk. It allows for fast, seamless sharing of files across a network.")
125 ;; It is hard to be sure what the licence is. Most of the source files
126 ;; contain no licence notice at all. A few have a licence notice for a 3
127 ;; clause non-copyleft licence. However the tarball has a COPYING file
128 ;; with the text of GPLv2 -- It seems then that GLPv2 is the most
129 ;; restrictive licence, and until advice to the contrary we must assume
130 ;; that is what is intended.
131 (license license:gpl2)))