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>
7 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
39 (define-public drbd-utils
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
50 (string-append "https://www.linbit.com/downloads/drbd"
51 "/utils/drbd-utils-" version ".tar.gz")))
54 "1q92bwnprqkkj9iy6fxcybcfpxvvjw5clis0igrbxqnq869kwp1i"))
55 (modules '((guix build utils)))
58 (substitute* "scripts/global_common.conf"
59 ;; Do not participate in usage count survey by default.
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'"))
72 (build-system gnu-build-system)
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.
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.
84 "--localstatedir=/var")
87 (modify-phases %standard-phases
88 (add-after 'patch-generated-file-shebangs 'patch-documentation
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"
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"
102 (string-append "\"" out "/lib/drbd\"")))
104 (add-after 'configure 'adjust-installation-directories
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)"))
122 `(("clitest" ,clitest)
124 ("udev" ,eudev))) ;just to satisfy a configure check
125 (home-page "https://www.linbit.com/drbd/")
126 (synopsis "Replicate block devices between machines")
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+)))
134 (define-public keepalived
141 "http://www.keepalived.org/software/keepalived-"
145 "19scrrjsxw5g914d5ka352445blaq77dk2vm4vxabijvfra88bqf"))))
146 (build-system gnu-build-system)
149 (modify-phases %standard-phases
150 (add-after 'build 'build-info
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"))
169 `(("pkg-config" ,pkg-config)
170 ("python-sphinx" ,python-sphinx)
171 ("texinfo" ,texinfo)))
173 `(("openssl" ,openssl)
174 ("libnfnetlink" ,libnfnetlink)
176 (home-page "https://www.keepalived.org/")
177 (synopsis "Load balancing and high-availability frameworks")
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+)))
186 (define-public libraft
190 (home-page "https://github.com/canonical/raft")
193 (uri (git-reference (url home-page)
194 (commit (string-append "v" version))))
195 (file-name (git-file-name name version))
198 "00rsq4z9nykmf7r5rlpv1y6bvckcmg3zv57vh1h681y5pij6cch1"))))
199 (arguments '(#:configure-flags '("--enable-uv")
201 (modify-phases %standard-phases
202 (add-after 'unpack 'disable-failing-tests
204 (substitute* "Makefile.am"
205 ((".*test_uv_append.c.*") ""))
210 `(("autoconf" ,autoconf)
211 ("automake" ,automake)
212 ("gettext" ,gettext-minimal)
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
222 (license license:asl2.0)))