Mailinglist Archive: opensuse (982 mails)

< Previous Next >
Re: [opensuse] Installing Java
Here's a spec Oracle Java that I maintain in a private OBS instance
for packaging java 1.7. It's slightly out of date but should be simple
enough to fix those bits.
--
Later,
Darin


On Tue, Sep 23, 2014 at 12:34 PM, James Knott <james.knott@xxxxxxxxxx> wrote:
On 09/23/2014 12:27 PM, Rui Santos wrote:
Try this link:
https://sites.google.com/site/easylinuxtipsproject/java-for-opensuse

Regards,
Rui

I'll have to give this a try.

tnx

--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

#
# spec file for package java-1_7_0-sun (Version 1.6.0.ea.b108)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

%define section non-free
%define origin sun
%define priority 1700
%define javamajver 1.7.0
%define javaminver 55
%define cvsver 1_7_0
%define buildver 1
%if %{javaminver} < 10
%define toplevel_dir jdk%{javamajver}_0%{javaminver}
%else
%define toplevel_dir jdk%{javamajver}_%{javaminver}
%endif
%define javaver %{javamajver}.u%{javaminver}
%define cvsversion %{cvsver}_%{buildver}
#define cvsversion %{cvsver}
%define javaws_ver %{javaver}
%define javaws_version %{cvsversion}
%define sdklnk java-%{javamajver}-%{origin}
%define jrelnk jre-%{javamajver}-%{origin}
%define sdkdir java-%{javamajver}-%{origin}-%{javamajver}
%define jredir %{sdkdir}/jre
%define sdkbindir %{_jvmdir}/%{sdklnk}/bin
%define sdklibdir %{_jvmdir}/%{sdklnk}/lib
%define jrebindir %{_jvmdir}/%{jrelnk}/bin
%define jvmjardir %{_jvmjardir}/java-%{javamajver}-%{origin}-%{javamajver}
%define x11bindir %{_prefix}/X11R6/bin
%define x11encdir %{_prefix}/X11R6/lib/X11/fonts/encodings
%define fontconfigdir %{_sysconfdir}/fonts
%define fontdir %{_datadir}/fonts/java
%define xsldir %{_datadir}/xml/%{name}-%{javamajver}
%define pluginsdir %{_libdir}/browser-plugins
%ifarch %ix86
%define pluginpath %{_jvmdir}/%{jredir}/lib/i386
%else
%define pluginpath %{_jvmdir}/%{jredir}/lib/amd64
%endif
%define pluginname libnpjp2.so
%define cgibindir %{_var}/www/cgi-bin

Name: java-1_7_0-sun
Version: 1.7.0.u%{javaminver}
Release: %{buildver}
Summary: Java(TM) 7 Runtime Environment
License: NON-OSI-COMPLIANT(royalties)
Group: Development/Languages/Java
URL:
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
Source0: jdk-7u%{javaminver}-linux-i586.tar.gz
#NoSource: 0
Source1: jdk-7u%{javaminver}-linux-x64.tar.gz
#NoSource: 1
%define tzupdate false
ExclusiveArch: %ix86 x86_64
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: jpackage-utils
BuildRequires: unzip
BuildRequires: update-alternatives
BuildRequires: desktop-file-utils
BuildRequires: update-desktop-files
%if 0%{?suse_version} > 1120
BuildRequires: libxslt1
%else
BuildRequires: libxslt
%endif
Provides: jre-%{javamajver}-%{origin} = %{version}-%{release}
Provides: jre-%{origin} = %{version}-%{release}
Provides: jre-%{javamajver}, java-%{javamajver}, jre = %{javaver}
Provides: java-%{origin} = %{version}-%{release}
Provides: java = %{javaver}
Requires: update-alternatives
Requires: jpackage-utils >= 1.7.0
Conflicts: kaffe
Provides: javaws = %{javaws_ver}
Provides: jndi = %{javaver}, jndi-ldap = %{javaver}
Provides: jndi-cos = %{javaver}, jndi-rmi = %{javaver}
Provides: jndi-dns = %{javaver}
Provides: jaas = %{javaver}
Provides: jsse = %{javaver}
Provides: jce = %{javaver}
Provides: jdbc-stdext = 3.0, jdbc-stdext = %{javaver}
Provides: java-sasl = %{javaver}
Provides: jre1.1.x jre1.2.x jre1.3.x jre1.4.x jre1.5.x jre1.6.x jre1.7.x
# 32-bit versus 64-bit specific provides:
%ifarch %ix86 ppc s390
%define bits 32
%endif
%ifarch x86_64 ia64 s390x
%define bits 64
%endif
Provides: jre-%{javamajver}-%{origin}-%{bits} = %{version}-%{release}
Provides: jre-%{origin}-%{bits} = %{version}-%{release}
Provides: jre-%{javamajver}-%{bits}, java-%{javamajver}-%{bits}
Provides: jre-%{bits} = %{javaver}
Provides: java-%{origin}-%{bits} = %{version}-%{release}
Provides: java-%{bits} = %{javaver}
Provides: jndi-%{bits}, jdbc-stdext-%{bits}
Obsoletes: java2-jre < 1.4.2-150
Provides: java2-jre = %{javamajver}
Requires(pre): update-alternatives
%ifarch %ix86
Obsoletes: javaws-menu
%endif
Provides: j2re = %{javamajver}

