Kill servlet-api and tomcat

Change-Id: I630da3fa37144b2e5fb5117017f43841ba89c42a
Reviewed-on: https://gerrit.libreoffice.org/6454
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index d1b0b08..d3b8dc5 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -2873,18 +2873,6 @@ endef

endif # SYSTEM_RHINO

ifeq ($(SYSTEM_TOMCAT),YES)

gb_ExternalProject__use_servlet_api :=

else # !SYSTEM_TOMCAT

define gb_ExternalProject__use_servlet_api
$(eval $(call gb_ExternalProject_use_external_project,$(1),tomcat))
endef

endif # SYSTEM_TOMCAT

ifeq ($(SYSTEM_APACHE_COMMONS),YES)

define gb_Jar__use_commons-codec
diff --git a/RepositoryModule_host.mk b/RepositoryModule_host.mk
index 5caf81a..15468c5 100644
--- a/RepositoryModule_host.mk
+++ b/RepositoryModule_host.mk
@@ -136,7 +136,6 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\
	sysui \
	test \
	testtools \
	$(call gb_Helper_optional,TOMCAT,tomcat) \
	toolkit \
	tools \
	touch \
diff --git a/config_host.mk.in b/config_host.mk.in
index 7c59597..ddb234a 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -468,7 +468,6 @@ export SAL_ENABLE_FILE_LOCKING=1
export SCPDEFS=@SCPDEFS@
export SDKDIRNAME=@SDKDIRNAME@
export SDKDIRNAME_FOR_BUILD=@SDKDIRNAME_FOR_BUILD@
export SERVLETAPI_JAR=@SERVLETAPI_JAR@
export SHOWINCLUDES_PREFIX=@SHOWINCLUDES_PREFIX@
export SOLARENV=@SRC_ROOT@/solenv
export SOLARINC=@SOLARINC@
@@ -542,7 +541,6 @@ export SYSTEM_POSTGRESQL=@SYSTEM_POSTGRESQL@
export SYSTEM_PYTHON=@SYSTEM_PYTHON@
export SYSTEM_REDLAND=@SYSTEM_REDLAND@
export SYSTEM_RHINO=@SYSTEM_RHINO@
export SYSTEM_SERVLETAPI=@SYSTEM_SERVLETAPI@
export SYSTEM_UCPP=@SYSTEM_UCPP@
export SYSTEM_VIGRA=@SYSTEM_VIGRA@
export SYSTEM_VISIO=@SYSTEM_VISIO@
diff --git a/configure.ac b/configure.ac
index e7f7812f..6c1dd73 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1611,16 +1611,6 @@ AC_ARG_WITH(commons-logging-jar,
        [Specify path to jarfile manually.]),
    COMMONS_LOGGING_JAR=$withval)

AC_ARG_WITH(system-servlet-api,
    AS_HELP_STRING([--with-system-servlet-api],
        [Use servlet-api already on system.]),,
    [with_system_servlet_api="$with_system_jars"])

AC_ARG_WITH(servlet-api-jar,
    AS_HELP_STRING([--with-servlet-api-jar=JARFILE],
        [Specify path to jarfile manually.]),
    SERVLETAPI_JAR=$withval)

