Commit | Line | Data |
---|---|---|
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> |
af09dabf SB |
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) | |
befac358 | 26 | #:use-module (guix git-download) |
af09dabf | 27 | #:use-module (guix packages) |
45151bcb | 28 | #:use-module (gnu packages autotools) |
415beccb MB |
29 | #:use-module (gnu packages check) |
30 | #:use-module (gnu packages flex) | |
45151bcb | 31 | #:use-module (gnu packages gettext) |
27f8d98f | 32 | #:use-module (gnu packages libevent) |
af09dabf SB |
33 | #:use-module (gnu packages linux) |
34 | #:use-module (gnu packages pkg-config) | |
9d0c291e | 35 | #:use-module (gnu packages sphinx) |
670a5e54 | 36 | #:use-module (gnu packages texinfo) |
af09dabf SB |
37 | #:use-module (gnu packages tls)) |
38 | ||
415beccb MB |
39 | (define-public drbd-utils |
40 | (package | |
41 | (name "drbd-utils") | |
d74c82b2 | 42 | (version "9.15.1") |
415beccb MB |
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 | |
d74c82b2 | 54 | "1q92bwnprqkkj9iy6fxcybcfpxvvjw5clis0igrbxqnq869kwp1i")) |
415beccb MB |
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 | ||
af09dabf SB |
134 | (define-public keepalived |
135 | (package | |
136 | (name "keepalived") | |
5e5b884e | 137 | (version "2.0.19") |
af09dabf SB |
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 | |
5e5b884e | 145 | "19scrrjsxw5g914d5ka352445blaq77dk2vm4vxabijvfra88bqf")))) |
af09dabf SB |
146 | (build-system gnu-build-system) |
147 | (arguments | |
148 | '(#:phases | |
149 | (modify-phases %standard-phases | |
670a5e54 SB |
150 | (add-after 'build 'build-info |
151 | (lambda _ | |
152 | (invoke "make" "-C" "doc" "texinfo") | |
153 | ;; Put images in a subdirectory as recommended by 'texinfo'. | |
2ac02060 | 154 | (install-file "doc/source/images/software_design.png" |
670a5e54 SB |
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) | |
2ac02060 | 165 | (install-file "doc/source/images/software_design.png" |
670a5e54 SB |
166 | (string-append infodir "/keepalived-figures")) |
167 | #t)))))) | |
af09dabf SB |
168 | (native-inputs |
169 | `(("pkg-config" ,pkg-config) | |
670a5e54 SB |
170 | ("python-sphinx" ,python-sphinx) |
171 | ("texinfo" ,texinfo))) | |
af09dabf SB |
172 | (inputs |
173 | `(("openssl" ,openssl) | |
174 | ("libnfnetlink" ,libnfnetlink) | |
175 | ("libnl" ,libnl))) | |
d1bfad2f | 176 | (home-page "https://www.keepalived.org/") |
34a05e8f | 177 | (synopsis "Load balancing and high-availability frameworks") |
af09dabf SB |
178 | (description |
179 | "Keepalived provides frameworks for both load balancing and high | |
180 | availability. The load balancing framework relies on the Linux Virtual | |
34a05e8f TGR |
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 | |
af09dabf SB |
183 | independently or together to provide resilient infrastructures.") |
184 | (license license:gpl2+))) | |
45151bcb AM |
185 | |
186 | (define-public libraft | |
187 | (package | |
188 | (name "libraft") | |
27f8d98f | 189 | (version "0.9.11") |
befac358 | 190 | (home-page "https://github.com/canonical/raft") |
45151bcb | 191 | (source (origin |
befac358 LC |
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)) | |
45151bcb AM |
196 | (sha256 |
197 | (base32 | |
27f8d98f AM |
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))) | |
45151bcb AM |
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) | |
45151bcb AM |
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))) |