nfs.scm 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. ;;;
  6. ;;; This file is part of GNU Guix.
  7. ;;;
  8. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  9. ;;; under the terms of the GNU General Public License as published by
  10. ;;; the Free Software Foundation; either version 3 of the License, or (at
  11. ;;; your option) any later version.
  12. ;;;
  13. ;;; GNU Guix is distributed in the hope that it will be useful, but
  14. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. ;;; GNU General Public License for more details.
  17. ;;;
  18. ;;; You should have received a copy of the GNU General Public License
  19. ;;; 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 libevent)
  24. #:use-module (gnu packages kerberos)
  25. #:use-module (gnu packages onc-rpc)
  26. #:use-module (gnu packages pkg-config)
  27. #:use-module (gnu packages sqlite)
  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. (define-public nfs-utils
  41. (package
  42. (name "nfs-utils")
  43. (version "2.1.1")
  44. (source (origin
  45. (method url-fetch)
  46. (uri (string-append
  47. "mirror://kernel.org/linux/utils/nfs-utils/" version
  48. "/nfs-utils-" version ".tar.xz"))
  49. (patches (search-patches "nfs-utils-missing-headers.patch"))
  50. (sha256
  51. (base32
  52. "1vqrqzhg9nh2wj1icp7k8v9dibgnn521b45np79nnkmqf16bbbhg"))))
  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
  61. (modify-phases %standard-phases
  62. (add-after 'unpack 'fix-glibc-compatability
  63. (lambda _
  64. (substitute* '("utils/blkmapd/device-discovery.c"
  65. "utils/blkmapd/dm-device.c")
  66. (("<sys/stat.h>")
  67. "<sys/stat.h>\n#include <sys/sysmacros.h>"))
  68. #t))
  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. ;; This hook tries to write to /var
  82. ;; That needs to be done by a service too.
  83. (substitute* `("Makefile.in")
  84. (("^install-data-hook:")
  85. "install-data-hook-disabled-for-guix:"))
  86. ;; Replace some hard coded paths.
  87. (substitute* `("utils/nfsd/nfssvc.c")
  88. (("/bin/mount")
  89. (string-append
  90. (assoc-ref %build-inputs "util-linux")
  91. "/bin/mount")))
  92. (substitute* `("utils/statd/statd.c")
  93. (("/usr/sbin/")
  94. (string-append (assoc-ref %outputs "out") "/sbin/")))
  95. (substitute* `("utils/osd_login/Makefile.in"
  96. "utils/mount/Makefile.in"
  97. "utils/nfsdcltrack/Makefile.in")
  98. (("^sbindir = /sbin")
  99. (string-append "sbindir = "
  100. (assoc-ref %outputs "out") "/sbin")))
  101. #t)))))
  102. (inputs `(("libevent" ,libevent)
  103. ("libnfsidmap" ,libnfsidmap)
  104. ("sqlite" ,sqlite)
  105. ("lvm2" ,lvm2)
  106. ("util-linux" ,util-linux)
  107. ("mit-krb5" ,mit-krb5)
  108. ("libtirpc" ,libtirpc)))
  109. (native-inputs
  110. `(("pkg-config" ,pkg-config)))
  111. (home-page "http://www.kernel.org/pub/linux/utils/nfs-utils/")
  112. (synopsis "Tools for loading and managing Linux NFS mounts")
  113. (description "The Network File System (NFS) was developed to allow
  114. machines to mount a disk partition on a remote machine as if it were a local
  115. disk. It allows for fast, seamless sharing of files across a network.")
  116. ;; It is hard to be sure what the licence is. Most of the source files
  117. ;; contain no licence notice at all. A few have a licence notice for a 3
  118. ;; clause non-copyleft licence. However the tarball has a COPYING file
  119. ;; with the text of GPLv2 -- It seems then that GLPv2 is the most
  120. ;; restrictive licence, and until advice to the contrary we must assume
  121. ;; that is what is intended.
  122. (license license:gpl2)))