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