You are not logged in.

#1 2007-05-25 16:14:49

Janax
Member
From: Iowa
Registered: 2007-05-21
Posts: 86

32-bit Java PKGBUILD...

OK.  Started trying out Arch this week after working with Gentoo for over 3 years.  One thing that I need at work is "javaws" - Java Web Start - and the 64-bit jre/jdk does not include it.  So I went about trying to create a 32-bit jdk/jre package.

Not yet being all that familiar with Arch methods/internals, I'm hoping for some advice about what I've done wrong with this PKGBUILD (there most likely is at least one!):

pkgname=lib32-jdk
pkgver=6.0
pkgrel=1
pkgdesc="32bit version of Sun's J2SE Development Kit"
url="http://java.sun.com/j2se/1.6.0/"
arch=(x86_64)
groups=('lib32')
license="dlj-1.1"
depends=('lib32-libstdc++5' 'lib32-libsm' 'lib32-libx11' 'lib32-libxau' 'lib32-l
ibxdmcp' 'lib32-libxext' 'lib32-libxi' 'lib32-libxt' 'lib32-libxtst')
# lib32-libxp not available?
makedepends=()
conflicts=(jdk jre)
replaces=()
provides=('java-environment' 'j2sdk')
backup=()
install="lib32-jdk.install"

bin_file=jdk-6-dlj-linux-i586.bin
source=(http://download.java.net/dlj/binaries/${bin_file}
        https://jdk-distros.dev.java.net/source/browse/*checkout*/jdk-distros/tr
unk/utils/construct.sh
        lib32-jdk.profile)
md5sums=('f4481c4e064cec06a65d7751d9105c6d' '94065b612df0046d9ae758943f9f6a75'\
         'cc95939885417666879034f67b71e741')

build() {
  cd ${startdir}/src

  mkdir unbundle-jdk
  cd unbundle-jdk

  sh ../${bin_file} --accept-license

  cd ..

  sh construct.sh unbundle-jdk linux-jdk linux-jre

#  rm -rf linux-jdk/jre
  rm linux-jdk/src.zip

  mkdir -p ${startdir}/pkg/opt
  mv linux-jdk ${startdir}/pkg/opt/java32

  install -D -m755 ${startdir}/src/${pkgname}.profile ${startdir}/pkg/etc/profil
e.d/${pkgname}.sh

}

Accompanying lib32-jdk.profile:

export J2SDKDIR=/opt/java32
export J2REDIR=${J2SDKDIR}/jre
export PATH=$PATH:$J2SDKDIR/bin:${J2REDIR}/bin
export MANPATH=$MANPATH:$J2SDKDIR/man:${J2REDIR}/man
export JAVA_HOME=/opt/java32
export CLASSPATH=$CLASSPATH:$J2SDKDIR/lib:${J2REDIR}/lib

...and finally the lib32-jdk.install:

post_upgrade() {
        post_install $1
}

post_install() {
   echo "The jdk package is licensed software."
        echo "You MUST read and agree to the license stored in"
        echo "/opt/java/LICENSE before using it."

}

op=$1
shift
$op $*

p.s. I may start working on a way to easily switch between JDK versions ('multislotting') later - would that violate Arch's KISS principle?

Offline

#2 2007-05-29 18:36:17

JAwuku
Member
Registered: 2007-05-07
Posts: 24

Re: 32-bit Java PKGBUILD...

Thank you for your efforts!

I am trying to build it as I type now.

You can get lib32-libxp and lib32-libxtst from AUR.

Do you know, whether this includes a plugin for 32-bit firefox?

Cheers

Last edited by JAwuku (2007-05-29 18:37:47)

Offline

#3 2007-05-29 19:02:02

JAwuku
Member
Registered: 2007-05-07
Posts: 24

Re: 32-bit Java PKGBUILD...

Report on my progress at building the package:

a few  easily recitfiable errors came up with makepkg. It was looking for packages lib32-l and ibxdmcp
as from the copied PKGBUILD ( a simple copy and paste):

depends=('lib32-libstdc++5' 'lib32-libsm' 'lib32-libx11' 'lib32-libxau' 'lib32-l
ibxdmcp' 'lib32-libxext' 'lib32-libxi' 'lib32-libxt' 'lib32-libxtst')

I merged the 2 lines to read 'lib32-libxdmcp' and it accepted that.

Also, on the line

source=(http://download.java.net/dlj/binaries/${bin_file}
        https://jdk-distros.dev.java.net/source/browse/*checkout*/jdk-distros/tr
unk/utils/construct.sh
        lib32-jdk.profile)

I joined 2nd from last line unk/utils/construct.sh to the preceding line.

(It must have been 1 line originally, but did not carry through to the forum post somehow).

Once these were out of the way, it built the package, but came up with some funny errors:

copying over the JDK tree...
creating JRE directory...
unpacking jars...
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded: ignored.
  ./jre/lib/charsets.jar
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded: ignored.
  ./jre/lib/deploy.jar
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded: ignored.
  ./jre/lib/jsse.jar
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded: ignored.
  ./jre/lib/ext/localedata.jar
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded: ignored.
  ./jre/lib/javaws.jar
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded: ignored.
  ./jre/lib/plugin.jar
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded: ignored.
  ./jre/lib/rt.jar
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded: ignored.
  ./lib/tools.jar
setting up the JRE man pages...
mv: cannot stat `/home/archlinux/Build_Packages/lib32-jdk/src/linux-jdk/man/ja_JP.eucJP/man1/kinit.1': No such file or directory
mv: cannot stat `/home/archlinux/Build_Packages/lib32-jdk/src/linux-jdk/man/ja_JP.eucJP/man1/klist.1': No such file or directory
mv: cannot stat `/home/archlinux/Build_Packages/lib32-jdk/src/linux-jdk/man/ja_JP.eucJP/man1/ktab.1': No such file or directory
mv: cannot stat `/home/archlinux/Build_Packages/lib32-jdk/src/linux-jdk/man/man1/kinit.1': No such file or directory
mv: cannot stat `/home/archlinux/Build_Packages/lib32-jdk/src/linux-jdk/man/man1/klist.1': No such file or directory
mv: cannot stat `/home/archlinux/Build_Packages/lib32-jdk/src/linux-jdk/man/man1/ktab.1': No such file or directory
eliminating duplication between the JDK and JDK/jre...
rm: cannot remove `/home/archlinux/Build_Packages/lib32-jdk/src/linux-jdk/bin/kinit': No such file or directory
rm: cannot remove `/home/archlinux/Build_Packages/lib32-jdk/src/linux-jdk/bin/klist': No such file or directory
rm: cannot remove `/home/archlinux/Build_Packages/lib32-jdk/src/linux-jdk/bin/ktab': No such file or directory
==> Removing info/doc files...
==> Compressing man pages...
==> Stripping debugging symbols from libraries...
==> Stripping symbols from binaries...
==> Generating .FILELIST file...
==> Generating .PKGINFO file...
==> Copying install script...
==> Compressing package...
==> Cleaning up...
==> Finished making: lib32-jdk  (Tue May 29 19:46:58 BST 2007)

is it safe to ignore these?

Thanks

Offline

#4 2007-05-29 19:26:36

Janax
Member
From: Iowa
Registered: 2007-05-21
Posts: 86

Re: 32-bit Java PKGBUILD...

JAwuku wrote:

Report on my progress at building the package:

I merged the 2 lines to read 'lib32-libxdmcp' and it accepted that.

I joined 2nd from last line unk/utils/construct.sh to the preceding line.

(It must have been 1 line originally, but did not carry through to the forum post somehow).

Yes, that was the problem.  I guess the copy/paste I did didn't quite convert to the "code" section tags in the forum here.  Glad you were able to figure that part out.

JAwuku wrote:

Once these were out of the way, it built the package, but came up with some funny errors:

Well, the fakeroot stuff I didn't see since I generally use 'sudo'.  I'm not quite sure what that's all about as I didn't see these errors.

The second list of errors in your post was about missing files.  These errors I DID see, but left alone because the Arch jdk/jre packages both did not have those files either; these were link with missing targets in the official Arch packages.  Neither of the PKGBUILDs for the official (64-bit) Arch packages did anything to fix/remove these dangling links, so I left them the same way in my PKGBUILD.


To answer your earlier question, you can indeed use the plugin for Firefox.  However, you will need to use a 32-bit version of Firefox for the plugin to work directly.  I tried using nspluginwrapper in order to get it to work in the 64-bit version, but I got an error:

[~] $ nspluginwrapper -i /opt/java32/jre/plugin/i386/ns7/libjavaplugin_oji.so
nspluginwrapper: /opt/java32/jre/plugin/i386/ns7/libjavaplugin_oji.so is not a valid NPAPI plugin

I haven't tracked it down any further than that yet - I had forgotten all about it!  Guess I'll need to look at that once I get a bit more free time again...

Last edited by Janax (2007-05-29 19:27:41)

Offline

#5 2008-03-27 02:07:22

Nuwanda
Member
From: Montevideo, Uruguay
Registered: 2008-01-04
Posts: 22

Re: 32-bit Java PKGBUILD...

The "Install shortcuts to the selected application" button in the Java Cache Viewer (Java Web Start) is always disabled. Any idea why? I'd like to use that feature.

BTW, great package. Thanks!

Offline

Board footer

Powered by FluxBB