Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
jakarta-jstl for ppc and ibm-jdk
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
aym
n00b
n00b


Joined: 06 Apr 2004
Posts: 3

PostPosted: Mon May 15, 2006 7:23 pm    Post subject: jakarta-jstl for ppc and ibm-jdk Reply with quote

Hi folks,
I run gentoo on a ppc, I was in need to use taglib with tomcat so I checked portage to find that jakarta-jstl is not available for ppc.
I tried it anyway, and of course it did not work.
Did some modif to the ebuild file, to the build.xml which come with the package and here we go, it compiles, installs and merges succesfully.
A bit of WARNING, the modifs I made break the way the ebuild work for x86 people who use sun jdk.
So the magic is:
Code:

mkdirhier /usr/local/portage/dev-java/jakarta-jstl/
cp /usr/portage/dev-java/jakarta-jstl/jakarta-jstl-1.1.2.ebuild /usr/local/portage/dev-java/jakarta-jstl/

Your portage overlay is in /usr/local/portage, check /etc/make.conf and PORTDIR_OVERLAY.

In the ebuild change the KEYWORDS variable to KEYWORDS="~ppc"
I personnaly test it with ppc to be faster.

Now, sun ships his jdk with some packages which are not ship by default by ibm.
So we have to give that info to ant. In the ebuild look in src_unpack for the echo command and replace it with
Code:

        echo -e "base.dir=..\n" \
                 "build.dir = \${base.dir}/build\n" \
                 "build.classes=\${build.dir}/standard/standard/classes\n" \
                 "dist.dir = \${base.dir}/dist\n" \
                 "servlet24.jar=$(java-pkg_getjar servletapi-2.4 servlet-api.jar)\n" \
                 "jsp20.jar=$(java-pkg_getjar servletapi-2.4 jsp-api.jar)\n" \
                 "jdbc2_0-stdext.jar=$(java-pkg_getjar jdbc2-stdext jdbc2_0-stdext.jar)\n" \
                 "jaxp-api.jar=$(java-pkg_getjar xerces-2 xercesImpl.jar)\n" \
                 "xalan.jar=$(java-pkg_getjar xalan xalan.jar)\n" \
                 "xercesImpl.jar=$(java-pkg_getjar xerces-2 xercesImpl.jar)\n" \
                 "sax.jar=$(java-pkg_getjar xerces-2 xml-apis.jar)\n" \
                 "dom.jar=$(java-pkg_getjar xerces-2 xml-apis.jar)\n" \
                 > build.properties

Here we added jdbc2_0-stdext.jar, jaxp-api.jar, xalan.jar, xercesImpl.jar, sax.jar, dom.jar.
Obviously that mean you need those packages
Code:

dev-java/jdbc2-stdext
dev-java/xerces
dev-java/xalan


I added them in the DEPEND variable in the ebuild. Hope it was correct.

Now you are ready to type
Code:

emerge -av jakarta-jstl

Watch carefully the actions done by emerge, when it reaches
Code:

>>> Source unpacked

Do a Ctrl-Z to pause emerge.

Why do we need to do that? The build script has a reference on a file shipped by the sun jdk, which does not exist on ibm jdk. ibm broke this file on smaller files to easily update them.

So you need to fire up your favorite editor and reach the build script in the work directory of you package set up by emerge
Code:

vim /var/tmp/portage/jakarta-jstl-1.1.2/work/jakarta-taglibs-standard-1.1.2-src/standard/build.xml

Then make a search of rt.jar.
You should find it line 488 in the javac tag, in attribute bootclasspath.
Change the attribute to look like
Code:

      bootclasspath="${xalan.jar}:${java.home}/lib/core.jar:${java.home}/lib/server.jar:${java.home}/lib/graphics.jar"

The devs should have make a variable for this attribute and we could have modified it directly from the ebuild.
We replaced rt.jar with core.jar (for java.lang et java.util), server.jar (for java.sql), and graphics.jar (I don't know for which package but it's necessary).
Then reload the sleeping emerge process with
Code:

fg 1


That should take care of everything.
You are welcome to comment or bring corrections.

PS: the new ebuild.
Code:

# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-java/jakarta-jstl/jakarta-jstl-1.1.2.ebuild,v 1.5 2006/04/03 23:16:09 nichoj Exp $

