gnu: webkitgtk: Update to 2.28.2.
[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 python)
31 #:use-module (gnu packages sqlite)
32 #:use-module (guix build-system cmake)
33 #:use-module (guix build-system gnu)
34 #:use-module (guix build-system python)
35 #:use-module (guix build-system trivial)
36 #:use-module (guix download)
37 #:use-module ((guix licenses) #:prefix license:)
38 #:use-module (guix packages)
39 #:use-module (guix utils)
40 #:use-module (srfi srfi-1)
41 #:use-module (srfi srfi-2)
42 #:use-module (srfi srfi-26)
43 #:use-module (ice-9 match))
44
45 (define-public nfs-utils
46 (package
47 (name "nfs-utils")
48 (version "2.4.2")
49 (source (origin
50 (method url-fetch)
51 (uri (string-append
52 "mirror://kernel.org/linux/utils/nfs-utils/" version
53 "/nfs-utils-" version ".tar.xz"))
54 (sha256
55 (base32
56 "0f0hm8jq1p5gra55v621qpbb3mryakaikzpy5znkvxym0dx76r24"))))
57 (build-system gnu-build-system)
58 (arguments
59 `(#:configure-flags
60 `("--without-tcp-wrappers"
61 ,(string-append "--with-start-statd="
62 (assoc-ref %outputs "out") "/sbin/start-statd")
63 ,(string-append "--with-krb5=" (assoc-ref %build-inputs "mit-krb5"))
64 ,(string-append "--with-pluginpath="
65 (assoc-ref %outputs "out")
66 "/lib/libnfsidmap")
67 "--enable-svcgss")
68 #:phases
69 (modify-phases %standard-phases
70 (add-before 'configure 'adjust-command-file-names
71 (lambda _
72 ;; Remove assumptions of FHS from start-statd script
73 (substitute* `("utils/statd/start-statd")
74 (("^PATH=.*") "")
75 (("^flock")
76 (string-append
77 (assoc-ref %build-inputs "util-linux")
78 "/bin/flock"))
79 (("^exec rpc.statd")
80 (string-append "exec "
81 (assoc-ref %outputs "out") "/sbin/rpc.statd")))
82
83 ;; find rpcgen
84 (substitute* "configure"
85 (("/usr/local/bin/rpcgen")
86 (which "rpcgen")))
87
88 ;; This hook tries to write to /var
89 ;; That needs to be done by a service too.
90 (substitute* `("Makefile.in")
91 (("^install-data-hook:")
92 "install-data-hook-disabled-for-guix:"))
93
94 ;; Replace some hard coded paths.
95 (substitute* `("utils/nfsd/nfssvc.c")
96 (("/bin/mount")
97 (string-append
98 (assoc-ref %build-inputs "util-linux")
99 "/bin/mount")))
100 (substitute* `("utils/statd/statd.c")
101 (("/usr/sbin/")
102 (string-append (assoc-ref %outputs "out") "/sbin/")))
103 (substitute* `("utils/mount/Makefile.in"
104 "utils/nfsdcld/Makefile.in"
105 "utils/nfsdcltrack/Makefile.in")
106 (("^sbindir = /sbin")
107 (string-append "sbindir = "
108 (assoc-ref %outputs "out") "/sbin")))
109 #t)))))
110 (inputs
111 `(("keyutils" ,keyutils)
112 ("libevent" ,libevent)
113 ("libnfsidmap" ,libnfsidmap)
114 ("rpcsvc-proto" ,rpcsvc-proto) ;for 'rpcgen'
115 ("sqlite" ,sqlite)
116 ("lvm2" ,lvm2)
117 ("util-linux" ,util-linux)
118 ("mit-krb5" ,mit-krb5)
119 ("libtirpc" ,libtirpc)
120 ("python-wrapper" ,python-wrapper))) ;for the Python based tools
121 (native-inputs
122 `(("pkg-config" ,pkg-config)))
123 (home-page "https://www.kernel.org/pub/linux/utils/nfs-utils/")
124 (synopsis "Tools for loading and managing Linux NFS mounts")
125 (description "The Network File System (NFS) was developed to allow
126 machines to mount a disk partition on a remote machine as if it were a local
127 disk. It allows for fast, seamless sharing of files across a network.")
128 ;; It is hard to be sure what the licence is. Most of the source files
129 ;; contain no licence notice at all. A few have a licence notice for a 3
130 ;; clause non-copyleft licence. However the tarball has a COPYING file
131 ;; with the text of GPLv2 -- It seems then that GLPv2 is the most
132 ;; restrictive licence, and until advice to the contrary we must assume
133 ;; that is what is intended.
134 (license license:gpl2)))