diff options
author | Krzysztof Pawlik <nelchael@gentoo.org> | 2006-07-06 12:25:05 +0000 |
---|---|---|
committer | Krzysztof Pawlik <nelchael@gentoo.org> | 2006-07-06 12:25:05 +0000 |
commit | 45a4dea5d18701addd32b915e23dec74d2223e7e (patch) | |
tree | 806fc1b205b59a58af11048fc3e294961e769d8d /eclass/java-wsdp.eclass | |
parent | Initial version. (diff) | |
download | historical-45a4dea5d18701addd32b915e23dec74d2223e7e.tar.gz historical-45a4dea5d18701addd32b915e23dec74d2223e7e.tar.bz2 historical-45a4dea5d18701addd32b915e23dec74d2223e7e.zip |
New eclass for Sun's JWSDP.
Diffstat (limited to 'eclass/java-wsdp.eclass')
-rw-r--r-- | eclass/java-wsdp.eclass | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/eclass/java-wsdp.eclass b/eclass/java-wsdp.eclass new file mode 100644 index 000000000000..c1f2f85e7416 --- /dev/null +++ b/eclass/java-wsdp.eclass @@ -0,0 +1,103 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/eclass/java-wsdp.eclass,v 1.1 2006/07/06 12:25:05 nelchael Exp $ + +# +# Original Author: Krzysiek Pawlik <nelchael@gentoo.org> +# Purpose: Automate installation of Sun's JWSDP components +# + +inherit java-pkg-2 + +ECLASS="java-wsdp" +INHERITED="$INHERITED $ECLASS" + +EXPORT_FUNCTIONS src_unpack src_install pkg_nofetch pkg_setup + +JWSDP_VERSION="${JWSDP_VERSION/./_}" +JWSDP_PKG="${PN/sun-/}" +JWSDP_PKG="${JWSDP_PKG/-bin/}" + +DESCRIPTION="Sun's Java Web Services Developer Pack - ${JWSDP_DESC} (${JWSDP_PKG})" +HOMEPAGE="http://java.sun.com/webservices/jwsdp/" +SRC_URI="jwsdp-${JWSDP_VERSION}-unix.sh" +LICENSE="sun-jwsdp" +SLOT="0" +RESTRICT="fetch nostrip" + +IUSE="doc" + +DEPEND="app-arch/unzip + dev-java/sax + dev-java/xalan + dev-java/xerces" +RDEPEND=">=virtual/jre-1.5 + ${RDEPEND}" + +java-wsdp_pkg_nofetch() { + + einfo "Please go to following URL:" + einfo " ${HOMEPAGE}" + einfo "download file named jwsdp-${JWSDP_VERSION}-unix.sh and place it in:" + einfo " ${DISTDIR}" + +} + +java-wsdp_pkg_setup() { + + # JWSDP version is a version for *whole* pack! Each component has it's own + # version, so we have to know also the JWSDP version: + [[ -z "${JWSDP_VERSION}" ]] && die "No JWSDP version given." + +} + +# The file downloaded from Sun is self-extracting archive, it uses obsolete +# `tail +<number>` syntax, and... breaks, so: +java-wsdp_src_unpack() { + + ebegin "Extracting zip file" + mkdir "${T}/unpacked" || die "mkdir failed" + + # This tries to figure out right offset from `tail +<number>`: + offset="`grep -a '^tail +' ${DISTDIR}/${A} | sed -e 's/.*+\([0-9]\+\).*/\1/'`" + + # Get the archive from .sh file: + tail -n +${offset} "${DISTDIR}/${A}" > "${T}/unpacked/packed.zip" || \ + die "tail failed" + + # And finally unpack it: + cd "${T}/unpacked/" + unzip -qq "packed.zip" || die "unzip failed" + eend 0 + + # Now the Sun's installer is run to get the files: + ebegin "Installing using Sun's installer, please wait" + cd "${T}/unpacked/" + java JWSDP -silent -P installLocation="${WORKDIR}/base" || die "java failed" + eend 0 + + # A little cleanup (remove unneeded files like uninstaller, images for it, + # bundled ant: + cd "${WORKDIR}/base" + rm -fr _uninst uninstall.sh images apache-ant + +} + +java-wsdp_src_install() { + + cd "${WORKDIR}/base/${JWSDP_PKG}" + + # Remove existing compiled jars that belong to other packages (ebuild has to + # define REMOVE_JARS="jar 1 jar2" without ".jar" extension. All jars in + # lib/endorsed/ are ignored: + for i in ${REMOVE_JARS}; do + rm -f lib/${i}.jar + done + + java-pkg_dojar lib/*.jar + + if use doc; then + [[ -d docs ]] && java-pkg_dohtml -r docs/* + fi + +} |