--- /dev/null
+diff -Naur apache-tomcat-6.0.44-src.orig/java/org/apache/catalina/startup/Bootstrap.java apache-tomcat-6.0.44-src/java/org/apache/catalina/startup/Bootstrap.java
+--- apache-tomcat-6.0.44-src.orig/java/org/apache/catalina/startup/Bootstrap.java 2015-05-08 13:22:05.000000000 +0100
++++ apache-tomcat-6.0.44-src/java/org/apache/catalina/startup/Bootstrap.java 2015-08-25 21:34:29.774917427 +0100
+@@ -109,40 +109,18 @@
+ String value = CatalinaProperties.getProperty(name + ".loader");
+ if ((value == null) || (value.equals("")))
+ return parent;
++
++ value = replace(value);
+
+ ArrayList repositoryLocations = new ArrayList();
+ ArrayList repositoryTypes = new ArrayList();
+- int i;
+
+ StringTokenizer tokenizer = new StringTokenizer(value, ",");
+ while (tokenizer.hasMoreElements()) {
+- String repository = tokenizer.nextToken();
+-
+- // Local repository
+- boolean replace = false;
+- String before = repository;
+- while ((i=repository.indexOf(CATALINA_HOME_TOKEN))>=0) {
+- replace=true;
+- if (i>0) {
+- repository = repository.substring(0,i) + getCatalinaHome()
+- + repository.substring(i+CATALINA_HOME_TOKEN.length());
+- } else {
+- repository = getCatalinaHome()
+- + repository.substring(CATALINA_HOME_TOKEN.length());
+- }
+- }
+- while ((i=repository.indexOf(CATALINA_BASE_TOKEN))>=0) {
+- replace=true;
+- if (i>0) {
+- repository = repository.substring(0,i) + getCatalinaBase()
+- + repository.substring(i+CATALINA_BASE_TOKEN.length());
+- } else {
+- repository = getCatalinaBase()
+- + repository.substring(CATALINA_BASE_TOKEN.length());
+- }
++ String repository = tokenizer.nextToken().trim();
++ if (repository.length() == 0) {
++ continue;
+ }
+- if (replace && log.isDebugEnabled())
+- log.debug("Expanded " + before + " to " + repository);
+
+ // Check for a JAR URL repository
+ try {
+@@ -154,6 +132,7 @@
+ // Ignore
+ }
+
++ // Local repository
+ if (repository.endsWith("*.jar")) {
+ repository = repository.substring
+ (0, repository.length() - "*.jar".length());
+@@ -192,6 +171,51 @@
+
+ }
+
++ /**
++ * System property replacement in the given string.
++ *
++ * @param str The original string
++ * @return the modified string
++ */
++ protected String replace(String str) {
++ // Implementation is copied from ClassLoaderLogManager.replace(),
++ // but added special processing for catalina.home and catalina.base.
++ String result = str;
++ int pos_start = str.indexOf("${");
++ if (pos_start >= 0) {
++ StringBuilder builder = new StringBuilder();
++ int pos_end = -1;
++ while (pos_start >= 0) {
++ builder.append(str, pos_end + 1, pos_start);
++ pos_end = str.indexOf('}', pos_start + 2);
++ if (pos_end < 0) {
++ pos_end = pos_start - 1;
++ break;
++ }
++ String propName = str.substring(pos_start + 2, pos_end);
++ String replacement;
++ if (propName.length() == 0) {
++ replacement = null;
++ } else if (CATALINA_HOME_TOKEN.equals(propName)) {
++ replacement = getCatalinaHome();
++ } else if (CATALINA_BASE_TOKEN.equals(propName)) {
++ replacement = getCatalinaBase();
++ } else {
++ replacement = System.getProperty(propName);
++ }
++ if (replacement != null) {
++ builder.append(replacement);
++ } else {
++ builder.append(str, pos_start, pos_end + 1);
++ }
++ pos_start = str.indexOf("${", pos_end + 1);
++ }
++ builder.append(str, pos_end + 1, str.length());
++ result = builder.toString();
++ }
++ return result;
++ }
++
+
+ /**
+ * Initialize daemon.
diff -Naur apache-tomcat-6.0.44-src.orig/build.xml apache-tomcat-6.0.44-src/build.xml
--- apache-tomcat-6.0.44-src.orig/build.xml 2015-05-08 13:22:05.000000000 +0100
-+++ apache-tomcat-6.0.44-src/build.xml 2015-08-16 14:10:03.609366396 +0100
++++ apache-tomcat-6.0.44-src/build.xml 2015-08-25 23:38:46.147332131 +0100
@@ -159,12 +159,14 @@
</fileset>
</copy>
</target>
-@@ -307,14 +309,18 @@
+@@ -307,19 +309,25 @@
manifest="${tomcat.manifests}/annotations-api.jar.manifest" />
<!-- Servlet 2.5 Implementation JAR File -->
<!-- JSP 2.1 EL Implementation JAR File -->
-@@ -492,12 +498,14 @@
++<!--
+ <jarIt jarfile="${el-api.jar}" filesId="files.el-api"
+ manifest="${tomcat.manifests}/el-api.jar.manifest" />
++-->
+
+ <!-- Bootstrap JAR File -->
+ <jarIt jarfile="${bootstrap.jar}" filesId="files.bootstrap"
+@@ -492,12 +500,14 @@
<target name="deploy" depends="build-only,build-docs,warn.dbcp">
<!-- Copy scripts -->
<copy todir="${tomcat.build}/bin">
-@@ -649,9 +657,11 @@
+@@ -649,9 +659,11 @@
</fileset>
</txt2html>
COMMON_DEP="dev-java/eclipse-ecj:${ECJ_SLOT}
dev-java/oracle-javamail:0
- dev-java/tomcat-servlet-api:${SAPI_SLOT}"
+ >=dev-java/tomcat-servlet-api-6.0.44-r1:${SAPI_SLOT}"
RDEPEND="${COMMON_DEP}
>=virtual/jre-1.6
!<dev-java/tomcat-native-1.1.20"
find -name '*.jar' -type f -delete -print || die
# Remove bundled javamail, servlet-api
- rm -rv java/javax/{mail,servlet} || die
+ rm -rv java/javax/{el,mail,servlet} || die
- epatch "${FILESDIR}/${P}-build.xml.patch"
+ epatch \
+ "${FILESDIR}/${P}-build.xml.patch" \
+ "${FILESDIR}/tomcat-6-sysprop.patch"
# For use of catalina.sh in netbeans
sed -i -e "/^# ----- Execute The Requested Command/ a\