From afdfff7ed8957c6b3601e70184cf633ff82bce1d Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Wed, 6 Aug 2008 13:41:08 +0000 Subject: [PATCH] Added common lib support for tomcat svn path=/nixos/trunk/; revision=12511 --- system/options.nix | 5 +++++ upstart-jobs/tomcat.nix | 19 ++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/system/options.nix b/system/options.nix index b2b907733c9..551d4f5d3a2 100644 --- a/system/options.nix +++ b/system/options.nix @@ -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 = { diff --git a/upstart-jobs/tomcat.nix b/upstart-jobs/tomcat.nix index 6ebdf0069ff..6ad47607c21 100644 --- a/upstart-jobs/tomcat.nix +++ b/upstart-jobs/tomcat.nix @@ -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}" = ""