2019-02-26 11:45:54 +00:00
|
|
|
{ stdenv, fetchurl, jre, makeWrapper, bash, coreutils, runtimeShell }:
|
2014-08-24 15:43:45 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "zookeeper";
|
2018-08-08 03:39:57 +00:00
|
|
|
version = "3.4.13";
|
2014-08-24 15:43:45 +00:00
|
|
|
|
2016-04-28 00:17:01 +00:00
|
|
|
src = fetchurl {
|
2019-08-15 12:41:18 +00:00
|
|
|
url = "mirror://apache/zookeeper/${pname}-${version}/${pname}-${version}.tar.gz";
|
2018-08-08 03:39:57 +00:00
|
|
|
sha256 = "0karf13zks3ba2rdmma2lyabvmasc04cjmgxp227f0nj8677kvbw";
|
2016-04-28 00:17:01 +00:00
|
|
|
};
|
2014-08-24 15:43:45 +00:00
|
|
|
|
2016-04-28 00:17:01 +00:00
|
|
|
buildInputs = [ makeWrapper jre ];
|
2014-08-24 15:43:45 +00:00
|
|
|
|
2016-04-28 00:17:01 +00:00
|
|
|
phases = ["unpackPhase" "installPhase"];
|
2014-08-24 15:43:45 +00:00
|
|
|
|
2016-04-28 00:17:01 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
2019-08-15 12:41:18 +00:00
|
|
|
cp -R conf docs lib ${pname}-${version}.jar $out
|
2016-04-28 00:17:01 +00:00
|
|
|
mkdir -p $out/bin
|
2017-07-11 14:56:58 +00:00
|
|
|
cp -R bin/{zkCli,zkCleanup,zkEnv,zkServer}.sh $out/bin
|
2018-07-07 09:33:04 +00:00
|
|
|
patchShebangs $out/bin
|
2018-07-07 09:32:00 +00:00
|
|
|
for i in $out/bin/{zkCli,zkCleanup,zkServer}.sh; do
|
2016-04-28 00:17:01 +00:00
|
|
|
wrapProgram $i \
|
|
|
|
--set JAVA_HOME "${jre}" \
|
|
|
|
--prefix PATH : "${bash}/bin"
|
|
|
|
done
|
2017-07-11 14:56:58 +00:00
|
|
|
substituteInPlace $out/bin/zkServer.sh \
|
|
|
|
--replace /bin/echo ${coreutils}/bin/echo \
|
|
|
|
--replace "/usr/bin/env bash" ${bash}/bin/bash
|
2016-04-28 00:17:01 +00:00
|
|
|
chmod -x $out/bin/zkEnv.sh
|
2016-04-28 00:19:12 +00:00
|
|
|
|
|
|
|
mkdir -p $out/share/zooinspector
|
2019-08-15 12:41:18 +00:00
|
|
|
cp -r contrib/ZooInspector/{${pname}-${version}-ZooInspector.jar,icons,lib,config} $out/share/zooinspector
|
2016-04-28 00:19:12 +00:00
|
|
|
|
2019-08-15 12:41:18 +00:00
|
|
|
classpath="$out/${pname}-${version}.jar:$out/share/zooinspector/${pname}-${version}-ZooInspector.jar"
|
2016-04-28 00:19:12 +00:00
|
|
|
for jar in $out/lib/*.jar $out/share/zooinspector/lib/*.jar; do
|
|
|
|
classpath="$classpath:$jar"
|
|
|
|
done
|
|
|
|
|
|
|
|
cat << EOF > $out/bin/zooInspector.sh
|
2019-02-26 11:45:54 +00:00
|
|
|
#!${runtimeShell}
|
2016-04-28 00:19:12 +00:00
|
|
|
cd $out/share/zooinspector
|
|
|
|
exec ${jre}/bin/java -cp $classpath org.apache.zookeeper.inspector.ZooInspector
|
|
|
|
EOF
|
|
|
|
chmod +x $out/bin/zooInspector.sh
|
2016-04-28 00:17:01 +00:00
|
|
|
'';
|
2014-08-24 15:43:45 +00:00
|
|
|
|
2016-04-28 00:17:01 +00:00
|
|
|
meta = with stdenv.lib; {
|
2017-08-01 20:03:30 +00:00
|
|
|
homepage = http://zookeeper.apache.org;
|
2016-04-28 00:17:01 +00:00
|
|
|
description = "Apache Zookeeper";
|
|
|
|
license = licenses.asl20;
|
2017-01-27 14:41:38 +00:00
|
|
|
maintainers = with maintainers; [ nathan-gs cstrahan pradeepchhetri ];
|
2016-04-28 00:17:01 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2014-08-24 15:43:45 +00:00
|
|
|
}
|