gnu: rust-stdweb-internal-test-macro-0.1: Update to 0.1.1.
[jackhill/guix/guix.git] / gnu / packages / nfs.scm
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 ;;;
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)
24 #:use-module (gnu packages crypto)
25 #:use-module (gnu packages linux)
26 #:use-module (gnu packages libevent)
27 #:use-module (gnu packages kerberos)
28 #:use-module (gnu packages onc-rpc)
29 #:use-module (gnu packages pkg-config)
30 #:use-module (gnu packages sqlite)
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")
47 (version "2.4.2")
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
55 "0f0hm8jq1p5gra55v621qpbb3mryakaikzpy5znkvxym0dx76r24"))))
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")
62 ,(string-append "--with-krb5=" (assoc-ref %build-inputs "mit-krb5"))
63 ,(string-append "--with-pluginpath="
64 (assoc-ref %outputs "out")
65 "/lib/libnfsidmap")
66 "--enable-svcgss")
67 #:phases
68 (modify-phases %standard-phases
69 (add-before 'configure 'adjust-command-file-names
70 (lambda _
71 ;; Remove assumptions of FHS from start-statd script
72 (substitute* `("utils/statd/start-statd")
73 (("^PATH=.*") "")
74 (("^flock")
75 (string-append
76 (assoc-ref %build-inputs "util-linux")
77 "/bin/flock"))
78 (("^exec rpc.statd")
79 (string-append "exec "
80 (assoc-ref %outputs "out") "/sbin/rpc.statd")))
81
82 ;; find rpcgen
83 (substitute* "configure"
84 (("/usr/local/bin/rpcgen")
85 (which "rpcgen")))
86
87 ;; This hook tries to write to /var
88 ;; That needs to be done by a service too.
89 (substitute* `("Makefile.in")
90 (("^install-data-hook:")
91 "install-data-hook-disabled-for-guix:"))
92
93 ;; Replace some hard coded paths.
94 (substitute* `("utils/nfsd/nfssvc.c")
95 (("/bin/mount")
96 (string-append
97 (assoc-ref %build-inputs "util-linux")
98 "/bin/mount")))
99 (substitute* `("utils/statd/statd.c")
100 (("/usr/sbin/")
101 (string-append (assoc-ref %outputs "out") "/sbin/")))
102 (substitute* `("utils/mount/Makefile.in"
103 "utils/nfsdcld/Makefile.in"
104 "utils/nfsdcltrack/Makefile.in")
105 (("^sbindir = /sbin")
106 (string-append "sbindir = "
107 (assoc-ref %outputs "out") "/sbin")))
108 #t)))))
109 (inputs
110 `(("keyutils" ,keyutils)
111 ("libevent" ,libevent)
112 ("libnfsidmap" ,libnfsidmap)
113 ("rpcsvc-proto" ,rpcsvc-proto) ;for 'rpcgen'
114 ("sqlite" ,sqlite)
115 ("lvm2" ,lvm2)
116 ("util-linux" ,util-linux)
117 ("mit-krb5" ,mit-krb5)
118 ("libtirpc" ,libtirpc)))
119 (native-inputs
120 `(("pkg-config" ,pkg-config)))
121 (home-page "http://www.kernel.org/pub/linux/utils/nfs-utils/")
122 (synopsis "Tools for loading and managing Linux NFS mounts")
123 (description "The Network File System (NFS) was developed to allow
124 machines to mount a disk partition on a remote machine as if it were a local
125 disk. It allows for fast, seamless sharing of files across a network.")
126 ;; It is hard to be sure what the licence is. Most of the source files
127 ;; contain no licence notice at all. A few have a licence notice for a 3
128 ;; clause non-copyleft licence. However the tarball has a COPYING file
129 ;; with the text of GPLv2 -- It seems then that GLPv2 is the most
130 ;; restrictive licence, and until advice to the contrary we must assume
131 ;; that is what is intended.
132 (license license:gpl2)))