aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/servers/zookeeper
diff options
context:
space:
mode:
authorMx Kookie <kookie@spacekookie.de>2020-12-21 06:05:12 +0100
committerMx Kookie <kookie@spacekookie.de>2020-12-21 06:05:12 +0100
commitf107be784e6d5da5f90735765a68fdff96acfbb4 (patch)
tree145573a598009fb6adbd5ef7fbce0a850681f5f0 /infra/libkookie/nixpkgs/pkgs/servers/zookeeper
parent2e04b35e5ac3a9123cafffbc84494fa4d389cca0 (diff)
parente9158eca70ae59e73fae23be5d13d3fa0cfc78b4 (diff)
Add 'infra/libkookie/nixpkgs/' from commit 'e9158eca70ae59e73fae23be5d13d3fa0cfc78b4'
git-subtree-dir: infra/libkookie/nixpkgs git-subtree-mainline: 2e04b35e5ac3a9123cafffbc84494fa4d389cca0 git-subtree-split: e9158eca70ae59e73fae23be5d13d3fa0cfc78b4
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/servers/zookeeper')
-rw-r--r--infra/libkookie/nixpkgs/pkgs/servers/zookeeper/default.nix54
1 files changed, 54 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/servers/zookeeper/default.nix b/infra/libkookie/nixpkgs/pkgs/servers/zookeeper/default.nix
new file mode 100644
index 000000000000..b0685d7f9546
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/servers/zookeeper/default.nix
@@ -0,0 +1,54 @@
+{ stdenv, fetchurl, jre, makeWrapper, bash, coreutils, runtimeShell }:
+
+stdenv.mkDerivation rec {
+ pname = "zookeeper";
+ version = "3.4.13";
+
+ src = fetchurl {
+ url = "mirror://apache/zookeeper/${pname}-${version}/${pname}-${version}.tar.gz";
+ sha256 = "0karf13zks3ba2rdmma2lyabvmasc04cjmgxp227f0nj8677kvbw";
+ };
+
+ buildInputs = [ makeWrapper jre ];
+
+ phases = ["unpackPhase" "installPhase"];
+
+ installPhase = ''
+ mkdir -p $out
+ cp -R conf docs lib ${pname}-${version}.jar $out
+ 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
+ for i in $out/bin/{zkCli,zkCleanup,zkServer}.sh; do
+ 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
+ '';
+
+ meta = with stdenv.lib; {
+ homepage = "http://zookeeper.apache.org";
+ description = "Apache Zookeeper";
+ license = licenses.asl20;
+ maintainers = with maintainers; [ nathan-gs cstrahan pradeepchhetri ];
+ platforms = platforms.unix;
+ };
+}