# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header$ inherit eutils java java-pkg DESCRIPTION="AppFuse is an application for \"kickstarting\" webapp development." SRC_URI="https://appfuse.dev.java.net/files/documents/1397/4691/${P}-src.tar.gz" HOMEPAGE="http://appfuse.dev.java.net/" LICENSE="Creative Commons License" SLOT="0" KEYWORDS="x86" IUSE="" S="${WORKDIR}/${PN}" DEPEND=">=virtual/jdk-1.4 >=dev-db/mysql-4.0.18 >=dev-java/ant-1.6 >=www-servers/tomcat-5.0 =dev-util/checkstyle-3.3* >=dev-java/dbunit-2.0 >=dev-java/log4j-1.2.8 dev-java/jakarta-jstl dev-java/commons-beanutils dev-java/commons-collections dev-java/commons-digester dev-java/commons-fileupload dev-java/commons-lang dev-java/commons-logging dev-java/commons-validator =dev-java/jakarta-oro-2* dev-java/struts >=dev-java/sun-javamail-bin-1.3.1 >=dev-java/sun-jaf-bin-1.0.2 =dev-java/junit-3.8.1* >=dev-util/pmd-1.2 =dev-java/jaxen-1.0* =dev-java/jdbc3-postgresql-7.4* =dev-java/servletapi-2.3* =dev-java/velocity-1.4* =dev-java/xdoclet-1.2.1" # >=dev-java/jdbc-mysql-3.0.12 RDEPEND=">=virtual/jre-1.4 >=www-servers/tomcat-5.0" S="${WORKDIR}/${PN}" RESTRICT="nomirror" src_unpack() { unpack ${A} cd ${S} # enable the use of an environment variable that will dictate # the destination where the project is created. epatch ${FILESDIR}/${PV}/gentoo.diff # TODO: ebuild for checkstyle-3.1, or test if newer versions work cd ${S}/lib/checkstyle-3.1 java-pkg_jar-from checkstyle checkstyle-3.3.jar checkstyle-all-3.1.jar cd ${S}/lib/checkstyle-3.1/contrib for XSL in `ls`; do cp /usr/share/checkstyle/contrib/${XSL} ./ done # TODO: ebuild for clickstream # TODO: ebuild for countrytag # use installed dbunit cd ${S}/lib/dbunit-2.0 java-pkg_jar-from dbunit dbunit.jar dbunit-2.0.jar # TODO: ebuild for displaytag needed # TODO: ebuild for hibernate needed # TODO: ebuild for jakarta-cactus needed # use the log4j that is already installed. cd ${S}/lib/jakarta-log4j-1.2.8/dist/lib; java-pkg_jar-from log4j # TODO: figure out if newer struts can be used cd ${S}/lib/jakarta-struts-20031202/lib/ java-pkg_jar-from commons-beanutils commons-beanutils.jar java-pkg_jar-from commons-collections commons-collections.jar java-pkg_jar-from commons-digester commons-digester.jar java-pkg_jar-from commons-fileupload commons-fileupload.jar java-pkg_jar-from commons-validator commons-validator.jar java-pkg_jar-from jakarta-oro-2.0 jakarta-oro.jar java-pkg_jar-from struts struts.jar # TODO: figure out packages for struts-el.jar and validator-rules.jar # TODO: ebuild for jakarta-jstl-1.0.5, or test if newer versions work # TODO: ebuild for java2html needed # use the sun-javamail-bin that is already installed. cd ${S}/lib/javamail-1.3.1; java-pkg_jar-from sun-javamail-bin mail.jar # use the sun-jaf-bin that is already installed. cd ${S}/lib/javamail-1.3.1; java-pkg_jar-from sun-jaf-bin activation.jar # use the junit that is already installed. cd ${S}/lib/junit3.8.1; java-pkg_jar-from junit junit.jar # TODO: ebuild for jdbc-mysql-3.0.12, or test older/newer versions # use pmd, jaxen, and saxpath that are already installed cd ${S}/lib/pmd-1.2/lib java-pkg_jar-from jaxen jaxen-full.jar jaxen-core-1.0-fcs.jar java-pkg_jar-from saxpath saxpath.jar saxpath-1.0-fcs.jar java-pkg_jar-from pmd pmd.jar pmd-1.2.jar # use jdbc3-postgresql that is already installed cd ${S}/lib/postgresql-jdbc-7.4 java-pkg_jar-from jdbc3-postgresql jdbc3-postgresql.jar postgresql-jdbc3-7.4.jar # use servletapi that is already installed cd ${S}/lib/servletapi-2.3 java-pkg_jar-from servletapi-2.3 servletapi-2.3.jar # TODO: ebuild for spring needed # TODO: ebuild for statetag needed # TODO: ebuild for struts-menu needed # use the velocity that is already installed. cd ${S}/lib/velocity-1.4 java-pkg_jar-from velocity velocity-1.4.jar # TODO: need velocity-tools-viewer-1.1.jar # TODO: ebuild for webtest needed # use xdoclet that is already installed cd ${S}/lib/xdoclet-1.2.1-dev # only get the jar files that are already there for JAR in `ls`; do java-pkg_jar-from xdoclet $JAR done } src_compile() { :; } src_install() { dodir /opt/${P} # copy all the directories over to the install location. # Ommit the lib dir as this is handled differently. local dirs="docs extras metadata src test web" # TODO: use insinto/doins instead of cp for i in $dirs ; do cp -dPR $i ${D}/opt/${P}/ done local files="app-settings.xml appfuse.iml appfuse.ipr appfuse.iws build.properties build.xml compile-jsp.xml create-tables.sql database.properties.reference properties.xml tomcat.properties README-new.txt" # TODO: use insinto/doins instead of cp for i in $files; do cp -dP $i ${D}/opt/${P}/ done # copy over some of the libs and link the ones to already installed # gentoo ones. # TODO: use insinto/doins instead of cp dodir /opt/${P}/lib cp -dP lib/lib.properties ${D}/opt/${P}/lib local libdirs="JUnitDoclet.1.0.2 ant-contrib-0.5 checkstyle-3.1 clickstream-1.0.1 countrytag-1.6 dbunit-2.0 displaytag-1.0-rc1 hibernate-2.1.3 jakarta-cactus-13-1.6.1 jakarta-log4j-1.2.8 jakarta-struts-20031202 jakarta-taglibs java2html-1.3.1 javamail-1.3.1 junit3.8.1 mysql-connector-java-3.0.12-production pmd-1.2 postgresql-jdbc-7.4 servletapi-2.3 spring-1.0.2-dev statetag-1.6 struts-menu-2.2 strutstest-2.1 velocity-1.4 webtest-build432 xdoclet-1.2.1-dev" # TODO: use insinto/doins instead of cp for i in $libdirs ; do cp -dPR lib/$i ${D}/opt/${P}/lib/ done dodoc README.txt LICENSE.txt } pkg_postinst() { einfo "To use appfuse to generate a new web application" einfo "execute the following commands:" einfo " - cd /opt/${P}" einfo " - WORKING=/home/username \\" einfo " ant new -Dapp.name=yourApp -Ddb.name=database " einfo "" einfo " To test out your new application run the following commands:" einfo " - cd /home/username/yourApp" einfo " - ant setup" einfo " - ant" einfo " - ant test-all" }