Mailinglist Archive: opensuse-amd64 (10 mails)

< Previous Next >
Re: [opensuse-amd64] javaplugin
  • From: Frank Steiner <fsteiner-mail1@xxxxxxxxxxxxxx>
  • Date: Mon, 12 Nov 2007 09:30:14 +0100
  • Message-id: <47380F16.4000306@xxxxxxxxxxxxxx>
In case someone is interested: we use the following spec file to compile
the latest java releases as RPMs, both for i586 and x86_64. The x86_64
installs the i586 stuff, too, so that we have the plugin and webstart,
and puts the plugin into /usr/lib/browser-plugins (as is used in SuSE).
We also maintain the /usr/lib/java link and have a /etc/profile.d/myjava.sh
with

[ -L "/usr/lib64/java" ] && export PATH=/usr/lib64/java/bin:${PATH} || export
PATH=/usr/lib/java/bin:${PATH}

This way we can install the latest releases from Sun while still having
the SuSE rpms installed, too, because some other RPMs rely on them.

Maybe someone can make use of it :-)


cu,
Frank




--
Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/
Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/
LMU, Amalienstr. 17 Phone: +49 89 2180-4049
80333 Muenchen, Germany Fax: +49 89 2180-99-4049
* Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. *
distribution: none
vendor: none
packager: Frank Steiner
Summary: jdk
%define java_base_version 1.6.0
%define sun_rel 03
%define sun_filerel 6u3

Name: common-java%{java_base_version}-%{sun_rel}
Version: 1
%define sun_dirname %{java_base_version}_%{sun_rel}
Release: 4
Source0: jdk-%{sun_filerel}-linux-i586.bin
Source10: jdk-%{sun_filerel}-linux-amd64.bin
License: Sun
Group: System
BuildArchitectures: i586 x86_64
BuildRoot: /root/tmp/%{name}
AutoReqProv: yes
PreReq: coreutils
Conflicts: java-1_5_0-sun-plugin
Obsoletes: java-1_5_0-sun-plugin


%define linkname /jdk%{sun_dirname}

%description
Base on the .bin-file by Sun.

For amd64, we install both 32bit and 64bit, and link
/usr/lib/java und /usr/lib64/java. Browser-plugin and
Webstart exist only in 32bit.

Take care: java-1_5_0-sun-plugin.rpm provides the 32bit plugin
on x86_64 hosts and sets a link in /usr/lib/browser-plugins/,
too, and removes it on deinstallation.

Therefore we add it in "Conflicts", "Obsoletes" and "Provides"
to avoid the java-1_5_0-sun-plugin being installed together
with our rpm.

%prep
%setup -c -T


%build
mkdir -p $RPM_BUILD_ROOT/usr/lib{,64}


%pre

%install

olddir=`pwd`
cd $RPM_BUILD_ROOT/usr/lib
export MORE=10000

# 32bit version is installed also on 64bit systems
sh %{SOURCE0} <<EOF >/dev/null
yes
EOF


%ifarch x86_64
cd $RPM_BUILD_ROOT/usr/lib64
sh %{SOURCE10} <<EOF >/dev/null
yes
EOF
%endif

cd $olddir

# needed for some classpath build tools
mkdir -p $RPM_BUILD_ROOT/usr/share/java-%{java_base_version}
mkdir -p $RPM_BUILD_ROOT/usr/lib/java-%{java_base_version}
mkdir -p $RPM_BUILD_ROOT/usr/lib64/java-%{java_base_version}


# check if linkname is correct. Needed in post/postun
if ! test -d "$RPM_BUILD_ROOT/usr/lib/%{linkname}"
then
echo "ERROR: linkname is wrong"
exit 1
fi

%filelist

%post
# set the links
# which is the name to link?

rm -f /usr/lib{,64}/java /usr/lib{,64}/jre
ln -s /usr/lib/%linkname /usr/lib/java
ln -s /usr/lib/%linkname/jre /usr/lib/jre
if [ "`/bin/arch`" = "x86_64" ]
then
ln -s /usr/lib64/%linkname /usr/lib64/java
ln -s /usr/lib64/%linkname/jre /usr/lib64/jre
fi

# plugins are currently always 32bit
cd /usr/lib/browser-plugins
rm -f libjavaplugin_oji.so
ln -s /usr/lib/%linkname/jre/plugin/i386/ns7/libjavaplugin_oji.so




%postun
# If packet is removed (so not upgraded):
# remove links if they point to us.
# If another java rpm overwrote them, leave
# them untouched.
if [ $1 = 0 ]; then
if [ "`readlink /usr/lib/java`" = "/usr/lib/%linkname" ]
then
cat << EOF
WARNING!
The links /usr/lib(64)/java and /usr/lib(64)/jre are removed!
EOF
rm -f /usr/lib{,64}/java /usr/lib{,64}/jre
rm -f /usr/lib/browser-plugins/libjavaplugin_oji.so
exit 1
fi
fi




%clean
%clean_build

%files -f files.list
%dir /usr/share/java-%{java_base_version}
%dir /usr/lib/java-%{java_base_version}
%dir /usr/lib64/java-%{java_base_version}
< Previous Next >
List Navigation
Follow Ups
References