nfs.scm 4.8 KB

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