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