AutoReqProv: no

%description
Java(TM) 7 Runtime Environment

The Java(TM) 7 Runtime Environment contains the Java virtual machine,
runtime class libraries, and Java application launcher that are
necessary to run programs written in the Java progamming language. It
is not a development environment and does not contain development tools
such as compilers and debuggers. For development tools, see the
%{name}-devel package.

The Java 7 Runtime Environment is intended for software developers and
vendors who wish to redistribute their applications.



%package devel
License: NON-OSI-COMPLIANT(royalties)
Summary: Java(TM) 7 SDK, Standard Edition
Group: Development/Languages/Java
Requires: update-alternatives
Provides: java-sdk-%{javamajver}-%{origin} = %{version}-%{release}
Provides: java-sdk-%{origin} = %{version}-%{release}
Provides: java-sdk-%{javamajver}, java-sdk = %{javaver}
Provides: java-devel-%{origin} = %{version}-%{release}
Provides: java-%{javamajver}-devel, java-devel = %{javaver}
Requires: %{name} = %{version}-%{release}
Requires: jre-%{javamajver}-%{origin}-%{bits} = %{version}-%{release}
Provides: j2sdk = %{javamajver}

%description devel
The Java 7 SDK is a development environment for building applications,
applets, and components using the Java programming language.

The Java 7 SDK includes tools useful for developing and testing
programs written in the Java programming language and running on the
Java platform. These tools are designed to be used from the command
line. Except for the appletviewer, these tools do not provide a
graphical user interface.



%package src
License: NON-OSI-COMPLIANT(royalties)
Summary: Source files for Java(TM) 7 SDK
Group: Development/Languages/Java
Requires: %{name} = %{version}-%{release}
Requires: jre-%{javamajver}-%{origin}-%{bits} = %{version}-%{release}

%description src
This package contains the sources of all classes that make up the Java
7 Standard Edition API, as provided by Sun.

%package plugin
License: NON-OSI-COMPLIANT(royalties)
Summary: Browser plugin files for Java(TM) 7 JRE
Group: Development/Languages/Java
Requires: %{name} = %{version}-%{release}
Requires: jre-%{javamajver}-%{origin}-%{bits} = %{version}-%{release}
Requires: %{_bindir}/find, sed
Provides: java-plugin = %{javaver}, java-%{javamajver}-plugin = %{version}
Conflicts: java-%{javamajver}-ibm-plugin,
java-%{javamajver}-blackdown-plugin
Conflicts: java-%{javamajver}-bea-plugin
Obsoletes: java-1.3.1-plugin, java-1.4.0-plugin, java-1.4.1-plugin,
java-1.4.2-plugin,
Provides: java-1.3.1-plugin, java-1.4.0-plugin, java-1.4.1-plugin,
java-1.4.2-plugin, java-%{javamajver}-plugin
Requires(post): update-alternatives

%description plugin
This package contains browser plugin files for java-1_7_0-sun. Note:
this package supports browsers built with GCC 3.2 and later



%package alsa
License: NON-OSI-COMPLIANT(royalties)
Summary: ALSA support for java-1_7_0-sun
Group: Development/Languages/Java
Requires: %{name} = %{version}-%{release}
Requires: jre-%{javamajver}-%{origin}-%{bits} = %{version}-%{release}

%description alsa
This package contains Advanced Linux Sound Architecture (ALSA) support
libraries for java-1_7_0-sun.



%package jdbc
License: NON-OSI-COMPLIANT(royalties)
Summary: JDBC/ODBC bridge driver for java-1_7_0-sun
Group: Development/Languages/Java
AutoReq: 0
Requires: %{name} = %{version}-%{release}
Requires: jre-%{javamajver}-%{origin}-%{bits} = %{version}-%{release}
Requires: unixODBC
Provides: java-jdbc = %{version}

%description jdbc
This package contains the JDBC/ODBC bridge driver for java-1_7_0-sun.



%prep
export MORE=10000
%ifarch %ix86
#yes | sh %{SOURCE0}
%setup -n %{toplevel_dir} -T -b 0
%endif
%ifarch x86_64
%setup -n %{toplevel_dir} -T -b 1
%endif
chmod -R go=u-w *
chmod -R u+w *

