Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 18352

Summary: Tomcat: make build from source
Product: Gentoo Linux Reporter: Dylan Carlson (RETIRED) <absinthe>
Component: New packagesAssignee: Jan Brinkmann (RETIRED) <luckyduck>
Status: RESOLVED FIXED    
Severity: enhancement CC: java, mholzer, mkennedy, mwolfe, web-apps
Priority: High Keywords: EBUILD
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 7005, 18279    
Bug Blocks: 18353, 37922    
Attachments: first quick attempt at the ebuild
tomcat-5.0.24.ebuild
tarred up ebuild related files for tomcat-5.0.28
tarred up ebuild related files for tomcat-5.0.28
tarred up ebuild related files for tomcat-5.0.28
tomcat-5.0.28.ebuild
tar file with tomcat ebuild and related files.
Changed SRC_URI and position of SLOT definition

Description Dylan Carlson (RETIRED) gentoo-dev 2003-03-28 03:00:02 UTC
Make future ebuilds compile Tomcat from source.
Comment 1 Pavel 2004-05-19 15:56:52 UTC
Created attachment 31724 [details]
first quick attempt at the ebuild

several changes still needed
1) put somewhere else other then /opt
2) add dependencies
3) enable security manager
Comment 2 Pavel 2004-05-19 18:36:37 UTC
Created attachment 31738 [details]
tomcat-5.0.24.ebuild

removed some download dependencies
Comment 3 Dylan Carlson (RETIRED) gentoo-dev 2004-07-25 19:42:18 UTC
Re-assigning to java until I have more time.
Comment 4 Mark Wolfe 2004-09-17 19:04:32 UTC
I have had a look at this ebuild at it seems that apache only keep the current version of tomcat source on there mirrors. So it after renaming this ebuild to it's new version it doesnt seem to work anymore.

I am willing to help with this one but it seems to have been dropped in the too hard basket. 

This it would seem is probably due to overworked developers :)

Any comments on this ??
Comment 5 Mark Wolfe 2004-09-24 23:43:05 UTC
The following list contains all the libs need to build tomcat. This list contains the required lib name, whether or not it is in portage, as well as the library closest version in portage. 

LIB NAME		Present	Closest version
----------------------- ------- ------------------------------------
commons-beanutils-1.7.0	YES 	= dev-java/commons-beanutils-1.7.0
commons-collections-3.1	YES	= dev-java/commons-collections-3.1
commons-daemon-1.0	YES	= dev-java/commons-daemon-1.0
commons-dbcp-1.2.1	YES	= dev-java/commons-dbcp-1.2.1
commons-digester-1.5	YES	= dev-java/commons-digester-1.5
commons-el-1.0		YES	= dev-java/commons-el-1.0
commons-fileupload-1.0	YES	= dev-java/commons-fileupload-1.0
commons-httpclient-2.0	YES	= dev-java/commons-httpclient-2.0-r1
commons-launcher-0.9	YES	= dev-java/commons-httpclient-2.0-r1
commons-logging-1.0.4	YES	= dev-java/commons-logging-1.0.4
commons-modeler-1.1	YES	= dev-java/commons-modeler-1.1
commons-pool-1.2	NO 	= dev-java/commons-pool-1.1
jakarta-log4j-1.2.8	YES	= dev-java/log4j-1.2.8-r1
jakarta-regexp-1.3	YES	= dev-java/regexp-1.3-r1
jakarta-struts-1.1	NO	= dev-java/struts-1.1
jaxen-1.0-FCS		NO	= dev-java/jaxen-1.0
jsp-api-2.0		YES	= dev-java/servletapi-2.4
junit3.8.1		NO	= dev-java/junit-3.8.1-r1
mx4j-1.1.1		N\A
nsis-2.0		N\A	Not needed as it is a windows thing
saxpath-1.0-FCS		NO	= dev-java/saxpath-1.0
servlet-api-2.4		YES	= dev-java/servletapi-2.4
xerces-2_6_2		YES	= dev-java/xerces-2.6.2-r1

This leads to the following todo list
- Create ebuilds for the missing libraries:
	- mx4j-1.1.1 - http://mx4j.sourceforge.net/
	- commons-pool-1.2 - http://jakarta.apache.org/commons/pool/
- Modify existing ebuild to build and install from the source version of tomcat.
- Split out the example as a seperate ebuild for convenience.
- Work out why some of the deps for this are masked and push them up to stable.
- Wipe hands on pants and have a beer.
Comment 6 Mark Wolfe 2004-10-05 07:11:48 UTC
Created attachment 41145 [details]
tarred up ebuild related files for tomcat-5.0.28 

This is the first cut of an ebuild that builds tomcat from source I am sure
there are a few things that can be done better.

TODO List
- Move the tomcat out of opt dividing it between /etc /usr/share and /var/lib
- Analyse the files downloaded to build the server with a mind to use already
installed jars
- Work on ensuring source based ebuilds exist for all the dependencies in
portage, get them stable and use them.
- Look into the methods of reducing the "hacks" required to build this
application from source.
Comment 7 Mark Wolfe 2004-10-06 07:37:56 UTC
Created attachment 41226 [details]
tarred up ebuild related files for tomcat-5.0.28 

