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.
 
 
 
 
 
 

168 lines
5.9 KiB

##
## java-jdk18.spec -- OpenPKG RPM Package Specification
## Copyright (c) 2000-2022 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.8.0.172
%define V_openpkg 1.8.0.172
%define V_subdir 8u172-b11
%define V_sundist 8u172
%define V_sunfsys 1.8.0_172
%define V_sunsupp 8
%define V_jdk java-jdk18
%define V_jce JDK8
# package information
Name: java-jdk18
Summary: Java Development Kit (JDK) Standard Edition
URL: https://www.oracle.com/java/
Vendor: ORACLE
Packager: OpenPKG Project
Distribution: OpenPKG Community
Class: EVAL
Group: Language
License: Commercial
Version: %{V_openpkg}
Release: 20180615
# package options
%option with_jce yes
# list of sources
Source0: http://download.oracle.com/otn-pub/java/jdk/%{V_subdir}/jdk-%{V_sundist}-linux-i586.tar.gz
Source1: http://download.oracle.com/otn-pub/java/jdk/%{V_subdir}/jdk-%{V_sundist}-linux-x64.tar.gz
Source2: http://download.oracle.com/otn-pub/java/jce/%{V_sunsupp}/UnlimitedJCEPolicyJDK%{V_sunsupp}.zip
%NoSource 0
%NoSource 1
%NoSource 2
# build information
Prefix: %{l_prefix}
BuildRoot: %{l_buildroot}
BuildPreReq: OpenPKG, openpkg >= 20160101
PreReq: OpenPKG, openpkg >= 20160101
PreReq: java
%if "%{with_jce}" == "yes"
BuildPreReq: infozip
%endif
Provides: JAVA-JDK
%description
The ORACLE 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
%prep
%setup -q -c %{V_jdk} -T
%build
%install
# select vendor source
pkgfile=""
cryptfile="%{SOURCE UnlimitedJCEPolicyJDK%{V_sunsupp}.zip}"
pkgdir="%{V_sunfsys}"
case "%{l_platform -t}" in
i?86-linux2.[2-6]* | i?86-linux3.* )
pkgfile="%{SOURCE jdk-%{V_sundist}-linux-i586.tar.gz}"
pkgdir="jdk%{V_sunfsys}"
;;
amd64-linux2.[2-6]* | amd64-linux3.* )
pkgfile="%{SOURCE jdk-%{V_sundist}-linux-x64.tar.gz}"
pkgdir="jdk%{V_sunfsys}"
;;
esac
if [ ".$pkgfile" = . ]; 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/%{V_jdk} \
$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/%{V_jdk}
%{l_gzip} -d -c $pkgfile | %{l_tar} xf -
if [ $? != 0 ]; then
echo "ERROR: unpacking failed" 1>&2
exit 1
fi
mv $pkgdir/* %{V_jdk}/
rmdir $pkgdir
) || exit $?
# fix vendor distribution
( cd $RPM_BUILD_ROOT%{l_prefix}/libexec/%{V_jdk}/bin
find . -type f -print | xargs chmod u+w
cd $RPM_BUILD_ROOT%{l_prefix}/libexec/%{V_jdk}/jre/bin
find . -type f -print | xargs chmod u+w
) || exit $?
# 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 UnlimitedJCEPolicy%{V_jce}/README.txt $RPM_BUILD_ROOT%{l_prefix}/libexec/%{V_jdk}/README-JCE.txt
cp -f UnlimitedJCEPolicy%{V_jce}/US_export_policy.jar $RPM_BUILD_ROOT%{l_prefix}/libexec/%{V_jdk}/jre/lib/security/
cp -f UnlimitedJCEPolicy%{V_jce}/local_policy.jar $RPM_BUILD_ROOT%{l_prefix}/libexec/%{V_jdk}/jre/lib/security/
%endif
# remember particular toolkit platform identification
echo "sun-jdk-%{V_base}" >$RPM_BUILD_ROOT%{l_prefix}/libexec/%{V_jdk}/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/%{V_jdk}/PLATFORM 2>/dev/null`
if [ ".$platform" != . ]; then
$RPM_INSTALL_PREFIX/bin/java-toolkit --register="$platform:$RPM_INSTALL_PREFIX/libexec/%{V_jdk}"
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/%{V_jdk}/PLATFORM 2>/dev/null`
if [ ".$platform" != . ]; then
$RPM_INSTALL_PREFIX/bin/java-toolkit --unregister="$platform"
fi