nixpkgs/pkgs/servers/search/elasticsearch/default.nix

35 lines
1 KiB
Nix
Raw Normal View History

2013-08-27 17:58:46 +02:00
{ stdenv, fetchurl, makeWrapper, jre, utillinux }:
2013-03-07 12:36:29 +01:00
stdenv.mkDerivation rec {
name = "elasticsearch-1.0.1";
2013-03-07 12:36:29 +01:00
src = fetchurl {
url = "https://download.elasticsearch.org/elasticsearch/elasticsearch/${name}.tar.gz";
sha256 = "0nwv7llw7gk94alfcpxxy0lybhnw7fggv30v7ylsxn20id9g7kba";
2013-03-07 12:36:29 +01:00
};
patches = [ ./es-home.patch ];
2013-08-27 17:58:46 +02:00
buildInputs = [ makeWrapper jre utillinux ];
2013-03-07 12:36:29 +01:00
installPhase = ''
mkdir -p $out
cp -R bin config lib $out
2013-08-27 17:58:46 +02:00
# don't want to have binary with name plugin
mv $out/bin/plugin $out/bin/elasticsearch-plugin
# set ES_CLASSPATH and JAVA_HOME
wrapProgram $out/bin/elasticsearch \
--prefix ES_CLASSPATH : "$out/lib/${name}.jar":"$out/lib/*":"$out/lib/sigar/*" \
--prefix PATH : "${utillinux}/bin/" \
--set JAVA_HOME "${jre}"
wrapProgram $out/bin/elasticsearch-plugin \
--prefix ES_CLASSPATH : "$out/lib/${name}.jar":"$out/lib/*":"$out/lib/sigar/*" --set JAVA_HOME "${jre}"
2013-03-07 12:36:29 +01:00
'';
meta = {
description = "Open Source, Distributed, RESTful Search Engine";
license = "ASL2.0";
};
}