about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/search/elasticsearch/5.x.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/servers/search/elasticsearch/5.x.nix')
-rw-r--r--nixpkgs/pkgs/servers/search/elasticsearch/5.x.nix43
1 files changed, 43 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/search/elasticsearch/5.x.nix b/nixpkgs/pkgs/servers/search/elasticsearch/5.x.nix
new file mode 100644
index 000000000000..07ebf97ab2bf
--- /dev/null
+++ b/nixpkgs/pkgs/servers/search/elasticsearch/5.x.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchurl, elk5Version, makeWrapper, jre_headless, utillinux }:
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  version = elk5Version;
+  name = "elasticsearch-${version}";
+
+  src = fetchurl {
+    url = "https://artifacts.elastic.co/downloads/elasticsearch/${name}.tar.gz";
+    sha256 = "0sm99m4m4mmigj6ll22kyaw7zkp1s2i0mhzx15fzidnybdnlifb4";
+  };
+
+  patches = [ ./es-home-5.x.patch ./es-classpath-5.x.patch ];
+
+  buildInputs = [ makeWrapper jre_headless utillinux ];
+
+  installPhase = ''
+    mkdir -p $out
+    cp -R bin config lib modules plugins $out
+
+    chmod -x $out/bin/*.*
+
+    wrapProgram $out/bin/elasticsearch \
+      --prefix ES_CLASSPATH : "$out/lib/*" \
+      --prefix PATH : "${utillinux}/bin" \
+      --set JAVA_HOME "${jre_headless}" \
+      --set ES_JVM_OPTIONS "$out/config/jvm.options"
+
+    wrapProgram $out/bin/elasticsearch-plugin \
+      --prefix ES_CLASSPATH : "$out/lib/*" \
+      --set JAVA_HOME "${jre_headless}"
+  '';
+
+  meta = {
+    description = "Open Source, Distributed, RESTful Search Engine";
+    license = licenses.asl20;
+    platforms = platforms.unix;
+    maintainers = [
+      maintainers.apeschar
+    ];
+  };
+}