inherit java-pkg

DESCRIPTION="An implementation of the JSP Standard Tag Library (JSTL)"
HOMEPAGE="http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html"
SRC_URI="mirror://apache/jakarta/taglibs/standard/source/jakarta-taglibs-standard-${PV}-src.tar.gz"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~ppc"
USE="doc jikes examples source"

RDEPEND=">=virtual/jre-1.4.2
        =dev-java/servletapi-2.4*"
DEPEND=">=virtual/jdk-1.4.2
        ${RDEPEND}
        dev-java/ant-core
        jikes? ( dev-java/jikes )
        dev-java/jdbc2-stdext
        dev-java/xerces
        dev-java/xalan
        source? ( app-arch/zip )"

S=${WORKDIR}/jakarta-taglibs-standard-${PV}-src/standard

src_unpack() {
        unpack ${A}
        cd ${S}

        echo -e "base.dir=..\n" \
                 "build.dir = \${base.dir}/build\n" \
                 "build.classes=\${build.dir}/standard/standard/classes\n" \
                 "dist.dir = \${base.dir}/dist\n" \
                 "servlet24.jar=$(java-pkg_getjar servletapi-2.4 servlet-api.jar)\n" \
                 "jsp20.jar=$(java-pkg_getjar servletapi-2.4 jsp-api.jar)\n" \
                 "jdbc2_0-stdext.jar=$(java-pkg_getjar jdbc2-stdext jdbc2_0-stdext.jar)\n" \
                 "jaxp-api.jar=$(java-pkg_getjar xerces-2 xercesImpl.jar)\n" \
                 "xalan.jar=$(java-pkg_getjar xalan xalan.jar)\n" \
                 "xercesImpl.jar=$(java-pkg_getjar xerces-2 xercesImpl.jar)\n" \
                 "sax.jar=$(java-pkg_getjar xerces-2 xml-apis.jar)\n" \
                 "dom.jar=$(java-pkg_getjar xerces-2 xml-apis.jar)\n" \
                 > build.properties
}

src_compile() {
        local antflags="build"
        use doc && antflags="${antflags} javadoc-dist"
        use jikes && antflags="${antflags} -Dbuild.compiler=jikes"
        ant ${antflags} || die "compilation failed"
}