AC_ARG_WITH(system-jfreereport,
    AS_HELP_STRING([--with-system-jfreereport],
        [Use JFreeReport already on system.]),,
@@ -10410,29 +10400,6 @@ else
fi
AC_SUBST(ENABLE_MEDIAWIKI)

if test "$ENABLE_MEDIAWIKI" = "TRUE"; then
    AC_MSG_CHECKING([which Servlet API Jar to use])
    if test "$with_system_servlet_api" = "yes"; then
        AC_MSG_RESULT([external])
        SYSTEM_SERVLETAPI=YES
        if test -z "$SERVLETAPI_JAR"; then
            for version in '' -3.3 -3.2 -3.1 -3.0 -2.5 -2.4; do
                if test -r "/usr/share/java/servlet-api${version}.jar"; then
                    SERVLETAPI_JAR=/usr/share/java/servlet-api${version}.jar
                fi
            done
        fi
        AC_CHECK_FILE($SERVLETAPI_JAR, [],
              [AC_MSG_ERROR(servlet-api.jar not found.)], [])
    else
        AC_MSG_RESULT([internal])
        SYSTEM_SERVLETAPI=NO
        BUILD_TYPE="$BUILD_TYPE TOMCAT"
    fi
fi
AC_SUBST(SYSTEM_SERVLETAPI)
AC_SUBST(SERVLETAPI_JAR)

AC_MSG_CHECKING([whether to build the Report Builder])
if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
    AC_MSG_RESULT([yes])
diff --git a/download.lst b/download.lst
index ca0c9d0..9d21fed 100644
--- a/download.lst
+++ b/download.lst
@@ -95,7 +95,6 @@ export RASQAL_TARBALL := b12c5f9cfdb6b04efce5a4a186b8416b-rasqal-0.9.30.tar.gz
export REDLAND_TARBALL := 32f8e1417a64d3c6f2c727f9053f55ea-redland-1.0.16.tar.gz
export RHINO_TARBALL := 798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip
export SWING_TARBALL := 35c94d2df8893241173de1d16b6034c0-swingExSrc.zip
export TOMCAT_TARBALL := 63574e3ada44f473892a61a2da433a59-apache-tomcat-5.5.36-src.tar.gz
export UCPP_TARBALL := 0168229624cfac409e766913506961a8-ucpp-1.3.2.tar.gz
export VIGRA_TARBALL := d62650a6f908e85643e557a236ea989c-vigra1.6.0.tar.gz
export WPD_TARBALL := a3dcac551fae5ebbec16e844810828c4-libwpd-0.9.9.tar.bz2
diff --git a/external/apache-commons/ExternalProject_apache_commons_logging.mk b/external/apache-commons/ExternalProject_apache_commons_logging.mk
index 785224b..afb2f01 100644
--- a/external/apache-commons/ExternalProject_apache_commons_logging.mk
+++ b/external/apache-commons/ExternalProject_apache_commons_logging.mk
@@ -9,10 +9,6 @@

$(eval $(call gb_ExternalProject_ExternalProject,apache_commons_logging))

$(eval $(call gb_ExternalProject_use_externals,apache_commons_logging,\
	servlet_api \
))

$(eval $(call gb_ExternalProject_register_targets,apache_commons_logging,\
	build \
))
@@ -24,10 +20,6 @@ $(call gb_ExternalProject_get_state_target,apache_commons_logging,build) :
		-q \
		-f build.xml \
		-Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \
		$(if $(filter YES,$(SYSTEM_TOMCAT))\
			,-Dservletapi.jar=$(SERVLETAPI_JAR) \
			,-Dservletapi.jar=$(call gb_UnpackedTarball_get_dir,tomcat)/servletapi/jsr154/dist/lib/servlet-api.jar \
		)\
		$(if $(filter yes,$(JAVACISGCJ))\
			,-Dbuild.compiler=gcj \
			,-Dant.build.javac.source=$(JAVA_SOURCE_VER) \
diff --git a/external/apache-commons/patches/logging.patch b/external/apache-commons/patches/logging.patch
index f96eda3..9514aae 100644
--- a/external/apache-commons/patches/logging.patch
+++ b/external/apache-commons/patches/logging.patch
@@ -1,5 +1,5 @@
--- misc/commons-logging-1.1.1-src/build.xml	2007-11-22 00:27:52.000000000 +0100
+++ misc/build/commons-logging-1.1.1-src/build.xml	2008-06-24 14:23:56.316301736 +0200
--- misc/commons-logging-1.1.1-src/build.xml   2007-11-22 00:27:52.000000000 +0100
+++ misc/build/commons-logging-1.1.1-src/build.xml     2008-06-24 14:23:56.316301736 +0200
@@ -127,10 +127,10 @@
 <!-- ========== Compiler Defaults ========================================= -->
 
@@ -13,3 +13,23 @@
 
   <!-- Should Java compilations set the 'debug' compiler option? -->
   <property name="compile.debug"           value="true"/>
@@ -280,6 +280,10 @@
                classpathref="compile.classpath"
                classname="org.apache.avalon.framework.logger.Logger"/>
 
+    <available property="servlet-api.present"
+               classpathref="compile.classpath"
+               classname="javax.servlet.ServletContextListener"/>
+
     <available file="${log4j12.jar}" property="log4j12.present"/>
     <available file="${log4j13.jar}" property="log4j13.present"/>
     <available file="${build.home}/docs" property="maven.generated.docs.present"/>
@@ -370,6 +374,8 @@
                unless="logkit.present"/>
       <exclude name="org/apache/commons/logging/impl/AvalonLogger.java"
                unless="avalon-framework.present"/>
+      <exclude name="org/apache/commons/logging/impl/ServletContextCleaner.java"
+               unless="servlet-api.present"/>
     </javac>
   </target>
 
diff --git a/tomcat/ExternalProject_tomcat.mk b/tomcat/ExternalProject_tomcat.mk
deleted file mode 100644
index e4f3ff1..0000000
--- a/tomcat/ExternalProject_tomcat.mk
+++ /dev/null
@@ -1,30 +0,0 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

$(eval $(call gb_ExternalProject_ExternalProject,tomcat))

$(eval $(call gb_ExternalProject_register_targets,tomcat,\
	build \
))

$(call gb_ExternalProject_get_state_target,tomcat,build) :
	$(call gb_ExternalProject_run,build,\
		$(ICECREAM_RUN) "$(ANT)" \
			-q \
			-f build.xml \
			-Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \
			$(if $(filter yes,$(JAVACISGCJ))\
				,-Dbuild.compiler=gcj \
				,-Dant.build.javac.source=$(JAVA_SOURCE_VER) \
				 -Dant.build.javac.target=$(JAVA_TARGET_VER) \
			) \
			$(if $(debug),-Dbuild.debug="on") \
	,servletapi)

# vim: set noet sw=4 ts=4:
diff --git a/tomcat/Makefile b/tomcat/Makefile
deleted file mode 100644
index ccb1c85..0000000
--- a/tomcat/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-

module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))

