gnu: emacs-consult: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / cluster.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2018 Sou Bunnbu <iyzsong@member.fsf.org>
3 ;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
4 ;;; Copyright © 2019 Andrew Miloradovsky <andrew@interpretmath.pw>
5 ;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages cluster)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (guix build-system gnu)
25 #:use-module (guix download)
26 #:use-module (guix git-download)
27 #:use-module (guix packages)
28 #:use-module (gnu packages autotools)
29 #:use-module (gnu packages check)
30 #:use-module (gnu packages flex)
31 #:use-module (gnu packages gettext)
32 #:use-module (gnu packages libevent)
33 #:use-module (gnu packages linux)
34 #:use-module (gnu packages pkg-config)
35 #:use-module (gnu packages sphinx)
36 #:use-module (gnu packages texinfo)
37 #:use-module (gnu packages tls))
38
39 (define-public drbd-utils
40 (package
41 (name "drbd-utils")
42 (version "9.15.1")
43 (source (origin
44 (method url-fetch)
45 ;; Older releases are moved to /archive. List it first because in
46 ;; practice this URL will be the most current (e.g. time-machine).
47 (uri (list (string-append "https://www.linbit.com/downloads/drbd"
48 "/utils/archive/drbd-utils-" version
49 ".tar.gz")
50 (string-append "https://www.linbit.com/downloads/drbd"
51 "/utils/drbd-utils-" version ".tar.gz")))
52 (sha256
53 (base32
54 "1q92bwnprqkkj9iy6fxcybcfpxvvjw5clis0igrbxqnq869kwp1i"))
55 (modules '((guix build utils)))
56 (snippet
57 '(begin
58 (substitute* "scripts/global_common.conf"
59 ;; Do not participate in usage count survey by default.
60 (("usage-count: yes")
61 "usage-count: no"))
62 (substitute* "scripts/Makefile.in"
63 ;; Install the Pacemaker resource agents to the libdir,
64 ;; regardless of what the OCF specification says...
65 (("\\$\\(DESTDIR\\)/usr/lib")
66 "$(DESTDIR)$(LIBDIR)"))
67 (substitute* "configure"
68 ;; Use a sensible default udev rules directory.
69 (("default_udevdir=/lib/udev")
70 "default_udevdir='${prefix}/lib/udev'"))
71 #t))))
72 (build-system gnu-build-system)
73 (arguments
74 `(#:configure-flags '(;; Do not install sysv or systemd init scripts.
75 "--with-initscripttype=none"
76 ;; Use the pre-built manual pages present in release
77 ;; tarballs instead of generating them from scratch.
78 "--with-prebuiltman"
79 ;; Disable support for DRBD 8.3 as it is only for
80 ;; Linux-Libre versions < 3.8. 8.4 is the latest
81 ;; kernel driver as of Linux 5.7.
82 "--without-83support"
83 "--sysconfdir=/etc"
84 "--localstatedir=/var")
85 #:test-target "test"
86 #:phases
87 (modify-phases %standard-phases
88 (add-after 'patch-generated-file-shebangs 'patch-documentation
89 (lambda _
90 ;; The preceding phase misses some Makefiles with unusual file
91 ;; names, so we handle those here.
92 (for-each patch-makefile-SHELL (find-files "documentation/common"
93 "^Makefile"))
94 #t))
95 (add-before 'configure 'use-absolute-/lib/drbd
96 (lambda* (#:key outputs #:allow-other-keys)
97 (let ((out (assoc-ref outputs "out")))
98 ;; Look for auxiliary executables below exec_prefix instead
99 ;; of assuming /lib/drbd (see TODO comment in the file).
100 (substitute* "user/v9/drbdtool_common.c"
101 (("\"/lib/drbd\"")
102 (string-append "\"" out "/lib/drbd\"")))
103 #t)))
104 (add-after 'configure 'adjust-installation-directories
105 (lambda _
106 ;; Do not attempt to create /etc or /var.
107 (substitute* "scripts/Makefile"
108 (("\\$\\(DESTDIR\\)\\$\\(sysconfdir\\)")
109 "$(DESTDIR)$(prefix)$(sysconfdir)"))
110 (substitute* "user/v84/Makefile"
111 (("\\$\\(DESTDIR\\)\\$\\(localstatedir\\)")
112 "$(DESTDIR)$(prefix)$(localstatedir)")
113 (("\\$\\(DESTDIR\\)/lib/drbd")
114 "$(DESTDIR)$(prefix)/lib/drbd"))
115 (substitute* "user/v9/Makefile"
116 (("\\$\\(DESTDIR\\)\\$\\(localstatedir\\)")
117 "$(DESTDIR)$(prefix)$(localstatedir)")
118 (("\\$\\(DESTDIR\\)\\$\\(DRBD_LIB_DIR\\)")
119 "$(DESTDIR)$(prefix)$(DRBD_LIB_DIR)"))
120 #t)))))
121 (native-inputs
122 `(("clitest" ,clitest)
123 ("flex" ,flex)
124 ("udev" ,eudev))) ;just to satisfy a configure check
125 (home-page "https://www.linbit.com/drbd/")
126 (synopsis "Replicate block devices between machines")
127 (description
128 "@acronym{DRBD, Distributed Replicated Block Device} is a software-based,
129 shared-nothing, replicated storage solution mirroring the content of block
130 devices (hard disks, partitions, logical volumes etc.) over any network
131 connection. This package contains the userland utilities.")
132 (license license:gpl2+)))
133
134 (define-public keepalived
135 (package
136 (name "keepalived")
137 (version "2.0.19")
138 (source (origin
139 (method url-fetch)
140 (uri (string-append
141 "http://www.keepalived.org/software/keepalived-"
142 version ".tar.gz"))
143 (sha256
144 (base32
145 "19scrrjsxw5g914d5ka352445blaq77dk2vm4vxabijvfra88bqf"))))
146 (build-system gnu-build-system)
147 (arguments
148 '(#:phases
149 (modify-phases %standard-phases
150 (add-after 'build 'build-info
151 (lambda _
152 (invoke "make" "-C" "doc" "texinfo")
153 ;; Put images in a subdirectory as recommended by 'texinfo'.
154 (install-file "doc/source/images/software_design.png"
155 "doc/build/texinfo/keepalived-figures")
156 (substitute* "doc/build/texinfo/keepalived.texi"
157 (("@image\\{software_design,")
158 "@image{keepalived-figures/software_design,"))
159 (invoke "make" "-C" "doc/build/texinfo")))
160 (add-after 'install 'install-info
161 (lambda* (#:key outputs #:allow-other-keys)
162 (let* ((out (assoc-ref outputs "out"))
163 (infodir (string-append out "/share/info")))
164 (install-file "doc/build/texinfo/keepalived.info" infodir)
165 (install-file "doc/source/images/software_design.png"
166 (string-append infodir "/keepalived-figures"))
167 #t))))))
168 (native-inputs
169 `(("pkg-config" ,pkg-config)
170 ("python-sphinx" ,python-sphinx)
171 ("texinfo" ,texinfo)))
172 (inputs
173 `(("openssl" ,openssl)
174 ("libnfnetlink" ,libnfnetlink)
175 ("libnl" ,libnl)))
176 (home-page "https://www.keepalived.org/")
177 (synopsis "Load balancing and high-availability frameworks")
178 (description
179 "Keepalived provides frameworks for both load balancing and high
180 availability. The load balancing framework relies on the Linux Virtual
181 Server (@dfn{IPVS}) kernel module. High availability is achieved by the Virtual
182 Redundancy Routing Protocol (@dfn{VRRP}). Each Keepalived framework can be used
183 independently or together to provide resilient infrastructures.")
184 (license license:gpl2+)))
185
186 (define-public libraft
187 (package
188 (name "libraft")
189 (version "0.9.11")
190 (home-page "https://github.com/canonical/raft")
191 (source (origin
192 (method git-fetch)
193 (uri (git-reference (url home-page)
194 (commit (string-append "v" version))))
195 (file-name (git-file-name name version))
196 (sha256
197 (base32
198 "00rsq4z9nykmf7r5rlpv1y6bvckcmg3zv57vh1h681y5pij6cch1"))))
199 (arguments '(#:configure-flags '("--enable-uv")
200 #:phases
201 (modify-phases %standard-phases
202 (add-after 'unpack 'disable-failing-tests
203 (lambda _
204 (substitute* "Makefile.am"
205 ((".*test_uv_append.c.*") ""))
206 #t)))))
207 (inputs
208 `(("libuv" ,libuv)))
209 (native-inputs
210 `(("autoconf" ,autoconf)
211 ("automake" ,automake)
212 ("gettext" ,gettext-minimal)
213 ("libtool" ,libtool)
214 ("pkg-config" ,pkg-config)))
215 (build-system gnu-build-system)
216 (synopsis "C implementation of the Raft consensus protocol")
217 (description "The library has modular design: its core part implements only
218 the core Raft algorithm logic, in a fully platform independent way. On top of
219 that, a pluggable interface defines the I/O implementation for networking
220 (send/receive RPC messages) and disk persistence (store log entries and
221 snapshots).")
222 (license license:asl2.0)))