nixpkgs/pkgs/servers/zookeeper/default.nix

46 lines
1.5 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, jre, makeWrapper, bash, coreutils }:
2014-08-24 16:43:45 +01:00
stdenv.mkDerivation rec {
pname = "zookeeper";
version = "3.6.3";
2014-08-24 16:43:45 +01:00
2016-04-28 01:17:01 +01:00
src = fetchurl {
url = "mirror://apache/zookeeper/${pname}-${version}/apache-${pname}-${version}-bin.tar.gz";
sha512 = "3f7b1b7d9cf5647d52ad0076c922e108fa956e986b5624667c493cf6d8ff09d3ca88f623c79a799fe49c72e868cb3c9d0f77cb69608de74a183b2cbad10bc827";
2016-04-28 01:17:01 +01:00
};
2014-08-24 16:43:45 +01:00
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ jre ];
2014-08-24 16:43:45 +01:00
2016-04-28 01:17:01 +01:00
phases = ["unpackPhase" "installPhase"];
2014-08-24 16:43:45 +01:00
2016-04-28 01:17:01 +01:00
installPhase = ''
runHook preInstall
2016-04-28 01:17:01 +01:00
mkdir -p $out
cp -R conf docs lib $out
# Without this, zkCli.sh tries creating a log file in the Nix store.
substituteInPlace $out/conf/log4j.properties \
--replace 'INFO, RFAAUDIT' 'INFO, CONSOLE'
2016-04-28 01:17:01 +01:00
mkdir -p $out/bin
cp -R bin/{zkCli,zkCleanup,zkEnv,zkServer,zkSnapShotToolkit,zkTxnLogToolkit}.sh $out/bin
patchShebangs $out/bin
substituteInPlace $out/bin/zkServer.sh \
--replace /bin/echo ${coreutils}/bin/echo
for i in $out/bin/{zkCli,zkCleanup,zkServer,zkSnapShotToolkit,zkTxnLogToolkit}.sh; do
2016-04-28 01:17:01 +01:00
wrapProgram $i \
--set JAVA_HOME "${jre}" \
--prefix PATH : "${bash}/bin"
done
chmod -x $out/bin/zkEnv.sh
runHook postInstall
2016-04-28 01:17:01 +01:00
'';
2014-08-24 16:43:45 +01:00
meta = with lib; {
homepage = "https://zookeeper.apache.org";
2016-04-28 01:17:01 +01:00
description = "Apache Zookeeper";
license = licenses.asl20;
maintainers = with maintainers; [ nathan-gs cstrahan pradeepchhetri ztzg ];
2016-04-28 01:17:01 +01:00
platforms = platforms.unix;
};
2014-08-24 16:43:45 +01:00
}