summary refs log tree commit diff
path: root/pkgs/servers/zookeeper/default.nix
blob: 307993a958ad5cb2fb864ab152daa402f84e875f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ stdenv, fetchurl, jre, makeWrapper, bash }:

stdenv.mkDerivation rec {
	name = "zookeeper-3.4.6";

	src = fetchurl {
		url = "mirror://apache/zookeeper/${name}/${name}.tar.gz";
		sha256 = "01b3938547cd620dc4c93efe07c0360411f4a66962a70500b163b59014046994";
	};

	buildInputs = [ makeWrapper jre ];

	phases = ["unpackPhase" "installPhase"];

	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
	'';

	meta = with stdenv.lib; {
		homepage = "http://zookeeper.apache.org";
		description = "Apache Zookeeper";
		license = licenses.asl20;
		maintainers = [ maintainers.nathan-gs ];	
		platforms = platforms.unix;	
	};		

}