Commit | Line | Data |
---|---|---|
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> |
e9aba1ea JD |
4 | ;;; |
5 | ;;; This file is part of GNU Guix. | |
6 | ;;; | |
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. | |
11 | ;;; | |
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. | |
16 | ;;; | |
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/>. | |
19 | ||
20 | (define-module (gnu packages nfs) | |
21 | #:use-module (gnu packages) | |
22 | #:use-module (gnu packages linux) | |
23 | #:use-module (gnu packages databases) | |
e9aba1ea | 24 | #:use-module (gnu packages libevent) |
89e34644 | 25 | #:use-module (gnu packages kerberos) |
e9aba1ea JD |
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") | |
a472f0d0 | 44 | (version "2.1.1") |
e9aba1ea JD |
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")) | |
606e2468 | 50 | (patches (search-patches "nfs-utils-missing-headers.patch")) |
e9aba1ea JD |
51 | (sha256 |
52 | (base32 | |
a472f0d0 | 53 | "1vqrqzhg9nh2wj1icp7k8v9dibgnn521b45np79nnkmqf16bbbhg")))) |
e9aba1ea JD |
54 | (build-system gnu-build-system) |
55 | (arguments | |
56 | `(#:configure-flags | |
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"))) | |
d14b8dbb LF |
61 | #:phases |
62 | (modify-phases %standard-phases | |
63 | (add-before 'configure 'adjust-command-file-names | |
64 | (lambda _ | |
65 | ;; Remove assumptions of FHS from start-statd script | |
66 | (substitute* `("utils/statd/start-statd") | |
67 | (("^PATH=.*") "") | |
68 | (("^flock") | |
69 | (string-append | |
70 | (assoc-ref %build-inputs "util-linux") | |
71 | "/bin/flock")) | |
72 | (("^exec rpc.statd") | |
73 | (string-append "exec " | |
74 | (assoc-ref %outputs "out") "/sbin/rpc.statd"))) | |
e9aba1ea | 75 | |
d14b8dbb LF |
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:")) | |
e9aba1ea | 81 | |
d14b8dbb LF |
82 | ;; Replace some hard coded paths. |
83 | (substitute* `("utils/nfsd/nfssvc.c") | |
84 | (("/bin/mount") | |
85 | (string-append | |
86 | (assoc-ref %build-inputs "util-linux") | |
87 | "/bin/mount"))) | |
88 | (substitute* `("utils/statd/statd.c") | |
89 | (("/usr/sbin/") | |
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") | |
94 | (("^sbindir = /sbin") | |
95 | (string-append "sbindir = " | |
96 | (assoc-ref %outputs "out") "/sbin"))) | |
97 | #t))))) | |
e9aba1ea JD |
98 | (inputs `(("libevent" ,libevent) |
99 | ("libnfsidmap" ,libnfsidmap) | |
100 | ("sqlite" ,sqlite) | |
101 | ("lvm2" ,lvm2) | |
e9aba1ea JD |
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))) |