openjdk-guncellendi

This commit is contained in:
milisbir 2018-11-25 20:45:42 +02:00
parent 7ef67bcfce
commit 05f6850dc4
2 changed files with 106 additions and 47 deletions

View File

@ -1,15 +1,5 @@
. /lib/lsb/init-functions
if (grep jdk /etc/man_db.conf > /dev/null); then
cat >> /etc/man_db.conf << "EOF"
# Begin Java addition
MANDATORY_MANPATH /opt/jdk/man
MANPATH_MAP /opt/jdk/bin /opt/jdk/man
MANDB_MAP /opt/jdk/man /var/cache/man/jdk
# End Java addition
EOF
log_warning_msg "${WARNING}Check the /etc/man_db.conf file ${NORMAL}"
if [ ! -f /etc/ssl/certs/java/cacerts ]; then
update-ca-trust
fi
mkdir -p /var/cache/man
mandb -c /opt/jdk/man
export JAVA_HOME=/opt/jdk
export PATH=$PATH:/opt/jdk/bin
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk
export PATH=$PATH:/usr/lib/jvm/java-8-openjdk/bin

View File

@ -1,53 +1,122 @@
# Tanım: Java Development Kit (JDK) adı verilen bir dizi program.
# URL: http://openjdk.java.net/
# Paketçi: milisarge@gmail.com
# Gerekler:
# Paketçi: milisarge
# Gerekler: ccache unzip xorg-libxrender xorg-libxtst xorg-libxt zip cups alsa-lib
# Grup: geliştirme
isim=openjdk
surum=8u60
surum=8
devir=1
_surum=1.8.0.60
kaynak=(http://anduin.linuxfromscratch.org/files/BLFS/OpenJDK-${_version}/OpenJDK-${_version}-`uname -m`-bin.tar.xz )
_java_ver=8
_jdk_update=192
_jdk_build=26
pkgver=${_java_ver}.u${_jdk_update}
_repo_ver=jdk${_java_ver}u${_jdk_update}-b${_jdk_build}
kaynak=(http://hg.openjdk.java.net/jdk8u/jdk8u/archive/${_repo_ver}.tar.gz::jdk8u-${_repo_ver}.tar.gz
http://hg.openjdk.java.net/jdk8u/jdk8u/corba/archive/${_repo_ver}.tar.gz::corba-${_repo_ver}.tar.gz
http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/archive/${_repo_ver}.tar.gz::hotspot-${_repo_ver}.tar.gz
http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/archive/${_repo_ver}.tar.gz::jdk-${_repo_ver}.tar.gz
http://hg.openjdk.java.net/jdk8u/jdk8u/jaxws/archive/691079f04a6f.tar.gz::jaxws-691079f04a6f.tar.gz
http://hg.openjdk.java.net/jdk8u/jdk8u/jaxp/archive/${_repo_ver}.tar.gz::jaxp-${_repo_ver}.tar.gz
http://hg.openjdk.java.net/jdk8u/jdk8u/langtools/archive/${_repo_ver}.tar.gz::langtools-${_repo_ver}.tar.gz
http://hg.openjdk.java.net/jdk8u/jdk8u/nashorn/archive/${_repo_ver}.tar.gz::nashorn-${_repo_ver}.tar.gz)
derle() {
cd OpenJDK*
install -vdm755 $PKG/opt/OpenJDK-$surum-bin
mv -v * $PKG/opt/OpenJDK-$surum-bin
chown -R root:root $PKG/opt/OpenJDK-$surum-bin
mkdir -p $PKG/etc/profile.d
cat > $PKG/etc/profile.d/openjdk.sh << "EOF"
# Begin /etc/profile.d/openjdk.sh
_JARCH=amd64
_jdkname=openjdk8
_jvmdir=/usr/lib/jvm/java-8-openjdk
_prefix="jdk8u-${_repo_ver}/image"
_imgdir="${_prefix}/jvm/openjdk-1.8.0_$(printf '%.2d' ${_jdk_update})"
_nonheadless=(bin/policytool
lib/${_JARCH}/libjsound.so
lib/${_JARCH}/libjsoundalsa.so
lib/${_JARCH}/libsplashscreen.so)
cd jdk8u-${_repo_ver}
for subrepo in corba hotspot jdk jaxp langtools nashorn; do
ln -s ../${subrepo}-${_repo_ver} ${subrepo}
done
ln -s ../jaxws-691079f04a6f jaxws
unset JAVA_HOME
# http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1346
export MAKEFLAGS=${MAKEFLAGS/-j*}
# Set JAVA_HOME directory
JAVA_HOME=/opt/jdk
# We filter out -O flags so that the optimization of HotSpot is not lowered from O3 to O2
export CFLAGS="${CFLAGS//-O2/-O3} ${CPPFLAGS} -Wno-error=deprecated-declarations -Wno-error=return-type -Wno-error=cpp -fno-lifetime-dse -fno-delete-null-pointer-checks"
export CXXFLAGS="${CXXFLAGS} ${CPPFLAGS}"
# Adjust PATH
pathappend $JAVA_HOME/bin
install -d -m 755 "${SRC}/${_prefix}/"
sed -i 's/gcc -V >&5//' configure
sh configure \
--prefix="${SRC}/${_prefix}" \
--with-update-version="${_jdk_update}" \
--with-build-number="b${_jdk_build}" \
--with-milestone="fcs" \
--enable-unlimited-crypto \
--with-zlib=system \
--with-extra-cflags="${CFLAGS}" \
--with-extra-cxxflags="${CXXFLAGS}" \
--with-extra-ldflags="${LDFLAGS}"
# Add to MANPATH
pathappend $JAVA_HOME/man MANPATH
# TODO OpenJDK does not want last version of giflib (add 'giflib' as dependency once fixed)
#--with-giflib=system \
# Auto Java CLASSPATH
# Copy jar files to, or create symlinks in this directory
# These help to debug builds: LOG=trace HOTSPOT_BUILD_JOBS=1
# Without 'DEBUG_BINARIES', i686 won't build: http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019203.html
make
make install
AUTO_CLASSPATH_DIR=/usr/share/java
cd ../${_imgdir}
pathprepend . CLASSPATH
# http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1437
find . -iname '*.jar' -exec chmod ugo+r {} \;
chmod ugo+r lib/ct.sym
for dir in `find ${AUTO_CLASSPATH_DIR} -type d 2>/dev/null`; do
pathappend $dir CLASSPATH
done
# remove redundant *diz and *debuginfo files
find . -iname '*.diz' -exec rm {} \;
find . -iname '*.debuginfo' -exec rm {} \;
for jar in `find ${AUTO_CLASSPATH_DIR} -name "*.jar" 2>/dev/null`; do
pathappend $jar CLASSPATH
done
cd $SRC/${_imgdir}
export JAVA_HOME
unset AUTO_CLASSPATH_DIR dir jar
# Main files
install -d -m 755 "${PKG}${_jvmdir}"
install -d -m 755 "${PKG}${_jvmdir}/jre"
# End /etc/profile.d/openjdk.sh
EOF
cp -a include lib "${PKG}${_jvmdir}"
cp -a jre/bin jre/lib "${PKG}${_jvmdir}/jre"
ln -sv OpenJDK-$surum-bin $PKG/opt/jdk
# 'bin' files
pushd bin
# 'java-rmi.cgi' will be handled separately as it should not be in the PATH and has no man page
for b in $(ls | grep -v java-rmi.cgi); do
if [ -e ../jre/bin/${b} ]; then
# Provide a link of the jre binary in the jdk/bin/ directory
ln -s ../jre/bin/${b} "${PKG}${_jvmdir}/bin/${b}"
else
# Copy binary to jdk/bin/
install -D -m 755 ${b} "${PKG}${_jvmdir}/bin/${b}"
fi
done
popd
# Handling 'java-rmi.cgi' separately
install -D -m 755 bin/java-rmi.cgi "${PKG}${_jvmdir}/bin/java-rmi.cgi"
# Set config files
mv "${PKG}${_jvmdir}"/jre/lib/management/jmxremote.password{.template,}
mv "${PKG}${_jvmdir}"/jre/lib/management/snmp.acl{.template,}
# Link JKS keystore from ca-certificates-utils
rm -f "${PKG}${_jvmdir}/jre/lib/security/cacerts"
ln -sf /etc/ssl/certs/java/cacerts "${PKG}${_jvmdir}/jre/lib/security/cacerts"
# Install license
install -d -m 755 "${PKG}/usr/share/licenses/java8-openjdk/"
install -m 644 ASSEMBLY_EXCEPTION LICENSE THIRD_PARTY_README \
"${PKG}/usr/share/licenses/java8-openjdk"
ln -sf /usr/share/licenses/java8-openjdk "${PKG}/usr/share/licenses/${isim}"
}