Jpackage on FC3
The Jpackage project has RPMs for lots of Free Java packages and also SRPMs that you can build against various non-Free packages like Java from Sun.
This page documents how to install only Free software packages, see the Jpackage with Sun Java on FC3 page for information about using Java from Sun.
This page explains how to install the packages required to build and deploy MKSearch on Fedora Core 3 using Apache Ant, Tomcat 5.x and JUnit regression tests. This configuration is documented because it is the primary configuration used in the development of the system. It is possible to build the project without Ant or JUnit and deploy to other servlet containers, see $mk_home/bin/README.txt
for further details.
Lines in the examples that start with a $
prompt are things you can do as a normal user, lines that start with a #
are things that have to be done by root. When copying these instructions, you do not need to copy the $
or the #
!
Configuring Yum
The first thing to do is either configure Yum (which comes with FC3) to get the Free Jpackage packages or configure Apt (which comes from other repos such as Freshrpms) - you don't need to configure both. If you are not sure which to use then Yum is probably best. The Jpackage site has Apt and Yum configuration instructions, or you can follow the short Yum instructions that have been taken from there.
GPG
To ensure that the packages you install are not corrupted you first need to install the Jpackage GPG key. You can download the key as a normal user but you need to install it as root:
$ cd /tmp/ $ wget http://jpackage.org/jpackage.asc $ su # rpm --import jpackage.asc
Yum
It is simply a matter of downloading the jpackage.repo list and installing it as root:
$ cd /tmp/ $ wget http://jpackage.org/jpackage.repo $ su # mv jpackage.repo /etc/yum.repos.d/
You can then run yum update
to update the list of available packages.
Installing Packages
The first thing to do is to install the java compat packages.
# yum install gcc-java compat-gcc-java \ java-1.4.2-gcj-compat java-1.4.2-gcj-compat-devel Dependencies Resolved Transaction Listing: Install: compat-gcc-java.i386 0:8-3.3.4.2 Install: java-1.4.2-gcj-compat.noarch 0:1.4.2.0-11jpp Install: java-1.4.2-gcj-compat-devel.noarch 0:1.4.2.0-11jpp Performing the following to resolve dependencies: Install: compat-libgcj.i386 0:8-3.3.4.2 Install: compat-libgcj-devel.i386 0:8-3.3.4.2 Install: ecj.i386 0:2.1.3-5 Install: katana.noarch 0:2.0.0-1 Is this ok [y/N]: y
The three key packages that are required for this deployment are named tomcat5
, ant
and junit
, so start by trying to install these.
# yum install tomcat5 ant junit Error: missing dep: jta >= 0:1.0.1-0.a.1 for pkg tomcat5 Error: missing dep: j2sdk = 2000:1.4.2_06-fcs for pkg java-1.4.2-sun-compat
So, non-Free packages are required and you need to follow the instructions on the Jpackage with Sun Java on FC3 page.
Java
Download, verify and install the java-1.5.0-sun
package from Jpackage, again ignore the warnings about users not existing.
$ cd /tmp/ $ wget http://mirrors.sunsite.dk/jpackage/1.6/generic/non-free/SRPMS/java-1.5.0-sun-1.5.0.01-1jpp.nosrc.rpm $ rpm -K java-1.5.0-sun-1.5.0.01-1jpp.nosrc.rpm java-1.5.0-sun-1.5.0.01-1jpp.nosrc.rpm: (sha1) dsa sha1 md5 gpg OK $ rpm -Uvh java-1.5.0-sun-1.5.0.01-1jpp.nosrc.rpm
Next try building the package to see what is needed from the Sun site.
$ cd ~/rpms/specs/ $ rpmbuild -ba java-1.5.0-sun.spec sh: ~/rpms/sources/jdk-1_5_0_01-linux-i586.bin: No such file or directory error: Bad exit status from /usr/local/src/rpms/tmp/rpm-tmp.28816 (%prep)
So now we know we need to find jdk-1_5_0_01-linux-i586.bin
from Sun.
This can be found via the J2SE 5.0 page, click though the agreement following the Download JDK link and select the Linux self-extracting file - jdk-1_5_0_01-linux-i586.bin
and save it to /tmp/
.
Next copy the file required to build the RPM.
$ cp /tmp/jdk-1_5_0_01-linux-i586.bin ~/rpms/sources/ $ cd ~/rpms/specs/ $ rpmbuild -ba java-1.5.0-sun.spec Wrote: ~/rpms/srpms/java-1.5.0-sun-1.5.0.01-1jpp.nosrc.rpm Wrote: ~/rpms/rpms/i586/java-1.5.0-sun-1.5.0.01-1jpp.i586.rpm Wrote: ~/rpms/rpms/i586/java-1.5.0-sun-devel-1.5.0.01-1jpp.i586.rpm Wrote: ~/rpms/rpms/i586/java-1.5.0-sun-src-1.5.0.01-1jpp.i586.rpm Wrote: ~/rpms/rpms/i586/java-1.5.0-sun-demo-1.5.0.01-1jpp.i586.rpm Wrote: ~/rpms/rpms/i586/java-1.5.0-sun-plugin-1.5.0.01-1jpp.i586.rpm Wrote: ~/rpms/rpms/i586/java-1.5.0-sun-fonts-1.5.0.01-1jpp.i586.rpm Wrote: ~/rpms/rpms/i586/java-1.5.0-sun-alsa-1.5.0.01-1jpp.i586.rpm Wrote: ~/rpms/rpms/i586/java-1.5.0-sun-jdbc-1.5.0.01-1jpp.i586.rpm
Now you should be ready to install the java-1.5.0-sun-devel-1.5.0.01-1jpp.i586.rpm
package that jta
depends on, and any depandencies.
# rpm -Uvh ~/rpms/rpms/i586/java-1.5.0-sun-devel-1.5.0.01-1jpp.i586.rpm error: Failed dependencies: java-1.5.0-sun = 0:1.5.0.01-1jpp is needed by java-1.5.0-sun-devel-1.5.0.01-1jpp.i586 # rpm -Uvh ~/rpms/rpms/i586/java-1.5.0-sun-devel-1.5.0.01-1jpp.i586.rpm \ ~/rpms/rpms/i586/java-1.5.0-sun-1.5.0.01-1jpp.i586.rpm Preparing... ########################################### [100%] 1:java-1.5.0-sun ########################################### [ 50%] 2:java-1.5.0-sun-devel ########################################### [100%]
Now we can go back to the jta
build instructions above and try again; this time there should not be any errors.
$ cd ~/rpms/specs/ $ rpmbuild -ba jta.spec Wrote: ~/rpms/srpms/jta-1.0.1-0.b.4jpp.nosrc.rpm Wrote: ~/rpms/rpms/noarch/jta-1.0.1-0.b.4jpp.noarch.rpm Wrote: ~/rpms/rpms/noarch/jta-javadoc-1.0.1-0.b.4jpp.noarch.rpm
And now install jta
.
# rpm -Uvh ~/rpms/rpms/noarch/jta-1.0.1-0.b.4jpp.noarch.rpm Preparing... ########################################### [100%] 1:jta ########################################### [100%]
Tomcat, Ant and JUnit
Now all the depandencies have been installed, we can go back to the intital install attempt and try again.
# yum install tomcat5 ant junit Dependencies Resolved Transaction Listing: Install: ant.noarch 0:1.6.2-3jpp Install: junit.noarch 0:3.8.1-4jpp Install: tomcat5.noarch 0:5.0.30-1jpp Performing the following to resolve dependencies: Install: axis.noarch 0:1.1-3jpp Install: bcel.noarch 0:5.1-5jpp Install: classpathx-jaf.noarch 0:1.0-2jpp Install: classpathx-mail.noarch 0:1.0-3jpp Install: jakarta-commons-beanutils.noarch 0:1.7.0-1jpp Install: jakarta-commons-collections.noarch 0:3.1-1jpp Install: jakarta-commons-daemon.noarch 1:1.0-2jpp Install: jakarta-commons-dbcp.noarch 0:1.2.1-3jpp Install: jakarta-commons-digester.noarch 0:1.6-2jpp Install: jakarta-commons-discovery.noarch 1:0.2-2jpp Install: jakarta-commons-el.noarch 0:1.0-3jpp Install: jakarta-commons-fileupload.noarch 1:1.0-3jpp Install: jakarta-commons-launcher.noarch 0:0.9-3jpp Install: jakarta-commons-logging.noarch 0:1.0.4-2jpp Install: jakarta-commons-modeler.noarch 0:1.1-3jpp Install: jakarta-commons-pool.noarch 0:1.2-2jpp Install: log4j.noarch 0:1.2.8-8jpp Install: mx4j.noarch 0:2.0.1-2jpp Install: regexp.noarch 0:1.3-2jpp Install: saxon.noarch 0:6.5.3-3jpp Install: servletapi5.noarch 0:5.0.18-2jpp Install: tyrex.noarch 0:1.0.1-2jpp Install: wsdl4j.noarch 0:1.4-3jpp Install: xerces-j2.noarch 0:2.6.2-4jpp Install: xml-commons.noarch 0:1.0-0.b2.7jpp Install: xml-commons-apis.noarch 0:1.0-0.b2.7jpp Install: xml-commons-resolver.noarch 0:1.1-3jpp Update: jpackage-utils.noarch 0:1.6.2-1jpp Is this ok [y/N]: y
And that's it!
Copyright MKDoc Ltd. and others.
The Free Documentation License http://www.gnu.org/copyleft/fdl.html