3
0
Fork 0
forked from mirrors/nixpkgs

pacemaker: init at 2.1.2

This commit is contained in:
Ryan Mulligan 2021-02-24 09:36:49 -08:00 committed by Astro
parent 1e6453bb44
commit 2b78cfdb09
3 changed files with 106 additions and 0 deletions

View file

@ -0,0 +1,97 @@
{ lib
, stdenv
, autoconf
, automake
, bash
, bzip2
, corosync
, dbus
, fetchFromGitHub
, glib
, gnutls
, libqb
, libtool
, libuuid
, libxml2
, libxslt
, pam
, pkg-config
, python3
# Pacemaker is compiled twice, once with forOCF = true to extract its
# OCF definitions for use in the ocf-resource-agents derivation, then
# again with forOCF = false, where the ocf-resource-agents is provided
# as the OCF_ROOT.
, forOCF ? false
, ocf-resource-agents
} :
stdenv.mkDerivation rec {
pname = "pacemaker";
version = "2.1.2";
src = fetchFromGitHub {
owner = "ClusterLabs";
repo = pname;
rev = "Pacemaker-${version}";
sha256 = "1w7vq3lmgcz38pfww9vccm142vjsjqz3qc9nnk09ynkx4agqhxdg";
};
nativeBuildInputs = [
autoconf
automake
libtool
pkg-config
];
buildInputs = [
bash
bzip2
corosync
dbus.dev
glib
gnutls
libqb
libuuid
libxml2.dev
libxslt.dev
pam
python3
];
preConfigure = ''
./autogen.sh --prefix="$out"
'';
configureFlags = [
"--exec-prefix=${placeholder "out"}"
"--sysconfdir=/etc"
"--localstatedir=/var"
"--with-initdir=/etc/systemd/system"
"--with-systemdsystemunitdir=/etc/systemd/system"
"--with-corosync"
# allows Type=notify in the systemd service
"--enable-systemd"
] ++ lib.optional (!forOCF) "--with-ocfdir=${ocf-resource-agents}/usr/lib/ocf";
installFlags = [ "DESTDIR=${placeholder "out"}" ];
NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [
"-Wno-error=strict-prototypes"
];
enableParallelBuilding = true;
postInstall = ''
# pacemaker's install linking requires a weirdly nested hierarchy
mv $out$out/* $out
rm -r $out/nix
'';
meta = with lib; {
homepage = "https://clusterlabs.org/pacemaker/";
description = "Pacemaker is an open source, high availability resource manager suitable for both small and large clusters.";
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ ryantm ];
};
}

View file

@ -1,3 +1,5 @@
# This combines together OCF definitions from other derivations.
# https://github.com/ClusterLabs/resource-agents/blob/master/doc/dev-guides/ra-dev-guide.asc
{ stdenv { stdenv
, lib , lib
, runCommand , runCommand
@ -8,12 +10,16 @@
, python3 , python3
, glib , glib
, drbd , drbd
, pacemaker
}: }:
let let
drbdForOCF = drbd.override { drbdForOCF = drbd.override {
forOCF = true; forOCF = true;
}; };
pacemakerForOCF = pacemaker.override {
forOCF = true;
};
resource-agentsForOCF = stdenv.mkDerivation rec { resource-agentsForOCF = stdenv.mkDerivation rec {
pname = "resource-agents"; pname = "resource-agents";
@ -53,4 +59,5 @@ runCommand "ocf-resource-agents" {} ''
mkdir -p $out/usr/lib/ocf mkdir -p $out/usr/lib/ocf
${lndir}/bin/lndir -silent "${resource-agentsForOCF}/lib/ocf/" $out/usr/lib/ocf ${lndir}/bin/lndir -silent "${resource-agentsForOCF}/lib/ocf/" $out/usr/lib/ocf
${lndir}/bin/lndir -silent "${drbdForOCF}/usr/lib/ocf/" $out/usr/lib/ocf ${lndir}/bin/lndir -silent "${drbdForOCF}/usr/lib/ocf/" $out/usr/lib/ocf
${lndir}/bin/lndir -silent "${pacemakerForOCF}/usr/lib/ocf/" $out/usr/lib/ocf
'' ''

View file

@ -19503,6 +19503,8 @@ with pkgs;
osinfo-db = callPackage ../data/misc/osinfo-db { }; osinfo-db = callPackage ../data/misc/osinfo-db { };
osinfo-db-tools = callPackage ../tools/misc/osinfo-db-tools { }; osinfo-db-tools = callPackage ../tools/misc/osinfo-db-tools { };
pacemaker = callPackage ../misc/logging/pacemaker { };
p11-kit = callPackage ../development/libraries/p11-kit { }; p11-kit = callPackage ../development/libraries/p11-kit { };
paperkey = callPackage ../tools/security/paperkey { }; paperkey = callPackage ../tools/security/paperkey { };