forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev-java/tomcat-servlet-api: bump to 10.0.21
Signed-off-by: Miroslav Šulc <[email protected]>
- Loading branch information
Showing
2 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
dev-java/tomcat-servlet-api/tomcat-servlet-api-10.0.21.ebuild
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# Copyright 1999-2022 Gentoo Authors | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
EAPI=8 | ||
|
||
JAVA_PKG_IUSE="source" | ||
|
||
inherit java-pkg-2 java-pkg-simple | ||
|
||
MY_A="apache-${PN}-${PV}-src" | ||
MY_P="${MY_A/-servlet-api/}" | ||
DESCRIPTION="Tomcat's Servlet API 5.0/JSP API 3.0/EL API 4.0 implementation" | ||
HOMEPAGE="https://tomcat.apache.org/" | ||
SRC_URI="mirror://apache/tomcat/tomcat-10/v${PV}/src/${MY_P}.tar.gz" | ||
|
||
LICENSE="Apache-2.0" | ||
SLOT="5.0" | ||
KEYWORDS="~amd64 ~arm ~arm64 ~x86 ~amd64-linux ~x86-linux ~x64-solaris ~x86-solaris" | ||
IUSE="" | ||
|
||
DEPEND=">=virtual/jdk-1.8:*" | ||
RDEPEND=">=virtual/jre-1.8:*" | ||
|
||
S="${WORKDIR}/${MY_P}/" | ||
|
||
JAVA_TEST_SRC_DIR="src/test" | ||
|
||
SERVLET_API_JAR="servlet-api.jar" | ||
SERVLET_API_SRC="src/main/servlet-api" | ||
SERVLET_API_RESOURCES="src/resources/servlet-api" | ||
EL_API_JAR="el-api.jar" | ||
EL_API_SRC="src/main/el-api" | ||
EL_API_RESOURCES="src/resources/el-api" | ||
JSP_API_JAR="jsp-api.jar" | ||
JSP_API_SRC="src/main/jsp-api" | ||
JSP_API_RESOURCES="src/resources/jsp-api" | ||
|
||
src_prepare() { | ||
default | ||
|
||
# The sources and also resources are mixed together so we first give it a structure to make it easier to compile and package | ||
mkdir -p ${SERVLET_API_SRC} ${SERVLET_API_RESOURCES} \ | ||
${EL_API_SRC} ${EL_API_RESOURCES} \ | ||
${JSP_API_SRC}/jakarta/servlet ${JSP_API_RESOURCES} \ | ||
${JAVA_TEST_SRC_DIR} || die "Failed to create source directory" | ||
|
||
pushd java || die "Failed to cd to java dir" | ||
|
||
cp --parents -R jakarta/servlet "${S}/${SERVLET_API_SRC}/" || die "Failed to copy servlet-api sources" | ||
mv "${S}/${SERVLET_API_SRC}/jakarta/servlet/jsp" "${S}/${JSP_API_SRC}/jakarta/servlet" || die "Failed to copy jsp-api sources" | ||
cp --parents -R jakarta/el "${S}/${EL_API_SRC}/" || die "Failed to copy el-api sources" | ||
|
||
popd | ||
|
||
for file in $(find src -type f | grep -vE "\.java$"); do | ||
target_dir=$(dirname $file | sed "s%src/main/%src/resources/%g") | ||
mkdir -p ${target_dir} || die "Failed to create resource directory" | ||
mv $file ${target_dir} || die "Failed to move resource file" | ||
done | ||
|
||
mv test/jakarta ${JAVA_TEST_SRC_DIR} || die "Failed to copy test sources" | ||
|
||
java-pkg-2_src_prepare | ||
} | ||
|
||
src_compile() { | ||
JAVA_SRC_DIR="${SERVLET_API_SRC}" | ||
JAVA_RESOURCE_DIRS="${SERVLET_API_RESOURCES}" | ||
JAVA_JAR_FILENAME="${SERVLET_API_JAR}" | ||
java-pkg-simple_src_compile | ||
rm -fr target || die "Failed to remove compiled files" | ||
|
||
JAVA_SRC_DIR="${EL_API_SRC}" | ||
JAVA_RESOURCE_DIRS="${EL_API_RESOURCES}" | ||
JAVA_JAR_FILENAME="${EL_API_JAR}" | ||
java-pkg-simple_src_compile | ||
rm -fr target || die "Failed to remove compiled files" | ||
|
||
JAVA_SRC_DIR="${JSP_API_SRC}" | ||
JAVA_RESOURCE_DIRS="${JSP_API_RESOURCES}" | ||
JAVA_JAR_FILENAME="${JSP_API_JAR}" | ||
JAVA_GENTOO_CLASSPATH_EXTRA="servlet-api.jar:el-api.jar" | ||
java-pkg-simple_src_compile | ||
} | ||
|
||
src_install() { | ||
JAVA_SRC_DIR="${SERVLET_API_SRC}" | ||
JAVA_JAR_FILENAME="${SERVLET_API_JAR}" | ||
java-pkg-simple_src_install | ||
|
||
JAVA_SRC_DIR="${EL_API_SRC}" | ||
JAVA_JAR_FILENAME="${EL_API_JAR}" | ||
java-pkg-simple_src_install | ||
|
||
JAVA_SRC_DIR="${JSP_API_SRC}" | ||
JAVA_JAR_FILENAME="${JSP_API_JAR}" | ||
java-pkg-simple_src_install | ||
} |