projects/guix·blob python-team · refs

175 lines · 7.2 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2016 John Darrington <[email protected]>
3;;; Copyright © 2017, 2018 Leo Famulari <[email protected]>
4;;; Copyright © 2018 Efraim Flashner <[email protected]>
5;;; Copyright © 2020 Ricardo Wurmus <[email protected]>
6;;; Copyright © 2020 Tobias Geerinckx-Rice <[email protected]>
7;;; Copyright © 2020 Lars-Dominik Braun <[email protected]>
8;;;
9;;; This file is part of GNU Guix.
10;;;
11;;; GNU Guix is free software; you can redistribute it and/or modify it
12;;; under the terms of the GNU General Public License as published by
13;;; the Free Software Foundation; either version 3 of the License, or (at
14;;; your option) any later version.
15;;;
16;;; GNU Guix is distributed in the hope that it will be useful, but
17;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;;; GNU General Public License for more details.
20;;;
21;;; You should have received a copy of the GNU General Public License
22;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24(define-module (gnu packages nfs)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages attr)
27 #:use-module (gnu packages autotools)
28 #:use-module (gnu packages crypto)
29 #:use-module (gnu packages linux)
30 #:use-module (gnu packages libevent)
31 #:use-module (gnu packages kerberos)
32 #:use-module (gnu packages onc-rpc)
33 #:use-module (gnu packages pkg-config)
34 #:use-module (gnu packages python)
35 #:use-module (gnu packages sqlite)
36 #:use-module (guix build-system gnu)
37 #:use-module (guix download)
38 #:use-module (guix git-download)
39 #:use-module ((guix licenses) #:prefix license:)
40 #:use-module (guix packages)
41 #:use-module (guix utils)
42 #:use-module (srfi srfi-1)
43 #:use-module (srfi srfi-2)
44 #:use-module (srfi srfi-26)
45 #:use-module (ice-9 match))
46
47(define-public nfs-utils
48 (package
49 (name "nfs-utils")
50 (version "2.4.3")
51 (source (origin
52 (method url-fetch)
53 (uri (string-append
54 "mirror://kernel.org/linux/utils/nfs-utils/" version
55 "/nfs-utils-" version ".tar.xz"))
56 (sha256
57 (base32
58 "16b5y82cjy1cvijg5zmdvivc6sfdlv2slyynxbwwyw43vpjzqrdg"))))
59 (build-system gnu-build-system)
60 (arguments
61 `(#:configure-flags
62 `("--disable-static"
63 "--without-tcp-wrappers"
64 ,(string-append "--with-start-statd="
65 (assoc-ref %outputs "out") "/sbin/start-statd")
66 ,(string-append "--with-krb5=" (assoc-ref %build-inputs "mit-krb5"))
67 ,(string-append "--with-pluginpath="
68 (assoc-ref %outputs "out")
69 "/lib/libnfsidmap")
70 "--enable-svcgss")
71 #:phases
72 (modify-phases %standard-phases
73 (add-before 'configure 'adjust-command-file-names
74 (lambda _
75 ;; Remove assumptions of FHS from start-statd script
76 (substitute* `("utils/statd/start-statd")
77 (("^PATH=.*") "")
78 (("^flock")
79 (string-append
80 (assoc-ref %build-inputs "util-linux")
81 "/bin/flock"))
82 (("^exec rpc.statd")
83 (string-append "exec "
84 (assoc-ref %outputs "out") "/sbin/rpc.statd")))
85
86 ;; find rpcgen
87 (substitute* "configure"
88 (("/usr/local/bin/rpcgen")
89 (which "rpcgen")))
90
91 ;; This hook tries to write to /var
92 ;; That needs to be done by a service too.
93 (substitute* `("Makefile.in")
94 (("^install-data-hook:")
95 "install-data-hook-disabled-for-guix:"))
96
97 ;; Replace some hard coded paths.
98 (substitute* `("utils/nfsd/nfssvc.c")
99 (("/bin/mount")
100 (string-append
101 (assoc-ref %build-inputs "util-linux")
102 "/bin/mount")))
103 (substitute* `("utils/statd/statd.c")
104 (("/usr/sbin/")
105 (string-append (assoc-ref %outputs "out") "/sbin/")))
106 (substitute* `("utils/mount/Makefile.in"
107 "utils/nfsdcld/Makefile.in"
108 "utils/nfsdcltrack/Makefile.in")
109 (("^sbindir = /sbin")
110 (string-append "sbindir = "
111 (assoc-ref %outputs "out") "/sbin")))
112 #t)))))
113 (inputs
114 `(("keyutils" ,keyutils)
115 ("libevent" ,libevent)
116 ("rpcsvc-proto" ,rpcsvc-proto) ;for 'rpcgen'
117 ("sqlite" ,sqlite)
118 ("lvm2" ,lvm2)
119 ("util-linux" ,util-linux) ; only for above substitutions
120 ("util-linux:lib" ,util-linux "lib") ; for libblkid
121 ("mit-krb5" ,mit-krb5)
122 ("libtirpc" ,libtirpc)
123 ("python-wrapper" ,python-wrapper))) ;for the Python based tools
124 (native-inputs
125 (list pkg-config))
126 (home-page "https://www.kernel.org/pub/linux/utils/nfs-utils/")
127 (synopsis "Tools for loading and managing Linux NFS mounts")
128 (description "The Network File System (NFS) was developed to allow
129machines to mount a disk partition on a remote machine as if it were a local
130disk. It allows for fast, seamless sharing of files across a network.")
131 ;; It is hard to be sure what the licence is. Most of the source files
132 ;; contain no licence notice at all. A few have a licence notice for a 3
133 ;; clause non-copyleft licence. However the tarball has a COPYING file
134 ;; with the text of GPLv2 -- It seems then that GLPv2 is the most
135 ;; restrictive licence, and until advice to the contrary we must assume
136 ;; that is what is intended.
137 (license license:gpl2)))
138
139(define-public nfs4-acl-tools
140 (package
141 (name "nfs4-acl-tools")
142 (version "0.3.7")
143 (source (origin
144 (method git-fetch)
145 ;; tarballs are available here:
146 ;; http://linux-nfs.org/~bfields/nfs4-acl-tools/
147 (uri (git-reference
148 (url "git://git.linux-nfs.org/projects/bfields/nfs4-acl-tools.git")
149 (commit (string-append name "-" version))))
150 (file-name (git-file-name name version))
151 (sha256
152 (base32
153 "0lq9xdaskxysggs918vs8x42xvmg9nj7lla21ni2scw5ljld3h1i"))
154 (patches (search-patches "nfs4-acl-tools-0.3.7-fixpaths.patch"))))
155 (build-system gnu-build-system)
156 (arguments
157 `(#:tests? #f ; no tests
158 #:phases
159 (modify-phases %standard-phases
160 (add-after 'unpack 'fix-bin-sh
161 (lambda _
162 (substitute* "include/buildmacros"
163 (("/bin/sh") (which "sh")))
164 #t)))))
165 (native-inputs
166 (list automake autoconf libtool))
167 (inputs
168 (list attr))
169 (home-page "https://linux-nfs.org/wiki/index.php/Main_Page")
170 (synopsis "Commandline ACL utilities for the Linux NFSv4 client")
171 (description "This package provides the commandline utilities
172@command{nfs4_getfacl} and @command{nfs4_setfacl}, which are similar to their
173POSIX equivalents @command{getfacl} and @command{setfacl}. They fetch and
174manipulate access control lists for files and directories on NFSv4 mounts.")
175 (license license:bsd-3)))