Added common lib support for tomcat

svn path=/nixos/trunk/; revision=12511
This commit is contained in:
Sander van der Burg 2008-08-06 13:41:08 +00:00
parent 64fc690afa
commit afdfff7ed8
2 changed files with 23 additions and 1 deletions

View File

@ -1469,6 +1469,11 @@
default = "";
description ="Location where shared libraries are stored. Leave empty to use the baseDir.";
};
commonLibFrom = mkOption {
default = "";
description ="Location where common libraries are stored. Leave empty to use the baseDir.";
};
};
disnix = {

View File

@ -34,6 +34,7 @@ in
then
mkdir -p ${cfg.baseDir}/webapps
mkdir -p ${cfg.baseDir}/shared
mkdir -p ${cfg.baseDir}/lib
cp -av ${pkgs.tomcat6}/{conf,temp,logs} ${cfg.baseDir}
fi
@ -48,7 +49,7 @@ in
cp -rL $i ${cfg.baseDir}/webapps
done
fi
# Fix permissions
chown -R ${cfg.user} ${cfg.baseDir}
@ -63,6 +64,22 @@ in
chmod -v 644 $i
done
# Deploy all common libraries
rm -rf ${cfg.baseDir}/lib/*
if test "${cfg.commonLibFrom}" = ""
then
commonLibFrom="${pkgs.tomcat6}/lib";
else
commonLibFrom="${cfg.commonLibFrom}";
fi
for i in $commonLibFrom/*.jar
do
ln -s $i ${cfg.baseDir}/lib
done
# Deploy all shared libraries
if ! test "${cfg.sharedLibFrom}" = ""