Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 apache-tomcat (7.0.53-2) UNRELEASED; urgency=medium
 .
   * New release
Author: Jose M Calhariz <jose.calhariz@ist.utl.pt>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

Index: apache-tomcat/Makefile
===================================================================
--- apache-tomcat.orig/Makefile	2014-05-27 19:42:16.515187167 +0100
+++ apache-tomcat/Makefile	2014-05-27 19:42:24.751149644 +0100
@@ -69,8 +69,9 @@ unpack-up-stamp:
 	#Prepare files for patching
 	#echo "#!/bin/sh" > setenv.sh
 	echo "JAVA_HOME=/usr/lib/jvm/java-8-oracle/" > setenv.sh
+	echo "CATALINA_TMPDIR=/tmp/$(PACKNAME)" >> setenv.sh
 	echo "CATALINA_OPTS=-Djava.library.path=/usr/java/packages/lib/i386:/lib:/usr/lib:/usr/lib/$(DEB_HOST_MULTIARCH)" >> setenv.sh
-	echo "CATALINA_PID=/var/run/$(PACKNAME).pid" >> setenv.sh
+	echo "CATALINA_PID=/var/run/$(PACKNAME)/$(PACKNAME).pid" >> setenv.sh
 	touch unpack-up-stamp
 
 
@@ -97,10 +98,17 @@ install-up-stamp:
 	# Using shell
 	mkdir -p $(DESTDIR)$(PREFIX)/$(PACKNAME)
 	mv $(TARDIR)/* $(DESTDIR)$(PREFIX)/$(PACKNAME)/
+	chown -R tomcat7:tomcat7 $(DESTDIR)$(PREFIX)/$(PACKNAME)/
+	chmod a+r $(DESTDIR)$(PREFIX)/$(PACKNAME)/conf/*
+	rm unpack-up-stamp
 	mkdir -p $(DESTDIR)$(ETCDIR)
 	mv setenv.sh $(DESTDIR)$(ETCDIR)/
 	ln -s $(ETCDIR)/setenv.sh $(DESTDIR)$(PREFIX)/$(PACKNAME)/bin/
-	rm unpack-up-stamp
+	mkdir -p $(DESTDIR)/var/log/$(PACKNAME)
+	rm -r $(DESTDIR)$(PREFIX)/$(PACKNAME)/logs
+	ln -s /var/log/$(PACKNAME) $(DESTDIR)$(PREFIX)/$(PACKNAME)/logs
+	rm -r $(DESTDIR)$(PREFIX)/$(PACKNAME)/temp
+	ln -s /tmp/$(PACKNAME) $(DESTDIR)$(PREFIX)/$(PACKNAME)/temp
 	touch install-up-stamp
 
 
