Репозиторий ALT Linux backports/2.4
Последнее обновление: 9 июля 2008 | Пакетов: 497 | Посещений: 1587699
 поиск   регистрация   авторизация 
 
Группа :: Система/Основа
Пакет: j2se1.5-sun

 Главная   Изменения   Спек   Патчи   Загрузить   Bugs and FR 

%define major 1.5
%define minor 0
%define build 08
%define distversion 1_5_0_%build
%define arch i586
%define origin sun
%define priority 150

%define jdkver %major.%minor
%define label %major-%origin

Name: j2se%label
Version: %{jdkver}_%{build}
Release: alt0.M24.1

%def_enable fonts
%def_disable ns4_plugin
%def_with gcc32_abi

Packager: Mikhail Zabaluev <mhz at altlinux.ru>

Summary: Java 2 Runtime Environment, Standard Edition
Group: System/Base
License: Sun Binary Code License
URL: http://java.sun.com/j2se/%jdkver

%define distname    jdk-%distversion-linux-%arch.bin
%define java_home   %_libdir/j2se%label
%define libarch    i386
%define fontdir     %_datadir/fonts/j2se-%origin

%if_with gcc32_abi
%define mozplugindir %java_home/jre/plugin/%libarch/ns7
%else
%define mozplugindir %java_home/jre/plugin/%libarch/ns7-gcc29
%endif

# TODO:

# - replace font.properties with font.properties.Redhat6.1
#   (or our customization)?
# - run chkfontpath on font installation?

Provides: j2se = %jdkver
Provides: jre = %jdkver, java2 = %jdkver
Provides: libjava.so(SUNWprivate_1.1)
Provides: libjvm.so(SUNWprivate_1.1)
Provides: libnet.so(SUNWprivate_1.1)
Provides: libverify.so(SUNWprivate_1.1)

Requires: j2se-%origin-fonts >= %version-%release
Requires: java-common
PreReq: alternatives >= 0.1.0-alt2

Obsoletes: %name-fonts

Source0: %distname

BuildArch: %arch

BuildConflicts: jdk-sun j2sdk-sun

BuildPreReq: libalternatives-devel

%add_findprov_lib_path %java_home/jre/lib/%libarch
%add_findprov_lib_path %java_home/jre/lib/%libarch/client
%add_findprov_lib_path %java_home/jre/lib/%libarch/server
%add_findprov_lib_path %java_home/jre/lib/%libarch/native_threads
%add_findprov_lib_path %java_home/jre/lib/%libarch/headless
%add_findprov_lib_path %java_home/jre/lib/%libarch/motif21
%add_findprov_lib_path %java_home/jre/lib/%libarch/xawt

%define _compress_method gzip

%define _verify_elf_method textrel=relaxed,rpath=relaxed

%package devel
Summary: Java 2 SDK, Standard Edition
Group: Development/Java
Provides: j2se-devel = %jdkver
Provides: jdk = %jdkver, j2sdk = %jdkver
Requires: %name = %version-%release
PreReq: alternatives >= 0.1.0-alt2
Obsoletes: jdk-sun j2sdk-sun

%package source
Summary: Source files for the Java 2 SDK
Group: Development/Java

%package demo
Summary: Demo applets and programs for the Java 2 SDK
Group: Development/Java

%package plugin-mozilla
Summary: Java Plug-In for Mozilla and Netscape 6
Group: Networking/WWW
Provides: java2-plugin-mozilla = %jdkver
Requires: %name = %version-%release
#Requires: browser-plugins-npapi
PreReq: alternatives >= 0.1.0-alt2

%if_enabled ns4_plugin
%package plugin-netscape4
Summary: Java Plug-In for Netscape 4.x
Group: Networking/WWW
Provides: java2-plugin-netscape4 = %jdkver
Requires: %name = %version-%release
Requires: netscape-common
PreReq: alternatives >= 0.1.0-alt2
%endif

%package jdbc
Summary: Native library for JDBC support in Java
Group: Development/Databases
Provides: j2se-jdbc = %jdkver
Requires: %name = %version-%release

%package javaws
Summary: Java Web Start
Group: Networking/Other
Provides: javaws = %jdkver
Requires: %name = %version-%release
PreReq: alternatives >= 0.1.0-alt2

