Merge remote-tracking branch 'origin/master' into core-updates
[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 Tobias Geerinckx-Rice <me@tobias.gr>
4 ;;; Copyright © 2019 Andrew Miloradovsky <andrew@interpretmath.pw>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21 (define-module (gnu packages cluster)
22 #:use-module ((guix licenses) #:prefix license:)
23 #:use-module (guix build-system gnu)
24 #:use-module (guix download)
25 #:use-module (guix git-download)
26 #:use-module (guix packages)
27 #:use-module (gnu packages autotools)
28 #:use-module (gnu packages gettext)
29 #:use-module (gnu packages libevent)
30 #:use-module (gnu packages linux)
31 #:use-module (gnu packages pkg-config)
32 #:use-module (gnu packages sphinx)
33 #:use-module (gnu packages texinfo)
34 #:use-module (gnu packages tls))
35
36 (define-public keepalived
37 (package
38 (name "keepalived")
39 (version "2.0.18")
40 (source (origin
41 (method url-fetch)
42 (uri (string-append
43 "http://www.keepalived.org/software/keepalived-"
44 version ".tar.gz"))
45 (sha256
46 (base32
47 "1l2g0bzzbah9svfpwa0b9dgvwfv85r2y3qdr54822hg5p2qs48ql"))))
48 (build-system gnu-build-system)
49 (arguments
50 '(#:phases
51 (modify-phases %standard-phases
52 (add-after 'build 'build-info
53 (lambda _
54 (invoke "make" "-C" "doc" "texinfo")
55 ;; Put images in a subdirectory as recommended by 'texinfo'.
56 (install-file "doc/source/images/software_design.png"
57 "doc/build/texinfo/keepalived-figures")
58 (substitute* "doc/build/texinfo/keepalived.texi"
59 (("@image\\{software_design,")
60 "@image{keepalived-figures/software_design,"))
61 (invoke "make" "-C" "doc/build/texinfo")))
62 (add-after 'install 'install-info
63 (lambda* (#:key outputs #:allow-other-keys)
64 (let* ((out (assoc-ref outputs "out"))
65 (infodir (string-append out "/share/info")))
66 (install-file "doc/build/texinfo/keepalived.info" infodir)
67 (install-file "doc/source/images/software_design.png"
68 (string-append infodir "/keepalived-figures"))
69 #t))))))
70 (native-inputs
71 `(("pkg-config" ,pkg-config)
72 ("python-sphinx" ,python-sphinx)
73 ("texinfo" ,texinfo)))
74 (inputs
75 `(("openssl" ,openssl)
76 ("libnfnetlink" ,libnfnetlink)
77 ("libnl" ,libnl)))
78 (home-page "https://www.keepalived.org/")
79 (synopsis "Load balancing and high-availability frameworks")
80 (description
81 "Keepalived provides frameworks for both load balancing and high
82 availability. The load balancing framework relies on the Linux Virtual
83 Server (@dfn{IPVS}) kernel module. High availability is achieved by the Virtual
84 Redundancy Routing Protocol (@dfn{VRRP}). Each Keepalived framework can be used
85 independently or together to provide resilient infrastructures.")
86 (license license:gpl2+)))
87
88 (define-public libraft
89 (package
90 (name "libraft")
91 (version "0.9.11")
92 (home-page "https://github.com/canonical/raft")
93 (source (origin
94 (method git-fetch)
95 (uri (git-reference (url home-page)
96 (commit (string-append "v" version))))
97 (file-name (git-file-name name version))
98 (sha256
99 (base32
100 "00rsq4z9nykmf7r5rlpv1y6bvckcmg3zv57vh1h681y5pij6cch1"))))
101 (arguments '(#:configure-flags '("--enable-uv")
102 #:phases
103 (modify-phases %standard-phases
104 (add-after 'unpack 'disable-failing-tests
105 (lambda _
106 (substitute* "Makefile.am"
107 ((".*test_uv_append.c.*") ""))
108 #t)))))
109 (inputs
110 `(("libuv" ,libuv)))
111 (native-inputs
112 `(("autoconf" ,autoconf)
113 ("automake" ,automake)
114 ("gettext" ,gettext-minimal)
115 ("libtool" ,libtool)
116 ("pkg-config" ,pkg-config)))
117 (build-system gnu-build-system)
118 (synopsis "C implementation of the Raft consensus protocol")
119 (description "The library has modular design: its core part implements only
120 the core Raft algorithm logic, in a fully platform independent way. On top of
121 that, a pluggable interface defines the I/O implementation for networking
122 (send/receive RPC messages) and disk persistence (store log entries and
123 snapshots).")
124 (license license:asl2.0)))