Make Storm conf and log path configurable via symlinks.

- The bin/storm script makes too many assumptions about file locations and java classpath that I couldn't figure out a better way.

Fix jzmq build on NixOS: java source was treated as ASCII.
This commit is contained in:
Danny Wilson 2013-02-08 15:19:33 +01:00 committed by Danny Wilson
parent 04a232f28b
commit d6a812332c
3 changed files with 14 additions and 9 deletions

@ -11,9 +11,12 @@ stdenv.mkDerivation rec {
buildInputs = [ automake autoconf libtool pkgconfig zeromq2 jdk ];
preConfigurePhases = ["./autogen.sh"];
preConfigure = if stdenv.system == "x86_64-darwin" then ''
sed -i -e 's~/Headers~/include~' -e 's~_JNI_INC_SUBDIRS=\".*\"~_JNI_INC_SUBDIRS=\"darwin\"~' configure
'' else "";
preConfigure = ''
sed -i -e 's|(JAVAC)|(JAVAC) -encoding utf8|' src/Makefile.in
${if stdenv.system == "x86_64-darwin" then
'' sed -i -e 's~/Headers~/include~' -e 's~_JNI_INC_SUBDIRS=\".*\"~_JNI_INC_SUBDIRS=\"darwin\"~' configure
'' else ""}
'';
maintainers = [ stdenv.lib.maintainers.blue ];

@ -1,4 +1,4 @@
{ stdenv, fetchurl, unzip, jzmq, jdk, lib, python}:
{ stdenv, fetchurl, unzip, jzmq, jdk, lib, python, logsDir, confDir }:
stdenv.mkDerivation {
name = "storm-0.8.2";
@ -12,16 +12,18 @@ stdenv.mkDerivation {
installPhase = ''
# Remove junk
rm -f lib/jzmq*
mkdir -p /var/log/storm
mkdir -p $out/bin
mv bin/storm $out/bin/
rm -R bin
rm -R bin conf logs
# Fix shebang header for python scripts
sed -i -e "s|#!/usr/bin/.*python|#!${python}/bin/python|" bin/storm;
sed -i -e "s|#!/usr/bin/.*python|#!${python}/bin/python|" $out/bin/storm;
mkdir -p $out
cp -av * $out
ln -s /var/log/storm $out/logs
cd $out;
${if logsDir != "" then ''ln -s ${logsDir} logs'' else ""}
${if confDir != "" then ''ln -s ${confDir} conf'' else ""}
'';
dontStrip = true;

@ -6170,7 +6170,7 @@ let
thttpd = callPackage ../servers/http/thttpd { };
storm = callPackage ../servers/computing/storm { };
storm = callPackage ../servers/computing/storm { confDir = "/etc/storm"; logsDir = "/var/log"; };
tomcat5 = callPackage ../servers/http/tomcat/5.0.nix { };