aboutsummaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorPetteri Räty <betelgeuse@gentoo.org>2007-01-20 22:56:30 +0000
committerPetteri Räty <betelgeuse@gentoo.org>2007-01-20 22:56:30 +0000
commit990f915f69cf1187841906163d4e205554027a5d (patch)
treede08aab1afd395944007c418fdcd7ffe6820696e /eclass
parentMoved to tree (diff)
downloadjava-990f915f69cf1187841906163d4e205554027a5d.tar.gz
java-990f915f69cf1187841906163d4e205554027a5d.tar.bz2
java-990f915f69cf1187841906163d4e205554027a5d.zip
Added Excalibur eclasses.
svn path=/migrated-java-experimental-overlay/; revision=3564
Diffstat (limited to 'eclass')
-rw-r--r--eclass/excalibur-multi.eclass71
-rw-r--r--eclass/excalibur.eclass82
2 files changed, 153 insertions, 0 deletions
diff --git a/eclass/excalibur-multi.eclass b/eclass/excalibur-multi.eclass
new file mode 100644
index 00000000..3b3dd5c3
--- /dev/null
+++ b/eclass/excalibur-multi.eclass
@@ -0,0 +1,71 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/eclass/base.eclass,v 1.30 2005/12/19 14:02:12 george Exp $
+#
+# Author: Petteri Räty <betelgeuse@gentoo.org>
+# Maintained by the java project
+#
+# The excalibur-multi eclass is a helper for stuff from http://excalibur.apache.org/
+
+inherit excalibur
+
+ECLASS="excalibur-multi"
+INHERITED="${INHERITED} ${ECLASS}"
+
+for module in ${EXCALIBUR_MODULES}; do
+ if [[ "${EXCALIBUR_MODULE_USES_PV}" == "false" ]]; then
+ SRC_URI="${SRC_URI}
+ mirror://apache/excalibur/${PN}/source/${module}-${PV}-src.tar.gz"
+ else
+ SRC_URI="${SRC_URI}
+ mirror://apache/excalibur/${PN}/source/${module}-src.tar.gz"
+ fi
+done
+
+EXPORT_FUNCTIONS src_unpack src_compile src_test src_install
+
+excalibur-multi_src_unpack() {
+ unpack ${A}
+ for module in ${EXCALIBUR_MODULES}; do
+ cd ${module} || die
+ excalibur_src_prepare
+ cd "${WORKDIR}"
+ done
+}
+
+excalibur-multi_src_compile() {
+ for module in ${EXCALIBUR_MODULES}; do
+ cd ${module} || die
+ local jar
+ for module in ${EXCALIBUR_MODULES}; do
+ for jar in "${WORKDIR}"/${module}/target/*.jar; do
+ [[ -e "${jar}" ]] && ln -s "${jar}" target/lib
+ done
+ done
+ java-pkg-2_src_compile
+ cd "${WORKDIR}"
+ done
+}
+
+excalibur-multi_src_test() {
+ for module in ${EXCALIBUR_MODULES}; do
+ cd ${module} || die
+ excalibur_src_test || die
+ cd "${WORKDIR}"
+ done
+}
+
+excalibur-multi_src_install() {
+ for module in ${EXCALIBUR_MODULES}; do
+ cd ${module}
+ java-pkg_newjar target/${module}.jar ${module/-${PV}}.jar
+ if use doc; then
+ # Doing this manually or we would have api/x/api/
+ docinto html/api/${PN}-${sub}
+ dohtml -r dist/docs/api/* || die
+ fi
+ use source && java-pkg_dosrc src/java/*
+ cd "${WORKDIR}"
+ done
+ use doc && java-pkg_recordjavadoc
+}
diff --git a/eclass/excalibur.eclass b/eclass/excalibur.eclass
new file mode 100644
index 00000000..16b9cc12
--- /dev/null
+++ b/eclass/excalibur.eclass
@@ -0,0 +1,82 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/eclass/base.eclass,v 1.30 2005/12/19 14:02:12 george Exp $
+#
+# Author: Petteri Räty <betelgeuse@gentoo.org>
+# Maintained by the java project
+#
+# The excalibur eclass is a helper for stuff from http://excalibur.apache.org/
+
+JAVA_PKG_IUSE="doc source"
+
+inherit java-pkg-2 java-ant-2
+
+ECLASS="excalibur"
+INHERITED="${INHERITED} ${ECLASS}"
+
+DESCRIPTION="${PN} from Apache Excalibur"
+HOMEPAGE="http://excalibur.apache.org/"
+
+[[ "${EXCALIBUR_MODULES}" ]] || SRC_URI="mirror://apache/excalibur/source/${P}-src.tar.gz"
+
+LICENSE="Apache-2.0"
+
+_excalibur_test() {
+ [[ "${EXCALIBUR_TESTS}" ]] || return 1
+}
+
+[[ -z "${EXCALIBUR_JDK}" ]] && EXCALIBUR_JDK=1.4
+[[ -z "${EXCALIBUR_JRE}" ]] && EXCALIBUR_JRE=1.4
+
+DEPEND=">=virtual/jdk-${EXCALIBUR_JDK}"
+
+RDEPEND=">=virtual/jre-${EXCALIBUR_JRE}"
+
+if _excalibur_test; then
+ IUSE="${IUSE} test"
+ DEPEND="
+ ${DEPEND}
+ dev-java/junit
+ dev-java/ant-tasks"
+fi
+
+EXPORT_FUNCTIONS src_unpack src_test src_install
+
+excalibur_src_prepare() {
+ java-ant_ignore-system-classes
+ mkdir -p target/lib
+ cd target/lib
+ for atom in ${EXCALIBUR_JAR_FROM}; do
+ java-pkg_jar-from ${atom}
+ done
+ if _excalibur_test; then
+ java-pkg_jar-from --build-only junit
+ for atom in ${EXCALIBUR_TEST_JAR_FROM}; do
+ java-pkg_jar-from --build-only --with-dependencies ${atom}
+ done
+ fi
+}
+
+excalibur_src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ excalibur_src_prepare
+}
+
+excalibur_src_test() {
+ if _excalibur_test; then
+ eant -DJunit.present=true
+ else
+ echo "This package does not support tests."
+ fi
+}
+
+excalibur_src_install() {
+ java-pkg_newjar target/${P}.jar
+ # There might not be any
+ for txt in *.txt; do
+ dodoc ${txt} || die "dodoc ${txt} failed"
+ done
+ use doc && java-pkg_dojavadoc dist/docs/api
+ use source && java-pkg_dosrc src/java/*
+}