2017-07-11 15:56:58 +01:00
|
|
|
{ stdenv, fetchurl, jre, makeWrapper, bash, coreutils }:
|
2014-08-24 16:43:45 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2017-02-27 11:37:42 +00:00
|
|
|
name = "zookeeper-${version}";
|
2018-04-30 14:24:26 +01:00
|
|
|
version = "3.4.12";
|
2014-08-24 16:43:45 +01:00
|
|
|
|
2016-04-28 01:17:01 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://apache/zookeeper/${name}/${name}.tar.gz";
|
2018-04-30 14:24:26 +01:00
|
|
|
sha256 = "1fcljn2741jw1jvjrk5a0xr8rk69wjwrq522wrc5nmjhj0qzk1n6";
|
2016-04-28 01:17:01 +01:00
|
|
|
};
|
2014-08-24 16:43:45 +01:00
|
|
|
|
2016-04-28 01:17:01 +01:00
|
|
|
buildInputs = [ makeWrapper 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 = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -R conf docs lib ${name}.jar $out
|
|
|
|
mkdir -p $out/bin
|
2017-07-11 15:56:58 +01:00
|
|
|
cp -R bin/{zkCli,zkCleanup,zkEnv,zkServer}.sh $out/bin
|
2016-04-28 01:17:01 +01:00
|
|
|
for i in $out/bin/{zkCli,zkCleanup}.sh; do
|
|
|
|
wrapProgram $i \
|
|
|
|
--set JAVA_HOME "${jre}" \
|
|
|
|
--prefix PATH : "${bash}/bin"
|
|
|
|
done
|
2017-07-11 15:56:58 +01:00
|
|
|
substituteInPlace $out/bin/zkServer.sh \
|
|
|
|
--replace /bin/echo ${coreutils}/bin/echo \
|
|
|
|
--replace "/usr/bin/env bash" ${bash}/bin/bash
|
2016-04-28 01:17:01 +01:00
|
|
|
chmod -x $out/bin/zkEnv.sh
|
2016-04-28 01:19:12 +01:00
|
|
|
|
|
|
|
mkdir -p $out/share/zooinspector
|
|
|
|
cp -r contrib/ZooInspector/{${name}-ZooInspector.jar,icons,lib,config} $out/share/zooinspector
|
|
|
|
|
|
|
|
classpath="$out/${name}.jar:$out/share/zooinspector/${name}-ZooInspector.jar"
|
|
|
|
for jar in $out/lib/*.jar $out/share/zooinspector/lib/*.jar; do
|
|
|
|
classpath="$classpath:$jar"
|
|
|
|
done
|
|
|
|
|
|
|
|
cat << EOF > $out/bin/zooInspector.sh
|
|
|
|
#!${stdenv.shell}
|
|
|
|
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 01:17:01 +01:00
|
|
|
'';
|
2014-08-24 16:43:45 +01:00
|
|
|
|
2016-04-28 01:17:01 +01:00
|
|
|
meta = with stdenv.lib; {
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = http://zookeeper.apache.org;
|
2016-04-28 01:17:01 +01: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 01:17:01 +01:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2014-08-24 16:43:45 +01:00
|
|
|
}
|