%if_enabled fonts
%package -n j2se-%origin-fonts
Summary: TrueType fonts for Java 2 Standard Edition
Group: System/Fonts/True type
PreReq: fontconfig
Provides: java_sun-fonts = %version-%release
%endif # enabled fonts

%description
The Java 2 Runtime Environment contains the Java virtual machine,
runtime class libraries, and Java application launcher that are
necessary to run programs written in the Java programming language.
It is not a development environment and does not contain development
tools such as compilers or debuggers.  For development tools, see the
Java 2 SDK, Standard Edition.

This package contains J2SE Runtime Environment created by Sun Microsystems.
Install this package if you need to run Java applications.

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

The Java 2 SDK includes tools useful for developing and testing programs
written in the Java programming language and running on the Java platform.

This package contains J2SE SDK created by Sun Microsystems.
Install this package if you need to develop and build Java applications.

%description source
Java programming language source files for all classes that make up
the Java 2 core API.

%description demo
Examples, with source code, of programming for the Java platform. These include
examples that use Swing and other Java Foundation Classes, and the Java
Platform Debugger Architecture.

%description plugin-mozilla
This package contains Java(TM) 2 Plug-In for Mozilla and Netsape 6/7
web browsers.

%if_enabled ns4_plugin
%description plugin-netscape4
This package contains Java(TM) 2 Plug-In for Netsape 4.x web browser.
%endif

%description jdbc
This package contains a native dynamic library that provides JDBC support
for the Java platform via the ODBC interface. This library is a part of
the Sun J2SE bundle.

%description javaws
Java Web Start is a deployment solution for Java-technology-based
applications. It is the plumbing between the computer and the Internet
that allows the user to launch and manage applications right off the
Web. Java Web Start provides easy, one-click activation of
applications, and guarantees that you are always running the latest
version of the application, eliminating complicated installation or
upgrade procedures.

This package provides the Java Web Start installation that is bundled
with J2SE Runtime Environment by Sun Microsystems.

%if_enabled fonts
%description -n j2se-%origin-fonts
This package contains the TrueType fonts distributed with
Sun Java 2 Standard Edition.
%endif # enabled fonts

%prep
MORE=10000 sh %SOURCE0 <<EOF
yes
EOF
%setup -T -D -n jdk%version
# fix perms
chmod -R u+w *

echo j2se >j2se-buildreq-substitute
echo j2se-devel >j2se-devel-buildreq-substitute

cat >README.alt <<EOF
The Java 2 Runtime Environment and SDK, Standard Edition are distributed
within this and related packages as shown below:

%name - Java 2 Runtime Environment, Standard Edition
 (with notable omissions listed below).
%name-devel - Java 2 SDK, Standard Edition.
%name-source - Java 2 Standard Edition API source files.
%name-demo - Java 2 SDK demo applets and programs.
%name-jdbc - JDBC provider library using ODBC.
 This library was excluded from the
 %name package due to outstanding dependencies.
%name-javaws - Java Web Start software that is bundled with
 Java 2 Runtime Environment, Standard Edition
%name-plugin-mozilla - Java 2 plug-in for Mozilla and Netscape 6/7.
%name-plugin-netscape4 - Java 2 plug-in for Netscape 4.x (optional).
j2se-%origin-fonts - The TrueType fonts in %fontdir,
 shared between various installations of
 the Java 2 Runtime Environment.

See the README, LICENSE, COPYRIGHT, and THIRDPARTYLICENSEREADME.txt files
for copyright information, terms of use and redistribution covering contents
of these packages.
EOF

%if_enabled fonts
cat >jre/lib/fonts/README.alt <<EOF
The fonts contained in this package are part of the
Java 2 Runtime Environment, Standard Edition (J2SE).
This package is required by packages containing various versions
of J2SE.

See the LICENSE, COPYRIGHT, and THIRDPARTYLICENSEREADME.txt files
for copyright information, terms of use and redistribution covering contents
of this package.
EOF
%endif # enabled fonts

%install
# Main files
install -d -m755 $RPM_BUILD_ROOT%java_home
cp -a bin include lib $RPM_BUILD_ROOT%java_home
install -d -m755 $RPM_BUILD_ROOT%java_home/jre
cp -a jre/{bin,javaws,lib,plugin} $RPM_BUILD_ROOT%java_home/jre

