| 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2016 John Darrington <jmd@gnu.org> |
| 3 | ;;; |
| 4 | ;;; This file is part of GNU Guix. |
| 5 | ;;; |
| 6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
| 7 | ;;; under the terms of the GNU General Public License as published by |
| 8 | ;;; the Free Software Foundation; either version 3 of the License, or (at |
| 9 | ;;; your option) any later version. |
| 10 | ;;; |
| 11 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
| 12 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | ;;; GNU General Public License for more details. |
| 15 | ;;; |
| 16 | ;;; You should have received a copy of the GNU General Public License |
| 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
| 18 | |
| 19 | (define-module (gnu packages nfs) |
| 20 | #:use-module (gnu packages) |
| 21 | #:use-module (gnu packages linux) |
| 22 | #:use-module (gnu packages databases) |
| 23 | #:use-module (gnu packages gsasl) |
| 24 | #:use-module (gnu packages libevent) |
| 25 | #:use-module (gnu packages mit-krb5) |
| 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)) |
| 40 | |
| 41 | (define-public nfs-utils |
| 42 | (package |
| 43 | (name "nfs-utils") |
| 44 | (version "1.3.4") |
| 45 | (source (origin |
| 46 | (method url-fetch) |
| 47 | (uri (string-append |
| 48 | "mirror://kernel.org/linux/utils/nfs-utils/" version |
| 49 | "/nfs-utils-" version ".tar.xz")) |
| 50 | (sha256 |
| 51 | (base32 |
| 52 | "0xarqhwy757vazv9gqhyrgxsrx083yhvkkih01jh83fqm305naml")))) |
| 53 | (build-system gnu-build-system) |
| 54 | (arguments |
| 55 | `(#:configure-flags |
| 56 | `("--without-tcp-wrappers" |
| 57 | ,(string-append "--with-start-statd=" |
| 58 | (assoc-ref %outputs "out") "/sbin/start-statd") |
| 59 | ,(string-append "--with-krb5=" (assoc-ref %build-inputs "mit-krb5"))) |
| 60 | #:phases (modify-phases %standard-phases |
| 61 | (add-before |
| 62 | 'configure 'adjust-command-file-names |
| 63 | (lambda _ |
| 64 | ;; Remove assumptions of FHS from start-statd script |
| 65 | (substitute* `("utils/statd/start-statd") |
| 66 | (("^PATH=.*") "") |
| 67 | (("^flock") |
| 68 | (string-append |
| 69 | (assoc-ref %build-inputs "util-linux") |
| 70 | "/bin/flock")) |
| 71 | (("^exec rpc.statd") |
| 72 | (string-append "exec " |
| 73 | (assoc-ref %outputs "out") "/sbin/rpc.statd"))) |
| 74 | |
| 75 | ;; This hook tries to write to /var |
| 76 | ;; That needs to be done by a service too. |
| 77 | (substitute* `("Makefile.in") |
| 78 | (("^install-data-hook:") |
| 79 | "install-data-hook-disabled-for-guix:")) |
| 80 | |
| 81 | ;; Replace some hard coded paths. |
| 82 | (substitute* `("utils/nfsd/nfssvc.c") |
| 83 | (("/bin/mount") |
| 84 | (string-append |
| 85 | (assoc-ref %build-inputs "util-linux") |
| 86 | "/bin/mount"))) |
| 87 | (substitute* `("utils/statd/statd.c") |
| 88 | (("/usr/sbin/") |
| 89 | (string-append (assoc-ref %outputs "out") "/sbin/"))) |
| 90 | (substitute* `("utils/osd_login/Makefile.in" |
| 91 | "utils/mount/Makefile.in" |
| 92 | "utils/nfsdcltrack/Makefile.in") |
| 93 | (("^sbindir = /sbin") |
| 94 | (string-append "sbindir = " |
| 95 | (assoc-ref %outputs "out") "/sbin"))) |
| 96 | #t))))) |
| 97 | (inputs `(("libevent" ,libevent) |
| 98 | ("libnfsidmap" ,libnfsidmap) |
| 99 | ("sqlite" ,sqlite) |
| 100 | ("lvm2" ,lvm2) |
| 101 | ("gss" ,gss) |
| 102 | ("util-linux" ,util-linux) |
| 103 | ("mit-krb5" ,mit-krb5) |
| 104 | ("libtirpc" ,libtirpc))) |
| 105 | (native-inputs |
| 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))) |