cnhnln 发表于 2005-5-5 22:25:58

Jpackage with Sun Java on FC3

From http://www.mksearch.mkdoc.org/howto/jpackage-sun-fc3/

Jpackage with Sun Java on FC3

The Jpackage project has RPMs for lots of Free Java packages and also SR
PMs that you can build against various non-Free packages like Java from
Sun.

This page documents how to install non-Free software packages from Sun i
n additon to Free ones, see the Jpackage on FC3 page for information abo
ut using only Free software.

This page explains how to install the packages required to build and dep
loy MKSearch on Fedora Core 3 using Apache Ant, Tomcat 5.x and JUnit reg
ression tests. This configuration is documented because it is the primar
y configuration used in the development of the system. It is possible to
build the project without Ant or JUnit and deploy to other servlet cont
ainers, see $mk_home/bin/README.txt for further details.

Lines in the examples that start with a $ prompt are things you can do a
s a normal user, lines that start with a # are things that have to be do
ne 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 A
pt and Yum configuration instructions, or you can follow the short Yum i
nstructions 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 u
ser 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 installi
ng 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 three key packages that are required for this deployment are named t
omcat5, 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-c
ompat

Since Tomcat 5 depends on non-Free packages, jta and j2sdk the install h
as failed to complete, so the next thing to do is to install these depen
dencies.

Build environment

First you need to create some directories for building RPMs in and also
set up your build environment, all this should be done as a normal user
and not root.

$ cd

$ mkdir rpms

$ cd rpms

$ mkdir {build,rpms,sources,specs,srpms,tmp}

Next you need to create a ~/.rpmmacros file in your home directory, chan
ge chris in the following example to suit.

%_builddir      /home/chris/rpms/build

%_rpmdir      /home/chris/rpms/rpms

%_sourcedir   /home/chris/rpms/sources

%_specdir       /home/chris/rpms/specs

%_srcrpmdir   /home/chris/rpms/srpms

%_tmppath       /home/chris/rpms/tmp

Now you should be ready to start building the non-Free packages.

jta

First download, verify and install the jta source RPM, you can ignore th
e messages about user jpp not existing.

$ cd /tmp/

$ wget http://mirrors.sunsite.dk/jpackage/1.6/generic/non-free/SRPMS/j
ta-1.0.1-0.b.4jpp.nosrc.rpm

$ rpm -K jta-1.0.1-0.b.4jpp.nosrc.rpm

jta-1.0.1-0.b.4jpp.nosrc.rpm: (sha1) dsa sha1 md5 gpg OK

$ rpm -Uvh jta-1.0.1-0.b.4jpp.nosrc.rpm

   1:jta                  warning: user jpp does not exist - using roo
t

warning: group jpp does not exist - using root

###########################################

Next we can try building it.

$ cd ~/rpms/specs

$ rpmbuild -ba jta.spec

error: File ~/rpms/sources/jta-1_0_1B-classes.zip: No such file or dir
ectory

This error tells us what non-Free things we need to find on the Sun web
site, in this case, jta-1_0_1B-classes.zip.

So go to the jta page and follow the download link for the Class Files 1
0.1B, click through the online agreement and save it to /tmp/ then do t
he same for the JavaDocs 1.0.1B.

Now you can try rebuilding the SRPM again.

$ cp /tmp/

$ cp jta-1_0_1B-classes.zip ~/rpms/sources/

$ cp jta-1_0_1B-doc.zip ~/rpms/sources/

$ cd ~/rpms/specs

$ rpmbuild -ba jta.spec

error: Failed build dependencies:

      java-devel is needed by jta-1.0.1-0.b.4jpp.noarch

So we have discovered that jta depends on java-devel, another non-Free p
ackage.

Java

Download, verify and install the java-1.5.0-sun package from Jpackage, a
gain ignore the warnings about users not existing.

$ cd /tmp/

$ wget http://mirrors.sunsite.dk/jpackage/1.6/generic/non-free/SRPMS/j
ava-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 direct
ory

error: Bad exit status from /usr/local/src/rpms/tmp/rpm-tmp.28816 (%pr
ep)

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 foll
owing 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-1jp
p.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.rp
m

error: Failed dependencies:

      java-1.5.0-sun = 0:1.5.0.01-1jpp is needed by java-1.5.0-sun-dev
el-1.5.0.01-1jpp.i586

# rpm -Uvh ~/rpms/rpms/i586/java-1.5.0-sun-devel-1.5.0.01-1jpp.i586.rp
m \

             ~/rpms/rpms/i586/java-1.5.0-sun-1.5.0.01-1jpp.i586.rpm

Preparing...                ##########################################
#

   1:java-1.5.0-sun         ##########################################
# [ 50%]

   2:java-1.5.0-sun-devel   ##########################################
#

Now we can go back to the jta build instructions above and try again; th
is 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...                ##########################################
#

   1:jta                  ##########################################
#

Tomcat, Ant and JUnit

Now all the depandencies have been installed, we can go back to the inti
tal 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

And that's it!


--
她抱着无忌,低声道:
“孩儿,你长大了之后,要提防女人骗你,越是好看的女人越会骗人。”
将嘴巴凑在无忌耳边,极轻极轻的道:
“我没跟这和尚说,我是骗他的……你瞧你妈……多会骗人!”


页: [1]
查看完整版本: Jpackage with Sun Java on FC3