Ok this ebuild reduces the downloads of build dependencies from appox 20 to 7.

TODO List is pretty much the same as the previous post except I have started
work on the second item.

Hopefully someone sees this, tests this ebuild, and maybe even provide feedback
:) 

SUB TODO List is now as follows:
- Need to work on two of the deps to make there existing ebuilds more easily
intergrated with this ebuild. These are as follows:
    - Commons Launcher - Need to install LauncherBootstrap.class as a seperate
file.
    - Commons Modeler - Need to have a look at getting this to use mx4j for JMX
stuff rather than the reference implementation from sun because I hate manually
fetching stuff.
 - Need to test the following packages and get them marked as stable:
    - Struts 1.1
    - jaxen 1.0
    - saxpath-1.0
Comment 8 Mark Wolfe 2004-10-08 06:40:08 UTC
Created attachment 41360 [details]
tarred up ebuild related files for tomcat-5.0.28 

Down to four downloads and working on reducing this to two once I fix
commons-launcher and commons-modeler.
Comment 9 Thomas Matthijs (RETIRED) gentoo-dev 2004-10-08 10:24:00 UTC
Created attachment 41373 [details]
tomcat-5.0.28.ebuild

I made some changes, and it WORKSFORME now
Comment 10 Thomas Matthijs (RETIRED) gentoo-dev 2004-10-09 03:00:30 UTC
commited, but package.masked it for further testing

and it failed to compile with struts 1.2, Will have to check why when i have some time

So we probably want to SLOT struts
Comment 11 Thomas Matthijs (RETIRED) gentoo-dev 2004-10-12 12:46:50 UTC
Anyone else tested this yet?
Comment 12 Mark Wolfe 2004-10-22 02:29:36 UTC
Created attachment 42407 [details]
tar file with tomcat ebuild and related files.

Updated the ebuild and the tomcat.conf file.

This ebuild moves everything out of the /opt directory and also implements
TOMCAT_BASE. See http://gentoo-wiki.com/Tomcat_Gentoo_ebuild for more
information.

Someone please, please test it :)
Comment 13 Segedunum 2004-10-30 07:28:26 UTC
I'm looking into compiling this, and have looked at using the masked ebuild in Portage, but I've been struck by the number of dependencies. It also wants to download the blackdown JRE and JDK for JMX, but the JRE is included in the JDK. Is this really necessary?
Comment 14 Thomas Matthijs (RETIRED) gentoo-dev 2004-10-30 07:43:47 UTC
only the jdk is needed, if you merge the jdk it won't try to merge the jre anymore, this is shortcoming(bug/feature) of portage
Comment 15 Segedunum 2004-10-31 04:16:29 UTC
Yes you're right - thanks Thomas. JDK installed and JRE disappeared.

Anyway, my ultimate aim over the next few weeks is to get a working Tomcat installation going, so I'll be giving this ebuild a whirl. I'm also going much further by getting Jonas up and running.

Comment 16 Segedunum 2004-10-31 12:45:16 UTC
Created attachment 43029 [details]
Changed SRC_URI and position of SLOT definition

Changed the SRC_URI. This seems to have been changed by Apache changed to a
path under /src.
Changed the definition of SLOT to be above the SRC_URI. SLOT was used here
but it wasn't set.
Comment 17 Segedunum 2004-10-31 12:59:39 UTC
The ebuild seems to work absolutely fine, apart from a couple of minor
typos (my first ebuild submit!). It seemed to have installed some unnecessary
packages like Jython and libreadline-java (are they needed?), but that could have been down to my use flags and installation. Still starting out on some
of these Java dependencies.

Just something quick to get something working - haven't looked at the todos
yet and using struts >=1.2
Comment 18 Segedunum 2004-10-31 15:00:56 UTC
Hi all. Don't bother to compile Tomcat 5.0.28 against struts 1.2.x. It won't
work. The Tomcat people have only been building 5.5 against struts 1.2
so far. According to this bug report:

http://issues.apache.org/bugzilla/show_bug.cgi?id=31656

They have backported fixes from 5.5 to 5.0.30, so this will be fixed in that
version - hopefully. Looks like it's too late for 5.0.29.
Comment 19 Jan Brinkmann (RETIRED) gentoo-dev 2005-02-07 15:44:17 UTC
i'm now going to maintain tomcat. starting from tomorrow i'll start to work on this
Comment 20 Jan Brinkmann (RETIRED) gentoo-dev 2005-02-13 11:57:56 UTC
an reworked ebuild which is based on the one which was contributed by  Mark Wolfe is now in the tree. i've removed the packed jar issue and it now installs the jars using java-pkg_dojar to make them available for other packeges, like jetty. the 5.0.28 is the latest stable version from the 5.0 release. i'll add an ebuild an patches etc for 5.5.x in the near future. marking this one as fixed.