include $(module_directory)/../solenv/gbuild/partial_build.mk

# vim: set noet sw=4 ts=4:
diff --git a/tomcat/Module_tomcat.mk b/tomcat/Module_tomcat.mk
deleted file mode 100644
index 621b807..0000000
--- a/tomcat/Module_tomcat.mk
+++ /dev/null
@@ -1,21 +0,0 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

$(eval $(call gb_Module_Module,tomcat))

ifneq ($(ENABLE_JAVA),)
ifneq ($(filter TOMCAT,$(BUILD_TYPE)),)
$(eval $(call gb_Module_add_targets,tomcat,\
	ExternalProject_tomcat \
	UnpackedTarball_tomcat \
))
endif
endif

# vim: set noet sw=4 ts=4:
diff --git a/tomcat/README b/tomcat/README
deleted file mode 100644
index 650ddf2..0000000
--- a/tomcat/README
+++ /dev/null
@@ -1 +0,0 @@
From [http://tomcat.apache.org/]. Patched.
diff --git a/tomcat/UnpackedTarball_tomcat.mk b/tomcat/UnpackedTarball_tomcat.mk
deleted file mode 100644
index 88b8063..0000000
--- a/tomcat/UnpackedTarball_tomcat.mk
+++ /dev/null
@@ -1,17 +0,0 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

$(eval $(call gb_UnpackedTarball_UnpackedTarball,tomcat))

$(eval $(call gb_UnpackedTarball_set_tarball,tomcat,$(TOMCAT_TARBALL),,tomcat))


$(eval $(call gb_UnpackedTarball_add_file,tomcat,servletapi/build.xml,tomcat/build.xml))

# vim: set noet sw=4 ts=4:
diff --git a/tomcat/build.xml b/tomcat/build.xml
deleted file mode 100644
index 10982e6..0000000
--- a/tomcat/build.xml
+++ /dev/null
@@ -1,21 +0,0 @@
<project name="jsr154 in LibreOffice" default="debuild" basedir=".">

  <target name="debuild"
   description="Build jsr154 for LibreOffice (Default)">
    <echo message="Building Servlet 2.4 API"/>
    <ant antfile="jsr154/build.xml"
         target="jar"
         inheritAll="false"
    />
  </target>

  <target name="clean" description="Clean">
    <echo message="Cleaning Servlet 2.4 API"/>
    <ant antfile="jsr154/build.xml"
         target="clean"
         inheritAll="false"
    />
    <delete dir="tmp"/>
  </target>

</project>