2014-08-16 11:53:12 +01:00
|
|
|
{ stdenv, fetchurl, makeWrapper, jre, utillinux, getopt }:
|
2014-07-05 09:58:08 +01:00
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
2013-03-07 11:36:29 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2014-07-15 16:57:16 +01:00
|
|
|
name = "elasticsearch-1.2.2";
|
2013-03-07 11:36:29 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://download.elasticsearch.org/elasticsearch/elasticsearch/${name}.tar.gz";
|
2014-07-15 16:57:16 +01:00
|
|
|
sha256 = "1vpvxndcq48rcsgw2jnzdh4fwnf141hf5wjxrjs1g7p2qw0d0cy8";
|
2013-03-07 11:36:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [ ./es-home.patch ];
|
|
|
|
|
2014-08-16 11:53:12 +01:00
|
|
|
buildInputs = [ makeWrapper jre ] ++
|
|
|
|
(if (!stdenv.isDarwin) then [utillinux] else [getopt]);
|
2013-08-27 16:58:46 +01:00
|
|
|
|
2013-03-07 11:36:29 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -R bin config lib $out
|
2013-08-27 16:58:46 +01: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/*" \
|
2014-08-16 11:53:12 +01:00
|
|
|
${if (!stdenv.isDarwin)
|
|
|
|
then ''--prefix PATH : "${utillinux}/bin/"''
|
|
|
|
else ''--prefix PATH : "${getopt}/bin"''} \
|
2013-08-27 16:58:46 +01:00
|
|
|
--set JAVA_HOME "${jre}"
|
|
|
|
wrapProgram $out/bin/elasticsearch-plugin \
|
2014-08-16 11:53:12 +01:00
|
|
|
--prefix ES_CLASSPATH : "$out/lib/${name}.jar":"$out/lib/*":"$out/lib/sigar/*" \
|
|
|
|
--set JAVA_HOME "${jre}"
|
2013-03-07 11:36:29 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Open Source, Distributed, RESTful Search Engine";
|
2014-06-19 05:19:00 +01:00
|
|
|
license = stdenv.lib.licenses.asl20;
|
2014-07-05 11:09:53 +01:00
|
|
|
platforms = platforms.unix;
|
2013-03-07 11:36:29 +00:00
|
|
|
};
|
|
|
|
}
|