nixpkgs-suyu/pkgs/servers/zookeeper/default.nix

55 lines
1.7 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, jre, makeWrapper, bash, coreutils, runtimeShell }:
2014-08-24 17:43:45 +02:00
stdenv.mkDerivation rec {
pname = "zookeeper";
version = "3.4.13";
2014-08-24 17:43:45 +02:00
2016-04-28 02:17:01 +02:00
src = fetchurl {
url = "mirror://apache/zookeeper/${pname}-${version}/${pname}-${version}.tar.gz";
sha256 = "0karf13zks3ba2rdmma2lyabvmasc04cjmgxp227f0nj8677kvbw";
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 ${pname}-${version}.jar $out
2016-04-28 02:17:01 +02:00
mkdir -p $out/bin
cp -R bin/{zkCli,zkCleanup,zkEnv,zkServer}.sh $out/bin
patchShebangs $out/bin
substituteInPlace $out/bin/zkServer.sh \
--replace /bin/echo ${coreutils}/bin/echo
2018-07-07 11:32:00 +02:00
for i in $out/bin/{zkCli,zkCleanup,zkServer}.sh; do
2016-04-28 02:17:01 +02:00
wrapProgram $i \
--set JAVA_HOME "${jre}" \
--prefix PATH : "${bash}/bin"
done
chmod -x $out/bin/zkEnv.sh
mkdir -p $out/share/zooinspector
cp -r contrib/ZooInspector/{${pname}-${version}-ZooInspector.jar,icons,lib,config} $out/share/zooinspector
classpath="$out/${pname}-${version}.jar:$out/share/zooinspector/${pname}-${version}-ZooInspector.jar"
for jar in $out/lib/*.jar $out/share/zooinspector/lib/*.jar; do
classpath="$classpath:$jar"
done
cat << EOF > $out/bin/zooInspector.sh
#!${runtimeShell}
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;
2016-04-28 02:17:01 +02:00
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
}