public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "James Le Cuirot" <chewi@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: www-servers/tomcat/files/, www-servers/tomcat/
Date: Tue, 25 Aug 2015 23:22:22 +0000 (UTC)	[thread overview]
Message-ID: <1440544932.586d3c9272612840f57fba6196d2ac11a8a5a9dd.chewi@gentoo> (raw)

commit:     586d3c9272612840f57fba6196d2ac11a8a5a9dd
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 25 23:20:50 2015 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Tue Aug 25 23:22:12 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=586d3c92

www-servers/tomcat: Second stab at bug #453212 for version 6

The previous attempt didn't work because 6 doesn't resolve system
properties in the catalina.properties file. I have backported the
change from 7 to make it work.

I have also unbundled el-api.jar in line with the later versions as
per bug #558728.

Package-Manager: portage-2.2.20.1

 www-servers/tomcat/files/tomcat-6-sysprop.patch    | 109 +++++++++++++++++++++
 .../tomcat/files/tomcat-6.0.44-build.xml.patch     |  15 ++-
 www-servers/tomcat/files/tomcat-r1.init            |   1 -
 ...at-6.0.44-r1.ebuild => tomcat-6.0.44-r2.ebuild} |   8 +-
 4 files changed, 125 insertions(+), 8 deletions(-)

diff --git a/www-servers/tomcat/files/tomcat-6-sysprop.patch b/www-servers/tomcat/files/tomcat-6-sysprop.patch
new file mode 100644
index 0000000..033bbc8
--- /dev/null
+++ b/www-servers/tomcat/files/tomcat-6-sysprop.patch
@@ -0,0 +1,109 @@
+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 --git a/www-servers/tomcat/files/tomcat-6.0.44-build.xml.patch b/www-servers/tomcat/files/tomcat-6.0.44-build.xml.patch
index eaa1963..7430651 100644
--- a/www-servers/tomcat/files/tomcat-6.0.44-build.xml.patch
+++ b/www-servers/tomcat/files/tomcat-6.0.44-build.xml.patch
@@ -1,6 +1,6 @@
 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>
@@ -16,7 +16,7 @@ diff -Naur apache-tomcat-6.0.44-src.orig/build.xml apache-tomcat-6.0.44-src/buil
  
    </target>
  
-@@ -307,14 +309,18 @@
+@@ -307,19 +309,25 @@
        manifest="${tomcat.manifests}/annotations-api.jar.manifest" />
  
      <!-- Servlet 2.5 Implementation JAR File -->
@@ -35,7 +35,14 @@ diff -Naur apache-tomcat-6.0.44-src.orig/build.xml apache-tomcat-6.0.44-src/buil
  
  
      <!-- 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">
  
@@ -50,7 +57,7 @@ diff -Naur apache-tomcat-6.0.44-src.orig/build.xml apache-tomcat-6.0.44-src/buil
  
      <!-- Copy scripts -->
      <copy todir="${tomcat.build}/bin">
-@@ -649,9 +657,11 @@
+@@ -649,9 +659,11 @@
        </fileset>
      </txt2html>
  

diff --git a/www-servers/tomcat/files/tomcat-r1.init b/www-servers/tomcat/files/tomcat-r1.init
index 3a69a9d..531baa1 100644
--- a/www-servers/tomcat/files/tomcat-r1.init
+++ b/www-servers/tomcat/files/tomcat-r1.init
@@ -20,7 +20,6 @@ PIDFILE=/@GENTOO_PORTAGE_EPREFIX@var/run/${RC_SVCNAME}.pid
 
 export JAVA_HOME=`java-config ${TOMCAT_JVM:+--select-vm ${TOMCAT_JVM}} --jre-home`
 export CLASSPATH="${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar"