src_install() {
        java-pkg_dojar ${S}/../build/standard/standard/lib/*.jar

        use doc && java-pkg_dohtml -r ${S}/doc/web/* ${S}/../dist/standard/javadoc/
        if use examples; then
                dodir /usr/share/doc/${PF}/examples
                cp -r ${S}/examples/* ${D}/usr/share/doc/${PF}/examples
        fi
        use source && java-pkg_dosrc ${S}/src/*
}


Do not forget to modify the build.xml. It's too long to be paste here.
Back to top
View user's profile Send private message
aym
n00b
n00b


Joined: 06 Apr 2004
Posts: 3

PostPosted: Mon May 15, 2006 7:46 pm    Post subject: Reply with quote

I forget to mention:
after a modif in your ebuild you shoud run
ebuild path/to/ebuil/file.ebuild digest
Back to top
View user's profile Send private message
mark_alec
Bodhisattva
Bodhisattva


Joined: 11 Sep 2004
Posts: 6066
Location: Melbourne, Australia

PostPosted: Tue May 16, 2006 7:54 am    Post subject: Reply with quote

Moved from Portage & Programming to Gentoo on PPC. More relevant to this forum.
Back to top
View user's profile Send private message
aym
n00b
n00b


Joined: 06 Apr 2004
Posts: 3

PostPosted: Tue May 16, 2006 2:51 pm    Post subject: Reply with quote

A good night of sleep help you clarify your thoughts.
Here is a new ebuild to do the install with emerge doing all the dirty work
and without messing the other architectures :) (but not tested because I have only a ppc)

So dev-java/jakarta-jstl-1.1.2.ebuild becomes:
Code:

# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-java/jakarta-jstl/jakarta-jstl-1.1.2.ebuild,v 1.5 2006/04/03 23:16:09 nichoj Exp $

inherit java-pkg java-utils

DESCRIPTION="An implementation of the JSP Standard Tag Library (JSTL)"
HOMEPAGE="http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html"
SRC_URI="mirror://apache/jakarta/taglibs/standard/source/jakarta-taglibs-standard-${PV}-src.tar.gz"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 x86 ~ppc"
USE="doc jikes examples source"

RDEPEND=">=virtual/jre-1.4.2
   =dev-java/servletapi-2.4*"
DEPEND=">=virtual/jdk-1.4.2
   ${RDEPEND}
   dev-java/ant-core
   jikes? ( dev-java/jikes )
   source? ( app-arch/zip )"

vendor=`java-utils_get-vm-vendor`
if [[ "${vendor}" = "ibm-jdk-bin" ]]; then 
ibmjdk=1;
else ibmjdk=0;
fi

if [[ ${ibmjdk} ]]; then
   DEPEND="${DEPEND}
   dev-java/jdbc2-stdext
   dev-java/xerces
   dev-java/xalan";      
fi

S=${WORKDIR}/jakarta-taglibs-standard-${PV}-src/standard

src_unpack() {
   unpack ${A}
   cd ${S}

   echo -e "base.dir=..\n" \
       "build.dir = \${base.dir}/build\n" \
       "build.classes=\${build.dir}/standard/standard/classes\n" \
       "dist.dir = \${base.dir}/dist\n" \
       "servlet24.jar=$(java-pkg_getjar servletapi-2.4 servlet-api.jar)\n" \
       "jsp20.jar=$(java-pkg_getjar servletapi-2.4 jsp-api.jar)\n" \
       > build.properties

   if [[ ${ibmjdk} ]]; then
      echo -e    "jdbc2_0-stdext.jar=$(java-pkg_getjar jdbc2-stdext jdbc2_0-stdext.jar)\n" \
       "jaxp-api.jar=$(java-pkg_getjar xerces-2 xercesImpl.jar)\n" \
       "xalan.jar=$(java-pkg_getjar xalan xalan.jar)\n" \
       "xercesImpl.jar=$(java-pkg_getjar xerces-2 xercesImpl.jar)\n" \
       "sax.jar=$(java-pkg_getjar xerces-2 xml-apis.jar)\n" \
       "dom.jar=$(java-pkg_getjar xerces-2 xml-apis.jar)\n" \
      >> build.properties;
   fi
}

src_compile() {
   local antflags="build"
   use doc && antflags="${antflags} javadoc-dist"
   use jikes && antflags="${antflags} -Dbuild.compiler=jikes"
   
   if [[ ${ibmjdk} ]]; then
      epatch "${FILESDIR}"/bootclasspath.patch;
   fi
   
   ant ${antflags} || die "compilation failed"
}

src_install() {
   java-pkg_dojar ${S}/../build/standard/standard/lib/*.jar

   use doc && java-pkg_dohtml -r ${S}/doc/web/* ${S}/../dist/standard/javadoc/
   if use examples; then
      dodir /usr/share/doc/${PF}/examples
      cp -r ${S}/examples/* ${D}/usr/share/doc/${PF}/examples
   fi
   use source && java-pkg_dosrc ${S}/src/*
}


and in the file directory of jakarta-jstl
add a file bootclasspath.patch with this content:
Code:

--- standard.orig/build.xml     2006-05-16 09:18:11.000000000 -0500
+++ standard/build.xml  2006-05-15 11:22:39.000000000 -0500
@@ -170,7 +170,7 @@
     <javac
       srcdir="${library.src}"
       destdir="${build.library}/classes"
-      bootclasspath="${xalan.jar}:${java.home}/lib/rt.jar"
+      bootclasspath="${xalan.jar}:${java.home}/lib/core.jar:${java.home}/lib/server.jar:${java.home}/lib/graphics.jar"
       classpath="${servlet24.jar}:${jsp20.jar}:${jdbc2_0-stdext.jar}:${jaxp-api.jar}:${dom.jar}:${sax.jar}"
       excludes="org/apache/taglibs/standard/lang/jstl/parser/jsp20/* org/apache/taglibs/standard/lang/jpath/** org/apache/taglibs/standard/lang/spel/**"
       debug="${compile.debug}"


run
Code:

ebuild /usr/local/portage/dev-java/jakarta-jstl/jakarta-jstl-1.1.2.ebuild digest


Then enjoy with
Code:

echo "=dev-java/jakarta-jstl-1.1.2" >> /etc/portage/package.keywords
emerge -av jakarta-jstl
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum