| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 |
|
| 24 | (define-module (gnu packages cluster)
|
| 25 | #:use-module ((guix licenses) #:prefix license:)
|
| 26 | #:use-module (guix gexp)
|
| 27 | #:use-module (guix build-system gnu)
|
| 28 | #:use-module (guix download)
|
| 29 | #:use-module (guix git-download)
|
| 30 | #:use-module (guix packages)
|
| 31 | #:use-module (gnu packages autotools)
|
| 32 | #:use-module (gnu packages check)
|
| 33 | #:use-module (gnu packages compression)
|
| 34 | #:use-module (gnu packages docbook)
|
| 35 | #:use-module (gnu packages compiler-tools)
|
| 36 | #:use-module (gnu packages gettext)
|
| 37 | #:use-module (gnu packages libevent)
|
| 38 | #:use-module (gnu packages linux)
|
| 39 | #:use-module (gnu packages pkg-config)
|
| 40 | #:use-module (gnu packages ruby-xyz)
|
| 41 | #:use-module (gnu packages sphinx)
|
| 42 | #:use-module (gnu packages sqlite)
|
| 43 | #:use-module (gnu packages texinfo)
|
| 44 | #:use-module (gnu packages tls)
|
| 45 | #:use-module (gnu packages xml))
|
| 46 |
|
| 47 | (define-public drbd-utils
|
| 48 | (package
|
| 49 | (name "drbd-utils")
|
| 50 | (version "9.31.0")
|
| 51 | (source (origin
|
| 52 | (method url-fetch)
|
| 53 | (uri (list (string-append "https://pkg.linbit.com/downloads/drbd"
|
| 54 | "/utils/drbd-utils-" version ".tar.gz")))
|
| 55 | (sha256
|
| 56 | (base32
|
| 57 | "0z6iqc18r5y65c0zk9xr0nzr1cjy3d4zzklfs4158k0zh3ga0y3r"))
|
| 58 | (modules '((guix build utils)))
|
| 59 | (snippet
|
| 60 | '(begin
|
| 61 | (substitute* "scripts/global_common.conf"
|
| 62 | |
| 63 | (("usage-count yes")
|
| 64 | "usage-count no"))
|
| 65 | (substitute* "scripts/Makefile.in"
|
| 66 | |
| 67 | |
| 68 | (("\\$\\(DESTDIR\\)/usr/lib")
|
| 69 | "$(DESTDIR)$(LIBDIR)"))
|
| 70 | (substitute* "configure"
|
| 71 | |
| 72 | (("default_udevdir=/lib/udev")
|
| 73 | "default_udevdir='${prefix}/lib/udev'"))))))
|
| 74 | (build-system gnu-build-system)
|
| 75 | (arguments
|
| 76 | (list
|
| 77 | #:configure-flags
|
| 78 | #~(append
|
| 79 | (list "--sysconfdir=/etc"
|
| 80 | "--localstatedir=/var"
|
| 81 | |
| 82 | "--with-initscripttype=none"
|
| 83 | |
| 84 | |
| 85 | |
| 86 | "--without-83support")
|
| 87 | #$(if (this-package-native-input "ruby-asciidoctor")
|
| 88 | #~'()
|
| 89 | #~(list "--without-manual")))
|
| 90 | #:test-target "test"
|
| 91 | #:make-flags #~(list "WANT_DRBD_REPRODUCIBLE_BUILD=yesplease")
|
| 92 | #:phases
|
| 93 | #~(modify-phases %standard-phases
|
| 94 | (add-after 'unpack 'disable-ja-translation
|
| 95 | (lambda _
|
| 96 | |
| 97 | |
| 98 | |
| 99 | (substitute* "Makefile.in"
|
| 100 | (("(DOC_DIRS.*)documentation/ja/v[[:digit:]]+" _ match)
|
| 101 | match)
|
| 102 | (("[[:blank:]]+\\$\\(MAKE\\) -C documentation/ja/v[[:digit:]]+.*")
|
| 103 | ""))))
|
| 104 | (add-after 'patch-generated-file-shebangs 'patch-documentation
|
| 105 | (lambda _
|
| 106 | |
| 107 | |
| 108 | (for-each patch-makefile-SHELL (find-files "documentation/common"
|
| 109 | "^Makefile"))))
|
| 110 | (add-before 'configure 'use-absolute-/lib/drbd
|
| 111 | (lambda _
|
| 112 | |
| 113 | |
| 114 | (substitute* "user/v9/drbdtool_common.c"
|
| 115 | (("\"/lib/drbd\"")
|
| 116 | (string-append "\"" #$output "/lib/drbd\"")))))
|
| 117 | (add-after 'configure 'adjust-installation-directories
|
| 118 | (lambda _
|
| 119 | |
| 120 | (substitute* "scripts/Makefile"
|
| 121 | (("\\$\\(DESTDIR\\)\\$\\(sysconfdir\\)")
|
| 122 | "$(DESTDIR)$(prefix)$(sysconfdir)"))
|
| 123 | (substitute* "user/v84/Makefile"
|
| 124 | (("\\$\\(DESTDIR\\)\\$\\(localstatedir\\)")
|
| 125 | "$(DESTDIR)$(prefix)$(localstatedir)")
|
| 126 | (("\\$\\(DESTDIR\\)/lib/drbd")
|
| 127 | "$(DESTDIR)$(prefix)/lib/drbd"))
|
| 128 | (substitute* "user/v9/Makefile"
|
| 129 | (("\\$\\(DESTDIR\\)\\$\\(localstatedir\\)")
|
| 130 | "$(DESTDIR)$(prefix)$(localstatedir)")
|
| 131 | (("\\$\\(DESTDIR\\)\\$\\(DRBD_LIB_DIR\\)")
|
| 132 | "$(DESTDIR)$(prefix)$(DRBD_LIB_DIR)")))))))
|
| 133 | (native-inputs
|
| 134 | (append (list clitest
|
| 135 | eudev |
| 136 | flex)
|
| 137 | |
| 138 | (if (supported-package? ruby-asciidoctor/minimal)
|
| 139 | (list docbook-xml
|
| 140 | docbook-xml-4.4 |
| 141 | docbook-xsl
|
| 142 | libxslt |
| 143 | ruby-asciidoctor/minimal)
|
| 144 | '())))
|
| 145 | (home-page "https://www.linbit.com/drbd/")
|
| 146 | (synopsis "Replicate block devices between machines")
|
| 147 | (description
|
| 148 | "@acronym{DRBD, Distributed Replicated Block Device} is a software-based,
|
| 149 | shared-nothing, replicated storage solution mirroring the content of block
|
| 150 | devices (hard disks, partitions, logical volumes etc.) over any network
|
| 151 | connection. This package contains the userland utilities.")
|
| 152 | (properties
|
| 153 | '((release-monitoring-url
|
| 154 | . "https://www.linbit.com/en/drbd-community/drbd-download/")))
|
| 155 | (license license:gpl2+)))
|
| 156 |
|
| 157 | (define-public keepalived
|
| 158 | (package
|
| 159 | (name "keepalived")
|
| 160 | (version "2.3.1")
|
| 161 | (source (origin
|
| 162 | (method git-fetch)
|
| 163 | (uri (git-reference
|
| 164 | (url "https://github.com/acassen/keepalived")
|
| 165 | (commit (string-append "v" version))))
|
| 166 | (file-name (git-file-name name version))
|
| 167 | (sha256
|
| 168 | (base32
|
| 169 | "0mxpx5azx0m2zp757yqcavvvzg3p9nj93bczfhv6wich3wpvbwzx"))))
|
| 170 | (build-system gnu-build-system)
|
| 171 | (arguments
|
| 172 | (list
|
| 173 | #:phases
|
| 174 | #~(modify-phases %standard-phases
|
| 175 | (add-after 'build 'build-info
|
| 176 | (lambda _
|
| 177 | (invoke "make" "-C" "doc" "texinfo")
|
| 178 | |
| 179 | (install-file "doc/source/images/software_design.png"
|
| 180 | "doc/build/texinfo/keepalived-figures")
|
| 181 | (substitute* "doc/build/texinfo/keepalived.texi"
|
| 182 | (("@image\\{software_design,")
|
| 183 | "@image{keepalived-figures/software_design,"))
|
| 184 | (invoke "make" "-C" "doc/build/texinfo")))
|
| 185 | (add-after 'install 'install-info
|
| 186 | (lambda _
|
| 187 | (let ((infodir (string-append #$output "/share/info")))
|
| 188 | (install-file "doc/build/texinfo/keepalived.info" infodir)
|
| 189 | (install-file "doc/source/images/software_design.png"
|
| 190 | (string-append
|
| 191 | infodir "/keepalived-figures"))))))))
|
| 192 | (native-inputs
|
| 193 | (list autoconf automake pkg-config python-sphinx texinfo))
|
| 194 | (inputs
|
| 195 | (list openssl libnfnetlink libnl))
|
| 196 | (home-page "https://www.keepalived.org")
|
| 197 | (synopsis "Load balancing and high-availability frameworks")
|
| 198 | (description
|
| 199 | "Keepalived provides frameworks for both load balancing and high
|
| 200 | availability. The load balancing framework relies on the Linux Virtual
|
| 201 | Server (@dfn{IPVS}) kernel module. High availability is achieved by the Virtual
|
| 202 | Redundancy Routing Protocol (@dfn{VRRP}). Each Keepalived framework can be used
|
| 203 | independently or together to provide resilient infrastructures.")
|
| 204 | (license license:gpl2+)))
|
| 205 |
|
| 206 | (define-public libraft
|
| 207 | (package
|
| 208 | (name "libraft")
|
| 209 | (version "0.11.2")
|
| 210 | (home-page "https://github.com/canonical/raft")
|
| 211 | (source (origin
|
| 212 | (method git-fetch)
|
| 213 | (uri (git-reference (url home-page)
|
| 214 | (commit (string-append "v" version))))
|
| 215 | (file-name (git-file-name name version))
|
| 216 | (sha256
|
| 217 | (base32
|
| 218 | "050dwy34jh8dihfwfm0r1by2i3sy9crapipp9idw32idm79y4izb"))))
|
| 219 | (arguments '(#:configure-flags '("--enable-uv")
|
| 220 | #:phases
|
| 221 | (modify-phases %standard-phases
|
| 222 | (add-after 'unpack 'disable-failing-tests
|
| 223 | (lambda _
|
| 224 | (substitute* "Makefile.am"
|
| 225 | ((".*test_uv_append.c.*") "")
|
| 226 | ((".*test_uv_tcp_connect.c.*") ""))
|
| 227 | #t)))))
|
| 228 | (inputs
|
| 229 | (list libuv lz4))
|
| 230 | (native-inputs
|
| 231 | `(("autoconf" ,autoconf)
|
| 232 | ("automake" ,automake)
|
| 233 | ("gettext" ,gettext-minimal)
|
| 234 | ("libtool" ,libtool)
|
| 235 | ("pkg-config" ,pkg-config)))
|
| 236 | (build-system gnu-build-system)
|
| 237 | (synopsis "C implementation of the Raft consensus protocol")
|
| 238 | (description "The library has modular design: its core part implements only
|
| 239 | the core Raft algorithm logic, in a fully platform independent way. On top of
|
| 240 | that, a pluggable interface defines the I/O implementation for networking
|
| 241 | (send/receive RPC messages) and disk persistence (store log entries and
|
| 242 | snapshots).")
|
| 243 | (license license:asl2.0)))
|
| 244 |
|
| 245 | (define-public libdqlite
|
| 246 | (package
|
| 247 | (name "libdqlite")
|
| 248 | (version "1.9.0")
|
| 249 | (home-page "https://github.com/canonical/dqlite")
|
| 250 | (source (origin
|
| 251 | (method git-fetch)
|
| 252 | (uri (git-reference (url home-page)
|
| 253 | (commit (string-append "v" version))))
|
| 254 | (file-name (git-file-name name version))
|
| 255 | (sha256
|
| 256 | (base32
|
| 257 | "0zalsvr0vy7632nhm96a29lrfy18iqsmbxpyz2lvq80mrjlbrzsn"))))
|
| 258 | (arguments
|
| 259 | '(#:phases
|
| 260 | (modify-phases %standard-phases
|
| 261 | (add-after 'unpack 'disable-failing-tests
|
| 262 | (lambda _
|
| 263 | (substitute* "Makefile.am"
|
| 264 | |
| 265 | |
| 266 | |
| 267 | ((".*test_client.c.*") "")))))))
|
| 268 | (native-inputs
|
| 269 | (list autoconf automake libtool pkg-config))
|
| 270 | (inputs
|
| 271 | (list libraft libuv))
|
| 272 | (propagated-inputs
|
| 273 | (list sqlite)) |
| 274 | (build-system gnu-build-system)
|
| 275 | (synopsis "Distributed SQLite")
|
| 276 | (description "dqlite is a C library that implements an embeddable and replicated
|
| 277 | SQL database engine with high-availability and automatic failover.")
|
| 278 | (license license:lgpl3)))
|