You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

257 lines
9.4 KiB

##
## java-jdk16.spec -- OpenPKG RPM Package Specification
## Copyright (c) 2000-2018 OpenPKG Project <http://openpkg.org/>
##
## Permission to use, copy, modify, and distribute this software for
## any purpose with or without fee is hereby granted, provided that
## the above copyright notice and this permission notice appear in all
## copies.
##
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
## SUCH DAMAGE.
##
# package versions
%define V_base 1.6.0
%define V_openpkg 1.6.0.17
%define V_sundist 6u17
%define V_sunfsys 1.6.0_17
%define V_sunsupp 6
# package information
Name: java-jdk16
Summary: Java Development Kit (JDK) Standard Edition
URL: http://java.sun.com/javase/
Vendor: Sun Microsystems, Inc.
Packager: OpenPKG Project
Distribution: OpenPKG Community
Class: EVAL
Group: Language
License: Commercial
Version: %{V_openpkg}
Release: 20100111
# package options
%option with_demo no
%option with_docs no
%option with_jce no
# list of sources
Source0: http://java.sun.com/javase/::/jdk-%{V_sundist}-linux-i586.bin
Source1: http://java.sun.com/javase/::/jdk-%{V_sundist}-linux-x64.bin
Source2: http://java.sun.com/javase/::/jdk-%{V_sundist}-solaris-sparc.sh
Source3: http://java.sun.com/javase/::/jdk-%{V_sundist}-solaris-sparcv9.sh
Source4: http://java.sun.com/javase/::/jdk-%{V_sundist}-solaris-i586.sh
Source5: http://java.sun.com/javase/::/jdk-%{V_sundist}-solaris-x64.sh
Source6: http://java.sun.com/javase/::/jdk-%{V_sunsupp}-doc.zip
Source7: http://java.sun.com/javase/::/jce_policy-%{V_sunsupp}.zip
%NoSource 0
%NoSource 1
%NoSource 2
%NoSource 3
%NoSource 4
%NoSource 5
%NoSource 6
%NoSource 7
# build information
BuildPreReq: OpenPKG, openpkg >= 20160101
PreReq: OpenPKG, openpkg >= 20160101
PreReq: java
%if "%{with_docs}" == "yes" || "%{with_jce}" == "yes"
BuildPreReq: infozip
%endif
Provides: JAVA-JDK
%description
The Sun Java Standard Edition contains both the Java Development
Kit (JDK) and Java Runtime Environment (JRE). The premier solution
for rapidly developing and deploying mission-critical, enterprise
applications, JDK provides the essential compiler, tools,
runtimes, and APIs for writing, deploying, and running applets and
applications in the Java programming language.
%track
prog java-jdk16 = {
version = %{V_sundist}
url = http://java.sun.com/javase/downloads/index.jsp
regex = jre-(__VER__)-
}
%prep
%setup -q -c java-jdk16 -T
%build
%install
# select vendor source
pkgfile1=""
pkgfile2=""
docsfile="%{SOURCE jdk-%{V_sunsupp}-doc.zip}"
cryptfile="%{SOURCE jce_policy-%{V_sunsupp}.zip}"
pkgdir="%{V_sunfsys}"
case "%{l_platform -t}" in
i?86-linux2.[2-6]* | i?86-freebsd[5-8]* )
pkgfile1="%{SOURCE jdk-%{V_sundist}-linux-i586.bin}"
pkgdir="jdk%{V_sunfsys}"
;;
amd64-linux2.[2-6]* | amd64-freebsd[5-8]* )
pkgfile1="%{SOURCE jdk-%{V_sundist}-linux-i586.bin}"
pkgfile2="%{SOURCE jdk-%{V_sundist}-linux-x64.bin}"
pkgdir="jdk%{V_sunfsys}"
;;
sun4u-sunos5.[6-9]* | sun4[uv]-sunos5.10 )
pkgfile1="%{SOURCE jdk-%{V_sundist}-solaris-sparc.sh}"
pkgfile2="%{SOURCE jdk-%{V_sundist}-solaris-sparcv9.sh}"
pkgdir="jdk%{V_sunfsys}"
;;
i?86-sunos5.[6-9]* | i?86-sunos5.10 )
pkgfile1="%{SOURCE jdk-%{V_sundist}-solaris-i586.sh}"
pkgdir="jdk%{V_sunfsys}"
;;
amd64-sunos5.[6-9]* | amd64-sunos5.10 )
pkgfile1="%{SOURCE jdk-%{V_sundist}-solaris-i586.sh}"
pkgfile2="%{SOURCE jdk-%{V_sundist}-solaris-x64.sh}"
pkgdir="jdk%{V_sunfsys}"
;;
esac
if [ ".$pkgfile1" = . ]; then
echo "Sorry, unsupported architecture '%{l_platform -t}'" 1>&2
exit 1
fi
# create installation tree
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/bin \
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
$RPM_BUILD_ROOT%{l_prefix}/libexec/java-jdk16 \
$RPM_BUILD_ROOT%{l_prefix}/man/man1
# unpack vendor distribution
( umask 022
cd $RPM_BUILD_ROOT%{l_prefix}/libexec
HOME=$RPM_BUILD_ROOT%{l_prefix}/libexec/java-jdk16
case "%{l_platform -t}" in
i?86-linux2.[2-6]* | i?86-freebsd[5-8]* )
echo "yes" | sh $pkgfile1 >COPYING.32
;;
amd64-linux2.[2-6]* | amd64-freebsd[5-8]* )
echo "yes" | sh $pkgfile1 >COPYING.32
echo "yes" | sh $pkgfile2 >COPYING.64
;;
sun4u-sunos5.[6-9]* | sun4[uv]-sunos5.10 )
echo "yes" | sh $pkgfile1 >COPYING.32 && \
echo "yes" | sh $pkgfile2 >COPYING.64
;;
i?86-sunos5.[6-9]* | i?86-sunos5.10 )
echo "yes" | sh $pkgfile1 >COPYING.32
;;
amd64-sunos5.[6-9]* | amd64-sunos5.10 )
echo "yes" | sh $pkgfile1 >COPYING.32
echo "yes" | sh $pkgfile2 >COPYING.64
;;
* ) false
;;
esac
if [ $? != 0 ]; then
echo "ERROR: unpacking failed" 1>&2
exit 1
fi
mv $pkgdir/* java-jdk16/
mv COPYING.* java-jdk16/
rmdir $pkgdir
) || exit $?
# fix vendor distribution
( cd $RPM_BUILD_ROOT%{l_prefix}/libexec/java-jdk16/bin
find . -type f -print | xargs chmod u+w
cd $RPM_BUILD_ROOT%{l_prefix}/libexec/java-jdk16/jre/bin
find . -type f -print | xargs chmod u+w
case "%{l_platform -t}" in
sun4u-sunos5.[6-9]* | sun4[uv]-sunos5.10 )
cd $RPM_BUILD_ROOT%{l_prefix}/libexec/java-jdk16/bin/sparcv9
find . -type f -print | xargs chmod u+w
cd $RPM_BUILD_ROOT%{l_prefix}/libexec/java-jdk16/jre/bin/sparcv9
find . -type f -print | xargs chmod u+w
;;
esac
) || exit $?
# remove GNOME and other irrelevant files
rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/java-jdk16/.gnome
rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/java-jdk16/.icons
# conditionally remove demo
%if "%{with_demo}" == "no"
rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/java-jdk16/demo 2>/dev/null || true
rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/java-jdk16/sample 2>/dev/null || true
%endif
# conditionally install docs
%if "%{with_docs}" == "yes"
unzip -q $docsfile
mv docs $RPM_BUILD_ROOT%{l_prefix}/libexec/java-jdk16/
%endif
# install Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy
# under confirmation of the US Export Administration Regulations (EAR)
%if "%{with_jce}" == "yes"
unzip -q $cryptfile
cp jce/COPYRIGHT.html $RPM_BUILD_ROOT%{l_prefix}/libexec/java-jdk16/JCE_COPYRIGHT.html
cp jce/README.txt $RPM_BUILD_ROOT%{l_prefix}/libexec/java-jdk16/JCE_README.txt
cp -f jce/US_export_policy.jar $RPM_BUILD_ROOT%{l_prefix}/libexec/java-jdk16/jre/lib/security/
cp -f jce/local_policy.jar $RPM_BUILD_ROOT%{l_prefix}/libexec/java-jdk16/jre/lib/security/
%endif
# optionally brand ELF binaries (FreeBSD only)
case "%{l_platform -t}" in
*-freebsd[5-8]* )
brandelf -t Linux \
`find $RPM_BUILD_ROOT%{l_prefix}/libexec/java-jdk16/bin/ -type f -print` \
>/dev/null 2>&1 || true
brandelf -t Linux \
`find $RPM_BUILD_ROOT%{l_prefix}/libexec/java-jdk16/jre/bin/ -type f -print` \
>/dev/null 2>&1 || true
;;
esac
# remember particular toolkit platform identification
echo "sun-jdk-%{V_base}" >$RPM_BUILD_ROOT%{l_prefix}/libexec/java-jdk16/PLATFORM
# determine installation files
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
%files -f files
%clean
%post
# unconditionally (re)register
platform=`cat $RPM_INSTALL_PREFIX/libexec/java-jdk16/PLATFORM 2>/dev/null`
if [ ".$platform" != . ]; then
$RPM_INSTALL_PREFIX/bin/java-toolkit --register="$platform:$RPM_INSTALL_PREFIX/libexec/java-jdk16"
fi
# optionally activate if we are the only toolkit
if [ ".`$RPM_INSTALL_PREFIX/bin/java-toolkit --list | wc -l | awk '{ print $1; }'`" = .1 ]; then
$RPM_INSTALL_PREFIX/bin/java-toolkit --activate="$platform"
fi
%preun
# unconditionally unregister
platform=`cat $RPM_INSTALL_PREFIX/libexec/java-jdk16/PLATFORM 2>/dev/null`
if [ ".$platform" != . ]; then
$RPM_INSTALL_PREFIX/bin/java-toolkit --unregister="$platform"
fi