if [ "%tzupdate" = "true" ]
then
%define tzname %(echo %{tzversion} | sed 's/_/./g')
unzip %{SOURCE100}
./bin/java -jar tzupdater-%{tzname}/tzupdater.jar -v -u
fi

%build
# Nope.

%install
export NO_BRP_CHECK_BYTECODE_VERSION="true"
# the Sun bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6532373 is
already fixed
# and combination of fdupes and those symlinks should be dangerous - bnc#473952
#for file in jre/bin/java bin/java jre/bin/ControlPanel bin/appletviewer
#do
# if [ -e $file ]
# then
# cp $file{,.bin}
# cp %{SOURCE5} $file
# fi
#done
# fix up ControlPanel APPHOME and bin locations
perl -p -i -e 's|APPHOME=.*|APPHOME=%{_jvmdir}/%{jredir}|' jre/bin/ControlPanel
perl -p -i -e 's|/usr/bin/||g' jre/bin/ControlPanel
# fix up (create new) HtmlConverter
cat > bin/HtmlConverter << EOF
%{jrebindir}/java -jar %{sdklibdir}/htmlconverter.jar $*
EOF
# fix up java-rmi.cgi PATH
perl -p -i -e 's|PATH=.*|PATH=%{jrebindir}|' bin/java-rmi.cgi
# XXX: what's that?
# install java-rmi-cgi
#install -D -m 755 bin/java-rmi.cgi
$RPM_BUILD_ROOT%{cgibindir}/java-rmi-%{version}.cgi
# main files
install -d -m 755 $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir}
cp -a bin include lib $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir}
cp -a src.zip $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir}
install -d -m 755 $RPM_BUILD_ROOT%{_jvmdir}/%{jredir}
# extensions handling
install -d -m 755 $RPM_BUILD_ROOT%{jvmjardir}
pushd $RPM_BUILD_ROOT%{jvmjardir}
ln -s %{_jvmdir}/%{jredir}/lib/jsse.jar jsse-%{version}.jar
ln -s %{_jvmdir}/%{jredir}/lib/jce.jar jce-%{version}.jar
ln -s %{_jvmdir}/%{jredir}/lib/rt.jar jndi-%{version}.jar
ln -s %{_jvmdir}/%{jredir}/lib/rt.jar jndi-ldap-%{version}.jar
ln -s %{_jvmdir}/%{jredir}/lib/rt.jar jndi-cos-%{version}.jar
ln -s %{_jvmdir}/%{jredir}/lib/rt.jar jndi-rmi-%{version}.jar
ln -s %{_jvmdir}/%{jredir}/lib/rt.jar jaas-%{version}.jar
ln -s %{_jvmdir}/%{jredir}/lib/rt.jar jdbc-stdext-%{version}.jar
ln -s jdbc-stdext-%{version}.jar jdbc-stdext-3.0.jar
ln -s %{_jvmdir}/%{jredir}/lib/rt.jar sasl-%{version}.jar
for jar in *-%{version}.jar ; do
if [ x%{version} != x%{javaver} ]; then
ln -fs ${jar} $(echo $jar | sed "s|-%{version}.jar|-%{javaver}.jar|g")
fi
ln -fs ${jar} $(echo $jar | sed "s|-%{version}.jar|.jar|g")
done
popd
# rest of the jre
cp -a jre/bin jre/lib $RPM_BUILD_ROOT%{_jvmdir}/%{jredir}
#install -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_jvmdir}/%{jredir}/lib
cp -a jre/plugin $RPM_BUILD_ROOT%{_jvmdir}/%{jredir}
install -d -m 755 $RPM_BUILD_ROOT%{_jvmdir}/%{jredir}/lib/endorsed
# jce policy file handling
install -d -m 755 $RPM_BUILD_ROOT%{_jvmprivdir}/%{name}/jce/vanilla
for file in local_policy.jar US_export_policy.jar; do
mv $RPM_BUILD_ROOT%{_jvmdir}/%{jredir}/lib/security/$file \
$RPM_BUILD_ROOT%{_jvmprivdir}/%{name}/jce/vanilla
# for ghosts
touch $RPM_BUILD_ROOT%{_jvmdir}/%{jredir}/lib/security/$file
done
# versionless symlinks
pushd $RPM_BUILD_ROOT%{_jvmdir}
ln -s %{jredir} %{jrelnk}
ln -s %{sdkdir} %{sdklnk}
popd
pushd $RPM_BUILD_ROOT%{_jvmjardir}
ln -s %{sdkdir} %{jrelnk}
ln -s %{sdkdir} %{sdklnk}
popd
install -dm 755 $RPM_BUILD_ROOT%{_datadir}/applications
install -Dpm 644 jre/plugin/desktop/sun_java.png \
$RPM_BUILD_ROOT%{_datadir}/pixmaps/sun-java-%{version}-%{release}.png
cat <<EOF >
$RPM_BUILD_ROOT%{_datadir}/applications/jpackage-%{name}-ControlPanel.desktop
[Desktop Entry]
Name=Sun Java %{version} Java Plug-in Control Panel
GenericName=Java Plugin Control Panel
Comment=Sun Java %{version} Java Plug-in Control Panel
Exec=%{_jvmdir}/%{jredir}/bin/ControlPanel
Icon=sun-java-%{version}-%{release}
Terminal=false
Type=Application
EOF
%suse_update_desktop_file -r
$RPM_BUILD_ROOT%{_datadir}/applications/jpackage-%{name}-ControlPanel.desktop
Java System SystemSetup
# menu entry for web start (reuse plugin control panel icon)
cat <<EOF >
$RPM_BUILD_ROOT%{_datadir}/applications/jpackage-%{name}-webstart.desktop
[Desktop Entry]
Name=Sun Java %{version} Java Web Start
GenericName=Java Web Start
Comment=Java Web Start Application Manager
Exec=%{_jvmdir}/%{jredir}/javaws/javaws -viewer
Icon=sun-java-%{version}-%{release}
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Application;System;Java;X-JPackage;
EOF
chmod 644
$RPM_BUILD_ROOT%{_datadir}/applications/jpackage-%{name}-webstart.desktop
%suse_update_desktop_file -r
$RPM_BUILD_ROOT%{_datadir}/applications/jpackage-%{name}-webstart.desktop Java
System Monitor
# man pages
install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man1
for manpage in man/man1/*; do
install -m 644 -p $manpage $RPM_BUILD_ROOT%{_mandir}/man1/`basename $manpage
.1`-%{name}.1
done
# Most of this shamelessly stolen from redhat's kdebase-2.2.2 specfile
find $RPM_BUILD_ROOT%{_jvmdir}/%{jredir} -type d \
| sed 's|'$RPM_BUILD_ROOT'|%dir |' > %{name}-%{version}-all.files
find $RPM_BUILD_ROOT%{_jvmdir}/%{jredir} -type f -o -type l \
| sed 's|'$RPM_BUILD_ROOT'||' >> %{name}-%{version}-all.files
grep plugin %{name}-%{version}-all.files | sort \
> %{name}-%{version}-plugin.files
grep Jdbc %{name}-%{version}-all.files | sort \
> %{name}-%{version}-jdbc.files
grep -F alsa.so %{name}-%{version}-all.files | sort \
> %{name}-%{version}-alsa.files
cat %{name}-%{version}-all.files \
| grep -v plugin \
| grep -v Jdbc \
| grep -v lib/fonts \
| grep -v "\/demo\/" \
| grep -vF alsa.so \
| grep -v jre/lib/security \
| grep -v %{pluginname} \
> %{name}-%{version}.files
# hardlink duplicates:
# fdupes links the files from JDK to JRE, so it breaks a JRE
# use it carefully :))
# % fdupes -s $RPM_BUILD_ROOT/%{_jvmdir}/%{jredir}/
# % fdupes -s $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir}/demo
# % fdupes -s $RPM_BUILD_ROOT%{_javadocdir}/%{sdkname}
# see bnc#331680
# JAR_EXECUTABLE=$(readlink -f $(find %{_builddir} -name "jar"))
# find $RPM_BUILD_ROOT \( -name "*.jar" -a -type f -a ! -empty \) -exec
$JAR_EXECUTABLE -i {} \;
# bnc#394974
install -d -m 0755 $RPM_BUILD_ROOT/%{_jvmdir}/%{jredir}/.systemPrefs
touch $RPM_BUILD_ROOT/%{_jvmdir}/%{jredir}/.systemPrefs/.systemRootModFile

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /bin/bash
# set link to javaws ... remove old link, if older versions dont point to
alternative
if [ "$(readlink /usr/bin/javaws)" != "/etc/alternatives/javaws" ]
then
rm -f /usr/bin/javaws
fi
ext=
[ -f %{_mandir}/man1/java-%{name}.1.bz2 ] && ext=".bz2"
[ -f %{_mandir}/man1/java-%{name}.1.gz ] && ext=".gz"
update-alternatives --install %{_bindir}/java java %{jrebindir}/java
%{priority} \
--slave %{_bindir}/ControlPanel ControlPanel
%{jrebindir}/ControlPanel \
--slave %{_bindir}/javaws javaws
%{jrebindir}/javaws \
--slave %{_jvmdir}/jre jre
%{_jvmdir}/%{jrelnk} \
--slave %{_jvmjardir}/jre jre_exports
%{_jvmjardir}/%{jrelnk} \
--slave %{_bindir}/keytool keytool
%{jrebindir}/keytool \
--slave %{_bindir}/orbd orbd
%{jrebindir}/orbd \
--slave %{_bindir}/policytool policytool
%{jrebindir}/policytool \
--slave %{_bindir}/rmid rmid
%{jrebindir}/rmid \
--slave %{_bindir}/rmiregistry rmiregistry
%{jrebindir}/rmiregistry \
--slave %{_bindir}/servertool servertool
%{jrebindir}/servertool \
--slave %{_bindir}/tnameserv tnameserv
%{jrebindir}/tnameserv \
--slave %{_mandir}/man1/java.1$ext java.1$ext
%{_mandir}/man1/java-%{name}.1$ext \
--slave %{_mandir}/man1/keytool.1$ext keytool.1$ext
%{_mandir}/man1/keytool-%{name}.1$ext \
--slave %{_mandir}/man1/orbd.1$ext orbd.1$ext
%{_mandir}/man1/orbd-%{name}.1$ext \
--slave %{_mandir}/man1/policytool.1$ext policytool.1$ext
%{_mandir}/man1/policytool-%{name}.1$ext \
--slave %{_mandir}/man1/rmid.1$ext rmid.1$ext
%{_mandir}/man1/rmid-%{name}.1$ext \
--slave %{_mandir}/man1/rmiregistry.1$ext rmiregistry.1$ext
%{_mandir}/man1/rmiregistry-%{name}.1$ext \
--slave %{_mandir}/man1/servertool.1$ext servertool.1$ext
%{_mandir}/man1/servertool-%{name}.1$ext \
%ifarch %ix86
--slave %{_mandir}/man1/javaws.1$ext javaws.1$ext
%{_mandir}/man1/javaws-%{name}.1$ext \
%endif
--slave %{_mandir}/man1/tnameserv.1$ext tnameserv.1$ext
%{_mandir}/man1/tnameserv-%{name}.1$ext
#--slave %{_mandir}/man1/kinit.1$ext kinit.1$ext
%{_mandir}/man1/kinit-%{name}.1$ext \
#--slave %{_mandir}/man1/klist.1$ext klist.1$ext
%{_mandir}/man1/klist-%{name}.1$ext \
#--slave %{_mandir}/man1/ktab.1$ext ktab.1$ext
%{_mandir}/man1/ktab-%{name}.1$ext
update-alternatives --install %{_jvmdir}/jre-%{origin} jre_%{origin}
%{_jvmdir}/%{jrelnk} %{priority} \
--slave %{_jvmjardir}/jre-%{origin} jre_%{origin}_exports
%{_jvmjardir}/%{jrelnk}
update-alternatives --install %{_jvmdir}/jre-%{javamajver} jre_%{javamajver}
%{_jvmdir}/%{jrelnk} %{priority} \
--slave %{_jvmjardir}/jre-%{javamajver} jre_%{javamajver}_exports
%{_jvmjardir}/%{jrelnk}
if [ -d %{_jvmdir}/%{jrelnk}/lib/security ]; then
# Need to remove the old jars in order to support upgrading, ugly :(
# update-alternatives fails silently if the link targets exist as files.
rm -f %{_jvmdir}/%{jrelnk}/lib/security/{local,US_export}_policy.jar
fi
update-alternatives \
--install \
%{_jvmdir}/%{jrelnk}/lib/security/local_policy.jar \
jce_%{javamajver}_%{origin}_local_policy \
%{_jvmprivdir}/%{name}/jce/vanilla/local_policy.jar \
%{priority} \
--slave \
%{_jvmdir}/%{jrelnk}/lib/security/US_export_policy.jar \
jce_%{javamajver}_%{origin}_us_export_policy \
%{_jvmprivdir}/%{name}/jce/vanilla/US_export_policy.jar
if [ -f %{_sysconfdir}/mime.types ]; then
perl -p -i -e 's|application/x-java-jnlp-file.*||g'
%{_sysconfdir}/mailcap.bak 2>/dev/null
echo "type=application/x-java-jnlp-file; description=\"Java Web Start\";
exts=\"jnlp\"" >> %{_sysconfdir}/mailcap 2>/dev/null
perl -p -i -e 's|application/x-java-jnlp-file.*||g'
%{_sysconfdir}/mime.types 2>/dev/null
echo "application/x-java-jnlp-file jnlp" >> %{_sysconfdir}/mime.types
2>/dev/null
fi
### bad symlinks workaround ###
%ifarch %ix86
for ALT in java jre_%{origin} jre-%{javaver}
jce_%{javaver}_%{origin}_local_policy; do
if [[ $(update-alternatives --display ${ALT} | head -n 1 | grep manual) &&
$(readlink /etc/alternatives/${ALT} | grep "1\.6\.0\.u[23]") ]]; then
update-alternatives --auto ${ALT}
fi
done
%endif
### bad symlinks workaround ###

%post devel -p /bin/bash
ext=
[ -f %{_mandir}/man1/javac-%{name}.1.bz2 ] && ext=".bz2"
[ -f %{_mandir}/man1/javac-%{name}.1.gz ] && ext=".gz"
update-alternatives --install %{_bindir}/javac javac %{sdkbindir}/javac
%{priority} \
--slave %{_jvmdir}/java java_sdk
%{_jvmdir}/%{sdklnk} \
--slave %{_jvmjardir}/java java_sdk_exports
%{_jvmjardir}/%{sdklnk} \
--slave %{_bindir}/appletviewer appletviewer
%{sdkbindir}/appletviewer \
--slave %{_bindir}/extcheck extcheck
%{sdkbindir}/extcheck \
--slave %{_bindir}/idlj idlj
%{sdkbindir}/idlj \
--slave %{_bindir}/jar jar
%{sdkbindir}/jar \
--slave %{_bindir}/jarsigner jarsigner
%{sdkbindir}/jarsigner \
--slave %{_bindir}/javadoc javadoc
%{sdkbindir}/javadoc \
--slave %{_bindir}/javah javah
%{sdkbindir}/javah \
--slave %{_bindir}/javap javap
%{sdkbindir}/javap \
--slave %{_bindir}/jdb jdb
%{sdkbindir}/jdb \
--slave %{_bindir}/native2ascii native2ascii
%{sdkbindir}/native2ascii \
--slave %{_bindir}/rmic rmic
%{sdkbindir}/rmic \
--slave %{_bindir}/serialver serialver
%{sdkbindir}/serialver \
--slave %{_bindir}/jconsole jconsole
%{sdkbindir}/jconsole \
--slave %{_bindir}/pack200 pack200
%{sdkbindir}/pack200 \
--slave %{_bindir}/unpack200 unpack200
%{sdkbindir}/unpack200 \
--slave %{_bindir}/HtmlConverter HtmlConverter
%{sdkbindir}/HtmlConverter \
--slave %{_bindir}/apt apt
%{sdkbindir}/apt \
--slave %{_bindir}/jinfo jinfo
%{sdkbindir}/jinfo \
--slave %{_bindir}/jmap jmap
%{sdkbindir}/jmap \
--slave %{_bindir}/jps jps
%{sdkbindir}/jps \
--slave %{_bindir}/jsadebugd jsadebugd
%{sdkbindir}/jsadebugd \
--slave %{_bindir}/jstack jstack
%{sdkbindir}/jstack \
--slave %{_bindir}/jstat jstat
%{sdkbindir}/jstat \
--slave %{_bindir}/jstatd jstatd
%{sdkbindir}/jstatd \
--slave %{_bindir}/jvisualvm jvisualvm
%{sdkbindir}/jvisualvm \
--slave %{_mandir}/man1/appletviewer.1$ext appletviewer.1$ext
%{_mandir}/man1/appletviewer-%{name}.1$ext \
--slave %{_mandir}/man1/extcheck.1$ext extcheck.1$ext
%{_mandir}/man1/extcheck-%{name}.1$ext \
--slave %{_mandir}/man1/idlj.1$ext idlj.1$ext
%{_mandir}/man1/idlj-%{name}.1$ext \
--slave %{_mandir}/man1/jar.1$ext jar.1$ext
%{_mandir}/man1/jar-%{name}.1$ext \
--slave %{_mandir}/man1/jarsigner.1$ext jarsigner.1$ext
%{_mandir}/man1/jarsigner-%{name}.1$ext \
--slave %{_mandir}/man1/javac.1$ext javac.1$ext
%{_mandir}/man1/javac-%{name}.1$ext \
--slave %{_mandir}/man1/javadoc.1$ext javadoc.1$ext
%{_mandir}/man1/javadoc-%{name}.1$ext \
--slave %{_mandir}/man1/javah.1$ext javah.1$ext
%{_mandir}/man1/javah-%{name}.1$ext \
--slave %{_mandir}/man1/javap.1$ext javap.1$ext
%{_mandir}/man1/javap-%{name}.1$ext \
--slave %{_mandir}/man1/jdb.1$ext jdb.1$ext
%{_mandir}/man1/jdb-%{name}.1$ext \
--slave %{_mandir}/man1/jvisualvm.1$ext jvisualvm.1$ext
%{_mandir}/man1/jvisualvm-%{name}.1$ext \
--slave %{_mandir}/man1/native2ascii.1$ext native2ascii.1$ext
%{_mandir}/man1/native2ascii-%{name}.1$ext \
--slave %{_mandir}/man1/rmic.1$ext rmic.1$ext
%{_mandir}/man1/rmic-%{name}.1$ext \
--slave %{_mandir}/man1/serialver.1$ext serialver.1$ext
%{_mandir}/man1/serialver-%{name}.1$ext \
--slave %{_mandir}/man1/jconsole.1$ext jconsole.1$ext
%{_mandir}/man1/jconsole-%{name}.1$ext \
--slave %{_mandir}/man1/pack200.1$ext pack200.1$ext
%{_mandir}/man1/pack200-%{name}.1$ext \
--slave %{_mandir}/man1/unpack200.1$ext unpack200.1$ext
%{_mandir}/man1/unpack200-%{name}.1$ext \
--slave %{_mandir}/man1/apt.1$ext apt.1$ext
%{_mandir}/man1/apt-%{name}.1$ext \
--slave %{_mandir}/man1/jinfo.1$ext jinfo.1$ext
%{_mandir}/man1/jinfo-%{name}.1$ext \
--slave %{_mandir}/man1/jmap.1$ext jmap.1$ext
%{_mandir}/man1/jmap-%{name}.1$ext \
--slave %{_mandir}/man1/jps.1$ext jps.1$ext
%{_mandir}/man1/jps-%{name}.1$ext \
--slave %{_mandir}/man1/jsadebugd.1$ext jsadebugd.1$ext
%{_mandir}/man1/jsadebugd-%{name}.1$ext \
--slave %{_mandir}/man1/jstack.1$ext jstack.1$ext
%{_mandir}/man1/jstack-%{name}.1$ext \
--slave %{_mandir}/man1/jstat.1$ext jstat.1$ext
%{_mandir}/man1/jstat-%{name}.1$ext \
--slave %{_mandir}/man1/jstatd.1$ext jstatd.1$ext
%{_mandir}/man1/jstatd-%{name}.1$ext
update-alternatives --install %{_jvmdir}/java-%{origin} java_sdk_%{origin}
%{_jvmdir}/%{sdklnk} %{priority} \
--slave %{_jvmjardir}/java-%{origin} java_sdk_%{origin}_exports
%{_jvmjardir}/%{sdklnk}
update-alternatives --install %{_jvmdir}/java-%{javamajver}
java_sdk_%{javamajver} %{_jvmdir}/%{sdklnk} %{priority} \
--slave %{_jvmjardir}/java-%{javamajver} java_sdk_%{javamajver}_exports
%{_jvmjardir}/%{sdklnk}
### bad symlinks workaround ###
%ifarch %ix86
for ALT in javac java_sdk_%{origin} java_sdk_%{javaver}; do
if [[ $(update-alternatives --display ${ALT} | head -n 1 | grep manual) &&
$(readlink /etc/alternatives/${ALT} | grep "1\.6\.0\.u[23]") ]]; then
update-alternatives --auto ${ALT}
fi
done
%endif
### bad symlinks workaround ###

%post plugin -p /bin/bash
# set link to plugin lib
cd %{pluginsdir}
JAVAPLUGINS=$(ls -1 | grep "\(java\|gcj\)" | grep -v javaplugin.so || true)
if [ -n "$JAVAPLUGINS" ]
then
rm -rf $JAVAPLUGINS || true
fi
/usr/sbin/update-alternatives --install %{pluginsdir}/javaplugin.so
javaplugin %{pluginpath}/%{pluginname} %{priority}

%preun plugin -p /bin/bash
if [ "$1" = "0" ] ; then
/usr/sbin/update-alternatives --remove javaplugin %{pluginpath}/%{pluginname}
fi

%postun -p /bin/bash
if [ $1 -eq 0 ]; then
update-alternatives --remove java %{jrebindir}/java
update-alternatives --remove \
jce_%{javamajver}_%{origin}_local_policy \
%{_jvmprivdir}/%{name}/jce/vanilla/local_policy.jar
update-alternatives --remove jre_%{origin} %{_jvmdir}/%{jrelnk}
update-alternatives --remove jre_%{javamajver} %{_jvmdir}/%{jrelnk}
fi

%postun devel -p /bin/bash
if [ $1 -eq 0 ]; then
update-alternatives --remove javac %{sdkbindir}/javac
update-alternatives --remove java_sdk_%{origin} %{_jvmdir}/%{sdklnk}
update-alternatives --remove java_sdk_%{javamajver} %{_jvmdir}/%{sdklnk}
fi

%files -f %{name}-%{version}.files
%defattr(-,root,root,-)
%{_datadir}/applications/jpackage-%{name}-webstart.desktop
%{_datadir}/pixmaps/sun-java-%{version}-%{release}.png
%doc jre/COPYRIGHT jre/LICENSE jre/README
%doc jre/Welcome.html
%dir %{_jvmdir}/%{sdkdir}
%{jvmjardir}
%{_jvmdir}/%{jredir}/lib/fonts
%dir %{_jvmdir}/%{jredir}/lib/security
%config(noreplace) %{_jvmdir}/%{jredir}/lib/security/cacerts
%config(noreplace) %{_jvmdir}/%{jredir}/lib/security/java.policy
%config(noreplace) %{_jvmdir}/%{jredir}/lib/security/java.security
%config(noreplace) %{_jvmdir}/%{jredir}/lib/security/javafx.policy
%config(noreplace) %{_jvmdir}/%{jredir}/lib/security/javaws.policy
%config(noreplace) %{_jvmdir}/%{jredir}/lib/security/blacklist
%config(noreplace) %{_jvmdir}/%{jredir}/lib/security/trusted.libraries
%ghost %{_jvmdir}/%{jredir}/lib/security/local_policy.jar
%ghost %{_jvmdir}/%{jredir}/lib/security/US_export_policy.jar
%{_jvmdir}/%{jrelnk}
%{_jvmjardir}/%{jrelnk}
%dir %{_jvmprivdir}/%{name}
%dir %{_jvmprivdir}/%{name}/jce
%dir %{_jvmprivdir}/%{name}/jce/vanilla
%config(noreplace) %{_jvmprivdir}/%{name}/jce/vanilla/*_policy.jar
%{_mandir}/man1/java-%{name}.1*
%{_mandir}/man1/keytool-%{name}.1*
%{_mandir}/man1/orbd-%{name}.1*
%{_mandir}/man1/policytool-%{name}.1*
%{_mandir}/man1/rmid-%{name}.1*
%{_mandir}/man1/rmiregistry-%{name}.1*
%{_mandir}/man1/servertool-%{name}.1*
%{_mandir}/man1/tnameserv-%{name}.1*
%{_mandir}/man1/javaws-%{name}.1*
%{_mandir}/man1/jhat-%{name}.1.gz
%{_mandir}/man1/jcmd-%{name}.1.gz
%{_mandir}/man1/jrunscript-%{name}.1.gz
%{_mandir}/man1/javafxpackager-%{name}.1.gz
%{_mandir}/man1/schemagen-%{name}.1.gz
%{_mandir}/man1/wsgen-%{name}.1.gz
%{_mandir}/man1/wsimport-%{name}.1.gz
%{_mandir}/man1/xjc-%{name}.1.gz
#%{_mandir}/man1/kinit-%{name}.1*
#%{_mandir}/man1/klist-%{name}.1*
#%{_mandir}/man1/ktab-%{name}.1*
%{_jvmdir}/%{jredir}/.systemPrefs

%files devel
%defattr(-,root,root,-)
%doc COPYRIGHT LICENSE README.html
%dir %{_jvmdir}/%{sdkdir}/bin
%dir %{_jvmdir}/%{sdkdir}/include
%dir %{_jvmdir}/%{sdkdir}/lib
%{_jvmdir}/%{sdkdir}/bin/*
%{_jvmdir}/%{sdkdir}/include/*
%{_jvmdir}/%{sdkdir}/lib/*
%{_jvmdir}/%{sdklnk}
%{_jvmjardir}/%{sdklnk}
%{_mandir}/man1/appletviewer-%{name}.1*
%{_mandir}/man1/extcheck-%{name}.1*
%{_mandir}/man1/idlj-%{name}.1*
%{_mandir}/man1/jar-%{name}.1*
%{_mandir}/man1/jarsigner-%{name}.1*
%{_mandir}/man1/javac-%{name}.1*
%{_mandir}/man1/javadoc-%{name}.1*
%{_mandir}/man1/javah-%{name}.1*
%{_mandir}/man1/javap-%{name}.1*
%{_mandir}/man1/jdb-%{name}.1*
%{_mandir}/man1/native2ascii-%{name}.1*
%{_mandir}/man1/rmic-%{name}.1*
%{_mandir}/man1/serialver-%{name}.1*
%{_mandir}/man1/jconsole-%{name}.1*
%{_mandir}/man1/pack200-%{name}.1*
%{_mandir}/man1/unpack200-%{name}.1*
%{_mandir}/man1/apt-%{name}.1*
%{_mandir}/man1/jinfo-%{name}.1*
%{_mandir}/man1/jmap-%{name}.1*
%{_mandir}/man1/jps-%{name}.1*
%{_mandir}/man1/jsadebugd-%{name}.1*
%{_mandir}/man1/jstack-%{name}.1*
%{_mandir}/man1/jstat-%{name}.1*
%{_mandir}/man1/jstatd-%{name}.1*
%{_mandir}/man1/jvisualvm-%{name}.1*
%{_mandir}/man1/jmc-%{name}.1*
%ifarch %ix86
#%{cgibindir}/java-rmi-%{version}.cgi
%endif

%files src
%defattr(-,root,root,-)
%{_jvmdir}/%{sdkdir}/src.zip

%files alsa -f %{name}-%{version}-alsa.files
%defattr(-,root,root,-)

%files jdbc -f %{name}-%{version}-jdbc.files
%defattr(-,root,root,-)

%files plugin -f %{name}-%{version}-plugin.files
%defattr(-,root,root,-)
%{_datadir}/applications/jpackage-%{name}-ControlPanel.desktop
%{pluginpath}/%{pluginname}

%changelog
< Previous Next >