# Install profile scripts

cat >$RPM_BUILD_ROOT%java_home/j2se.sh <<EOF
JAVA_HOME=%java_home
export JAVA_HOME
EOF
chmod 755 $RPM_BUILD_ROOT%java_home/j2se.sh
cat >$RPM_BUILD_ROOT%java_home/j2se.csh <<EOF
setenv JAVA_HOME %java_home
EOF
chmod 755 $RPM_BUILD_ROOT%java_home/j2se.csh

# Demo and sources

install -d -m755 $RPM_BUILD_ROOT%_datadir/%name
cp -a demo $RPM_BUILD_ROOT%_datadir/%name
install -m644 src.zip $RPM_BUILD_ROOT%_datadir/%name

%if_enabled fonts
# Move the fonts into a shared fonts directory
install -d -m755 $RPM_BUILD_ROOT%fontdir
mv $RPM_BUILD_ROOT%java_home/jre/lib/fonts/* $RPM_BUILD_ROOT%fontdir
rmdir $RPM_BUILD_ROOT%java_home/jre/lib/fonts
%else # disabled fonts
rm -rf $RPM_BUILD_ROOT%java_home/jre/lib/fonts
%endif # enabled fonts
ln -s %fontdir $RPM_BUILD_ROOT%java_home/jre/lib/fonts

# Move and label the manpages

mkdir -p $RPM_BUILD_ROOT%_man1dir
for f in man/man1/*; do
   install -p -m644 $f $RPM_BUILD_ROOT%_man1dir/$(basename $f .1)%label.1
done

# Install substitute rules for buildreq

mkdir -p $RPM_BUILD_ROOT%_sysconfdir/buildreqs/packages/substitute.d
install -m644 j2se-buildreq-substitute \
   $RPM_BUILD_ROOT%_sysconfdir/buildreqs/packages/substitute.d/%name
install -m644 j2se-devel-buildreq-substitute \
   $RPM_BUILD_ROOT%_sysconfdir/buildreqs/packages/substitute.d/%name-devel

# Create list of libraries that go into the main package

find $RPM_BUILD_ROOT%java_home/jre/lib/%libarch -type d -print |\
   sed -e "s|^$RPM_BUILD_ROOT|%dir |" >libs.list
find $RPM_BUILD_ROOT%java_home/jre/lib/%libarch ! -type d \
\( -perm -a+x -o -name '*.so' \) \
! -name libJdbcOdbc.so -print |\
   sed -e "s|^$RPM_BUILD_ROOT||" >>libs.list

#JAVAC alternative

%__install -d $RPM_BUILD_ROOT%_altdir
%__cat <<EOF>%buildroot%_altdir/%name-javac
<group name="candidate">
   <option name="link">%_bindir/javac</option>
   <option name="real">%java_home/bin/javac</option>
   <option name="weight" type="number">%priority</option>
EOF
#library dir and manual
%__cat <<EOF>>%buildroot%_altdir/%name-javac
   <group name="slave">
<option name="link">%_libdir/jdk</option>
<option name="real">%java_home</option>
   </group>
   <group name="slave">
<option name="link">%_man1dir/javac.1.gz</option>
<option name="real">%_man1dir/javac%{label}.1.gz</option>
   </group>
EOF
#binaries and manuals
for i in  appletviewer extcheck idlj jar jarsigner javadoc javah javap jdb native2ascii rmic serialver
do
%__cat <<EOF>>%buildroot%_altdir/%name-javac
   <group name="slave">
<option name="link">%_bindir/$i</option>
<option name="real">%java_home/bin/$i</option>
   </group>
   <group name="slave">
<option name="link">%_man1dir/$i.1.gz</option>
<option name="real">%_man1dir/${i}%{label}.1.gz</option>
   </group>
EOF
done
#profiles
for i in j2se.sh j2se.csh
do
%__cat <<EOF>>%buildroot%_altdir/%name-javac
   <group name="slave">
<option name="link">%_sysconfdir/profile.d/$i</option>
<option name="real">%java_home/$i</option>
   </group>
EOF
done
echo "</group>">>%buildroot%_altdir/%name-javac

#J2SE alternative

%__cat <<EOF>%buildroot%_altdir/%name-j2se
<group name="candidate">
   <option name="link">%_libdir/j2se</option>
   <option name="real">%java_home</option>
   <option name="weight" type="number">%priority</option>
   <group name="slave">
<option name="link">%_man1dir/java.1.gz</option>
<option name="real">%_man1dir/java%{label}.1.gz</option>
   </group>
EOF
#bins
for i in  keytool policytool servertool
do
%__cat <<EOF>>%buildroot%_altdir/%name-j2se
   <group name="slave">
<option name="link">%_bindir/$i</option>
<option name="real">%java_home/jre/bin/$i</option>
   </group>
   <group name="slave">
<option name="link">%_man1dir/$i.1.gz</option>
<option name="real">%_man1dir/${i}%{label}.1.gz</option>
   </group>
EOF
done
#sbins
for i in  orbd rmid rmiregistry tnameserv
do
%__cat <<EOF>>%buildroot%_altdir/%name-j2se
   <group name="slave">
<option name="link">%_sbindir/$i</option>
<option name="real">%java_home/jre/bin/$i</option>
   </group>
   <group name="slave">
<option name="link">%_man1dir/$i.1.gz</option>
<option name="real">%_man1dir/${i}%{label}.1.gz</option>
   </group>
EOF
done
echo "</group>">>%buildroot%_altdir/%name-j2se

#MOZILLA PLUGIN

%__cat <<EOF>%buildroot%_altdir/%name-mozilla
<group name="candidate">
   <option name="link">%_libdir/mozilla/plugins/libjavaplugin_oji.so</option>
   <option name="real">%mozplugindir/libjavaplugin_oji.so</option>
   <option name="weight" type="number">%priority</option>
</group>
EOF

#NS4 PLUGIN

%__cat <<EOF>%buildroot%_altdir/%name-ns4
<group name="candidate">
   <option name="link">%_libdir/netscape/plugins/javaplugin.so</option>
   <option name="real">%java_home/jre/plugin/%libarch/ns4/javaplugin.so</option>
   <option name="weight" type="number">%priority</option>
</group>
EOF

#JAVAWS

%__cat <<EOF>%buildroot%_altdir/%name-javaws
<group name="candidate">
   <option name="link">%_bindir/javaws</option>
   <option name="real">%java_home/jre/javaws/javaws-%_vendor</option>
   <option name="weight" type="number">%priority</option>
</group>
EOF

%post
%register_alternatives %name-j2se

%pre
[ -L %java_home/jre/lib/fonts ] || %__rm -rf %java_home/jre/lib/fonts

%preun
%unregister_alternatives %name-j2se

%post devel
%register_alternatives %name-javac

%preun devel
%unregister_alternatives %name-javac

%post plugin-mozilla
if [ -d %_libdir/mozilla/plugins ]; then
%register_alternatives %name-mozilla
fi

%preun plugin-mozilla
%unregister_alternatives %name-mozilla

%if_enabled ns4_plugin
%post plugin-netscape4
if [ -d %_libdir/netscape/plugins ]; then
%register_alternatives %name-ns4
fi

%preun plugin-netscape4
%unregister_alternatives %name-ns4
%endif

%post javaws
%register_alternatives %name-javaws

%preun javaws
%unregister_alternatives %name-javaws

%if_enabled fonts
%post -n j2se-%origin-fonts
%_bindir/fc-cache %fontdir

%triggerpostun -n j2se-%origin-fonts -- j2se1.3-sun-fonts j2se1.4-sun-fonts j2se1.4-blackdown-fonts
# Recreate the cache removed by the font uninstall scripts
%_bindir/fc-cache %fontdir

%preun -n j2se-%origin-fonts
if [ $1 = 0 ]; then
   %__rm -f %fontdir/fonts.cache*
fi
%endif # enabled fonts

%files -f libs.list
%doc jre/CHANGES jre/COPYRIGHT jre/LICENSE jre/README jre/Welcome.html
%doc jre/THIRDPARTYLICENSEREADME.txt
%doc README.alt
%_sysconfdir/buildreqs/packages/substitute.d/%name
%_altdir/%name-j2se
%dir %java_home
%dir %java_home/jre
%dir %java_home/jre/plugin
%dir %java_home/jre/plugin/%libarch
%dir %java_home/jre/lib
%dir %java_home/jre/lib/security
%dir %_datadir/%name
%java_home/jre/bin
%java_home/jre/lib/*.jar
%java_home/jre/lib/*.txt
%java_home/jre/lib/applet
%java_home/jre/lib/audio
%java_home/jre/lib/cmm
%java_home/jre/lib/ext
%java_home/jre/lib/fonts
%java_home/jre/lib/im
%java_home/jre/lib/images
%java_home/jre/lib/locale
%java_home/jre/lib/zi
%java_home/jre/lib/classlist
%java_home/jre/lib/i386/client/classes.jsa
%java_home/jre/lib/management/*
%java_home/jre/plugin/desktop/sun_java.desktop
%java_home/jre/plugin/desktop/sun_java.png
%config(noreplace) %java_home/jre/lib/*.properties
%config(noreplace) %java_home/jre/lib/*.properties.??
%config(noreplace) %java_home/jre/lib/%libarch/jvm.cfg
%config(noreplace) %java_home/jre/lib/security/cacerts
%config(noreplace) %java_home/jre/lib/security/java.policy
%config(noreplace) %java_home/jre/lib/security/java.security
%java_home/jre/lib/fontconfig.*
%doc %java_home/jre/lib/%libarch/*/Xusage.txt
%java_home/jre/lib/security/*.jar
%_man1dir/java%label.1*
%_man1dir/keytool%label.1*
%_man1dir/kinit%label.1*
%_man1dir/klist%label.1*
%_man1dir/ktab%label.1*
%_man1dir/orbd%label.1*
%_man1dir/policytool%label.1*
%_man1dir/rmid%label.1*
%_man1dir/rmiregistry%label.1*
%_man1dir/servertool%label.1*
%_man1dir/tnameserv%label.1*


%files devel
%doc *README* LICENSE COPYRIGHT
%_sysconfdir/buildreqs/packages/substitute.d/%name-devel
%_altdir/%name-javac
%config %java_home/j2se.*sh
%java_home/bin
%java_home/lib
%java_home/include
%_man1dir/appletviewer%label.1*
%_man1dir/extcheck%label.1*
%_man1dir/idlj%label.1*
%_man1dir/jar%label.1*
%_man1dir/jarsigner%label.1*
%_man1dir/javac%label.1*
%_man1dir/javadoc%label.1*
%_man1dir/javah%label.1*
%_man1dir/javap%label.1*
%_man1dir/jdb%label.1*
%_man1dir/native2ascii%label.1*
%_man1dir/rmic%label.1*
%_man1dir/serialver%label.1*
%_man1dir/apt%label.1*
%_man1dir/jinfo%label.1*
%_man1dir/jmap%label.1*
%_man1dir/jps%label.1*
%_man1dir/jsadebugd%label.1*
%_man1dir/jstack%label.1*
%_man1dir/jstat%label.1*
%_man1dir/jstatd%label.1*
%_man1dir/pack200%label.1*
%_man1dir/unpack200%label.1*


%files source
%_datadir/%name/src.zip

%files demo
%_datadir/%name/demo

%files plugin-mozilla
%_altdir/%name-mozilla
%mozplugindir

%if_enabled ns4_plugin
%files plugin-netscape4
%_altdir/%name-ns4
%java_home/jre/plugin/%libarch/ns4
%endif

%files jdbc
%java_home/jre/lib/%libarch/libJdbcOdbc.so

%files javaws
%doc README.alt
%_altdir/%name-javaws
%dir %java_home/jre/javaws
%java_home/jre/javaws/javaws
%java_home/jre/lib/javaws/*
%java_home/jre/lib/security/javaws.policy
%_man1dir/javaws%label.1*

%if_enabled fonts
%files -n j2se-%origin-fonts
%doc LICENSE COPYRIGHT THIRDPARTYLICENSEREADME.txt
%doc jre/lib/fonts/README.alt
%dir %fontdir
%config %fontdir/fonts.dir
%fontdir/*.ttf
%endif # enabled fonts

%changelog

Полный changelog можно просмотреть здесь

 
design & coding: Vladimir Lettiev aka crux © 2004-2005