# Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit java-pkg IUSE="informix berkdb innodb mysql oci8 postgres" # Struts' TarBall naming convention uses "-rc1", not "_rc1" At="jakarta-${PN}-1.1-rc1" S=${WORKDIR}/${At} # Convenience var USS="/usr/share/${PN}" DESCRIPTION="Apache Jakarta framework for web applications (binary)" HOMEPAGE="http://jakarta.apache.org/struts" SRC_URI="http://www.apache.org/dist/jakarta/struts/binaries/${At}.tar.gz" LICENSE="Apache-1.1" SLOT="0" # ebuild only tested on x86 so far. Should work on others supporting J2SE. KEYWORDS="~x86" # For oracle and postgresql, give users both JDBC 2 and JDBC 3 drivers. # In the case of berkdb and innodb, these are options for mysql; if # they're on we'll assume the user wants or has mysql. DEPEND=">=virtual/jdk-1.2 >=dev-java/xerces-1.3.1 >=net-www/tomcat-3.1 informix? ( dev-java/jdbc-informix ) berkdb? ( dev-java/jdbc-mysql ) innodb? ( dev-java/jdbc-mysql ) mysql? ( dev-java/jdbc-mysql ) oci8? ( dev-java/jdbc2-oracle ) oci8? ( dev-java/jdbc3-oracle ) postgres? ( dev-java/jdbc2-postgresql ) postgres? ( dev-java/jdbc3-postgresql )" RDEPEND=${DEPEND} ######################################################################## ######################################################################## src_compile() { einfo "This is a binary-only ebuild." } ######################################################################## ######################################################################## src_unpack() { unpack ${A} } ######################################################################## # All the html docs are found in the struts-documentation.war. They're # static html, so with just a little fixup we can install them in the # local filesystem and not deploy them to the user's tomcat server ... # which would be a tad presumptuous. ######################################################################## my_do_struts_html() { # Unpack the archive of html files. cd ${S}/webapps mkdir struts-documentation cd struts-documentation jar -xf ../struts-documentation.war # We're setting up static, local pages ... don't need webapp stuff rm -rf WEB-INF rm -rf META-INF # A few pages say they've moved and are on the jakarta site, even # though the hrefs point locally to an existing page. Adjust link # text to match the href. for pg in helping kickstart newbie; do sed 's/This page has moved to/This page has moved /' ${pg}.html > ${pg}.new sed 's/http.*faqs./here/' ${pg}.new > ${pg}.html rm ${pg}.new done for pg in news resources; do sed "s/This page has moved to/This page has moved /" ${pg}.html > ${pg}.new sed "s/http.*${pg}./here/" ${pg}.new > ${pg}.html done dohtml -r * } ######################################################################## ######################################################################## src_install() { #CHANGE -- use java eclass methods einfo ">>> Copying struts jar files, tag libs, dtds, etc." cd ${S} java-pkg_dojar lib/*.jar MY_TMP=${D}usr/share/${PN} sed -e "s/=Apache.*$/=Struts Framework. USE ONLY AT COMPILE TIME, NOT RUN TIME./" \ ${MY_TMP}/package.env > ${MY_TMP}/package.tmp mv ${MY_TMP}/package.tmp ${MY_TMP}/package.env insinto ${USS}/lib doins lib/*d lib/*xml # # Copy over the contrib directory # einfo ">>> Copying 'contrib' directory..." cd ${S} dodir ${USS}/contrib/struts-el/{lib,webapps} insinto ${USS}/contrib/struts-el doins contrib/struts-el/README.txt insinto ${USS}/contrib/struts-el/lib doins contrib/struts-el/lib/* insinto ${USS}/contrib/struts-el/webapps doins contrib/struts-el/webapps/* # # Copy over the webapps directory. Here we could copy everything # to ${CATALINA_HOME}/webapps and it would go live on the next # tomcat restart, but that assumes every user wants to run the # tutorial struts apps next to any production apps they have. # Not a safe bet. # einfo ">>> Copying .war files (but NOT installing as webapps)..." cd ${S} dodir ${USS}/webapps insinto ${USS}/webapps doins webapps/* # # The basic docs # cd ${S} einfo ">>> Installing basic documentation..." dodoc INSTALL LICENSE README # # The html docs. # # struts-documentation.war is meant to be a webapp running in a # servlet container, but (1) we've decided not to install any # webapps for the user; and (2) all the documentation content # is .html ... so let's use it for /usr/share/doc/${P}/html. # einfo ">>> Installing html documentation (this may take a while)" my_do_struts_html } ######################################################################## ######################################################################## pkg_postinst() { einfo " " einfo " FILE LOCATIONS:" einfo " 1. Struts' .jars and other supporting files: ${USS}/lib." einfo " 2. Sample, template, and doc webapps: ${USS}/webapps." einfo " To deploy them, either use tomcat's 'manager' interface, or copy" einfo " the .war file to ${CATALINA_HOME}/webapps and restart tomcat." einfo " In particular, the struts-documentation and tiles-documentation" einfo " webapps are here, waiting for you to deploy them if you wish." einfo " 3. Contributions: ${USS}/contrib." einfo " 4. Documentation: /usr/share/doc/${P}/html. This is a local," einfo " static version of the contents of struts-documentation.war." einfo " " ewarn " NOTE: To use struts, you have to perform further installation into" ewarn " your webapps' directories. We can't do this for you, sorry. See:" ewarn " /usr/share/doc/${P}/html/userGuide/installation.html," ewarn " section titled 'Install A Struts Binary Distribution'. You'll" ewarn " find the files you need to copy in ${USS}/lib." ewarn " NOTE: Jars in ${USS}/lib will be needed for compiling" ewarn " but must NOT be in the classpath when the webapps run. See:" ewarn " /usr/share/doc/${P}/html/faqs/kickstart.html#jar" ewarn " Use java-config to manage your classpath. It should pick up the" ewarn " struts jars just installed. See: man java-config." ewarn " " echo -ne "\a" ; sleep 1 ; echo -ne "\a" ; sleep 1 ; echo -ne "\a" ; sleep 1 sleep 10 }