-[[ @SLOT@ = 6 ]] && CLASSPATH+=":/@GENTOO_PORTAGE_EPREFIX@usr/share/tomcat-servlet-api-2.5/lib/jsp-api.jar:/@GENTOO_PORTAGE_EPREFIX@usr/share/tomcat-servlet-api-2.5/lib/servlet-api.jar"
 
 depend() {
 	use dns logger net

diff --git a/www-servers/tomcat/tomcat-6.0.44-r1.ebuild b/www-servers/tomcat/tomcat-6.0.44-r2.ebuild
similarity index 95%
rename from www-servers/tomcat/tomcat-6.0.44-r1.ebuild
rename to www-servers/tomcat/tomcat-6.0.44-r2.ebuild
index e2d1b32..d3f72ba 100644
--- a/www-servers/tomcat/tomcat-6.0.44-r1.ebuild
+++ b/www-servers/tomcat/tomcat-6.0.44-r2.ebuild
@@ -24,7 +24,7 @@ SAPI_SLOT="2.5"
 
 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"
@@ -44,9 +44,11 @@ java_prepare() {
 	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\


             reply	other threads:[~2015-08-25 23:22 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-25 23:22 James Le Cuirot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-10-15  7:36 [gentoo-commits] repo/gentoo:master commit in: www-servers/tomcat/files/, www-servers/tomcat/ Miroslav Šulc
2024-04-04  7:51 Miroslav Šulc
2023-11-08  9:02 Miroslav Šulc
2023-01-04  8:05 Miroslav Šulc
2022-09-27  5:17 Miroslav Šulc
2022-09-18 11:20 Miroslav Šulc
2022-04-01 10:04 Miroslav Šulc
2022-04-01  9:50 Miroslav Šulc
2022-02-22  9:13 Miroslav Šulc
2022-01-21 10:02 Miroslav Šulc
2022-01-21 10:02 Miroslav Šulc
2021-08-07 14:56 Miroslav Šulc
2021-07-05 14:15 Miroslav Šulc
2021-05-13 11:09 Miroslav Šulc
2021-04-07 15:03 Miroslav Šulc
2021-04-07 14:33 Miroslav Šulc
2021-03-13 12:03 Miroslav Šulc
2021-02-04 10:50 Miroslav Šulc
2020-11-24 10:30 Miroslav Šulc
2020-07-20  8:40 Miroslav Šulc
2020-07-07  8:10 Miroslav Šulc
2020-02-09 23:34 Miroslav Šulc
2019-11-25 12:26 Miroslav Šulc
2019-04-19 14:51 Miroslav Šulc
2019-01-23 14:54 Miroslav Šulc
2019-01-23 12:49 Miroslav Šulc
2018-06-01  8:34 Miroslav Šulc
2018-04-13 14:08 Miroslav Šulc
2018-04-08 20:15 James Le Cuirot
2018-02-15 17:00 Miroslav Šulc
2018-01-23 15:30 Miroslav Šulc
2017-12-15 18:03 Miroslav Šulc
2017-12-04 15:07 Miroslav Šulc
2017-11-16  8:54 Miroslav Šulc
2017-10-19  7:41 Miroslav Šulc
2017-10-11 14:27 Miroslav Šulc
2017-08-10 10:35 Miroslav Šulc
2017-08-10 10:35 Miroslav Šulc
2017-07-15  7:50 Miroslav Šulc
2017-07-15  7:50 Miroslav Šulc
2017-07-15  7:50 Miroslav Šulc
2017-05-15 17:36 Miroslav Šulc
2017-05-09 13:27 Miroslav Šulc
2017-04-25 10:12 Miroslav Šulc
2017-04-09 14:56 Miroslav Šulc
2017-04-09 14:28 Miroslav Šulc
2017-03-31 17:40 Miroslav Šulc
2017-03-31 17:40 Miroslav Šulc
2017-03-31 17:40 Miroslav Šulc
2017-03-14 15:15 Miroslav Šulc
2017-02-10 10:11 Miroslav Šulc
2017-01-25 15:56 Miroslav Šulc
2016-12-13 12:22 Miroslav Šulc
2016-12-13  8:34 Miroslav Šulc
2016-11-10 16:03 Miroslav Šulc
2016-10-13 17:10 Miroslav Šulc
2016-09-06 17:23 Miroslav Šulc
2016-07-13 21:39 Miroslav Šulc
2016-07-13 21:39 Miroslav Šulc
2016-06-14 12:34 Miroslav Šulc
2016-06-14 12:18 Miroslav Šulc
2016-05-25 20:10 Miroslav Šulc
2016-02-18  9:13 Miroslav Šulc
2016-02-12 18:28 Miroslav Šulc
2016-02-10 14:40 Miroslav Šulc
2016-01-18 15:18 Miroslav Šulc
2015-12-11  9:50 Miroslav Šulc
2015-12-04 18:11 Miroslav Šulc
2015-11-25 19:49 Miroslav Šulc
2015-10-15 11:07 Miroslav Šulc
2015-10-02  9:08 Miroslav Šulc
2015-09-03 16:50 Miroslav Šulc
2015-08-16 14:22 James Le Cuirot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1440544932.586d3c9272612840f57fba6196d2ac11a8a5a9dd.chewi@gentoo \
    --to=chewi@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox