anchor.diff:  	    mkdir -p ${cfg.baseDir}
   
   	    # Create a symlink to the bin directory of the tomcat component
  -	    ln -sfn ${pkgs.tomcat6}/bin ${cfg.baseDir}/bin
  +	    ln -sfn ${tomcat}/bin ${cfg.baseDir}/bin
   
   	    # Create a conf/ directory
   	    mkdir -p ${cfg.baseDir}/conf
   	    chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/conf
   
   	    # Symlink the config files in the conf/ directory (except for catalina.properties and server.xml)
  -	    for i in $(ls ${pkgs.tomcat6}/conf | grep -v catalina.properties | grep -v server.xml)
  +	    for i in $(ls ${tomcat}/conf | grep -v catalina.properties | grep -v server.xml)
   	    do
  -	        ln -sfn ${pkgs.tomcat6}/conf/$i ${cfg.baseDir}/conf/`basename $i`
  +	        ln -sfn ${tomcat}/conf/$i ${cfg.baseDir}/conf/`basename $i`
   	    done
   
               # Create subdirectory for virtual hosts
  
positive.code: 		''
  	    else ""}
  
              ${pkgs.su}/bin/su -s ${pkgs.bash}/bin/sh ${cfg.user} -c 'CATALINA_BASE=${cfg.baseDir} JAVA_HOME=${pkgs.jdk} JAVA_OPTS="${cfg.javaOpts}" CATALINA_OPTS="${cfg.catalinaOpts}" ${pkgs.tomcat6}/bin/startup.sh'
            '';
  
          postStop =
            ''
              echo "Stopping tomcat..."
              CATALINA_BASE=${cfg.baseDir} JAVA_HOME=${pkgs.jdk} ${pkgs.su}/bin/su -s ${pkgs.bash}/bin/sh ${cfg.user} -c ${pkgs.tomcat6}/bin/shutdown.sh
            '';
  
        };
  
negative.code: let
  
    cfg = config.services.tomcat;
    tomcat = pkgs.tomcat6;
  in
  
  {
  