2014-08-24 17:43:45 +02:00
|
|
|
{ stdenv, fetchurl, jre, makeWrapper, bash }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2017-02-27 12:37:42 +01:00
|
|
|
name = "zookeeper-${version}";
|
|
|
|
version = "3.4.9";
|
2014-08-24 17:43:45 +02:00
|
|
|
|
2016-04-28 02:17:01 +02:00
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://apache/zookeeper/${name}/${name}.tar.gz";
|
2017-01-27 15:41:38 +01:00
|
|
|
sha256 = "0dgmja1lm7qn92x2xfmz5qj2k6sj2f6yzyj3a55r7iv1590l1wz7";
|
2016-04-28 02:17:01 +02:00
|
|
|
};
|
2014-08-24 17:43:45 +02:00
|
|
|
|
2016-04-28 02:17:01 +02:00
|
|
|
buildInputs = [ makeWrapper jre ];
|
2014-08-24 17:43:45 +02:00
|
|
|
|
2016-04-28 02:17:01 +02:00
|
|
|
phases = ["unpackPhase" "installPhase"];
|
2014-08-24 17:43:45 +02:00
|
|
|
|
2016-04-28 02:17:01 +02:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -R conf docs lib ${name}.jar $out
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp -R bin/{zkCli,zkCleanup,zkEnv}.sh $out/bin
|
|
|
|
for i in $out/bin/{zkCli,zkCleanup}.sh; do
|
|
|
|
wrapProgram $i \
|
|
|
|
--set JAVA_HOME "${jre}" \
|
|
|
|
--prefix PATH : "${bash}/bin"
|
|
|
|
done
|
|
|
|
chmod -x $out/bin/zkEnv.sh
|
2016-04-28 02:19:12 +02: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 02:17:01 +02:00
|
|
|
'';
|
2014-08-24 17:43:45 +02:00
|
|
|
|
2016-04-28 02:17:01 +02:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = "http://zookeeper.apache.org";
|
|
|
|
description = "Apache Zookeeper";
|
|
|
|
license = licenses.asl20;
|
2017-01-27 15:41:38 +01:00
|
|
|
maintainers = with maintainers; [ nathan-gs cstrahan pradeepchhetri ];
|
2016-04-28 02:17:01 +02:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2014-08-24 17:43:45 +02:00
|
|
|
}
|