151 lines
5.3 KiB
Plaintext
151 lines
5.3 KiB
Plaintext
# Tanım: Java Development Kit (JDK) adı verilen bir dizi program.
|
||
# URL: http://openjdk.java.net/
|
||
# Paketçi: milisarge@gmail.com
|
||
# Gerekler: openjdk alsa-lib cups xorg-fontconfig freetype giflib gtk2 krb5 lcms2 libjpeg-turbo libpng libxslt nss unzip xorg-libxt xorg-libxtst xorg-libxinerama zip
|
||
|
||
name=openjdk8
|
||
openjdk_release=8
|
||
openjdk_update=u144
|
||
openjdk_build=b01
|
||
openjdk_version=$openjdk_release$openjdk_update$openjdk_build
|
||
version=8u144-b01
|
||
icedtea_version=3.5.1
|
||
certdata_rev=e5e2984f44c5
|
||
release=1
|
||
source=(http://icedtea.wildebeest.org/download/source/icedtea-$icedtea_version.tar.xz
|
||
http://stygian.me/crux/distfiles/$name/corba-$openjdk_version.tar.xz
|
||
http://stygian.me/crux/distfiles/$name/hotspot-$openjdk_version.tar.xz
|
||
http://stygian.me/crux/distfiles/$name/jaxp-$openjdk_version.tar.xz
|
||
http://stygian.me/crux/distfiles/$name/jaxws-$openjdk_version.tar.xz
|
||
http://stygian.me/crux/distfiles/$name/jdk-$openjdk_version.tar.xz
|
||
http://stygian.me/crux/distfiles/$name/langtools-$openjdk_version.tar.xz
|
||
http://stygian.me/crux/distfiles/$name/nashorn-$openjdk_version.tar.xz
|
||
http://stygian.me/crux/distfiles/$name/openjdk-$openjdk_version.tar.xz
|
||
http://stygian.me/crux/distfiles/$name-boot.pkg.tar.xz
|
||
http://ftp.netbsd.org/pub/pkgsrc/pkgsrc-2017Q2/pkgsrc/security/mozilla-rootcerts/files/mozilla-rootcerts.sh
|
||
http://hg.mozilla.org/releases/mozilla-release/raw-file/$certdata_rev/security/nss/lib/ckfw/builtins/certdata.txt)
|
||
|
||
unpack_source() {
|
||
for file in ${source[@]}; do
|
||
case ${file##*/} in
|
||
icedtea-$icedtea_version.tar.xz|\
|
||
$name-boot.pkg.tar.xz)
|
||
bsdtar -p -o -C $SRC -xf $(get_filename $file) ;;
|
||
*)
|
||
cp $(get_filename $file) $SRC ;;
|
||
esac
|
||
done
|
||
}
|
||
|
||
build() {
|
||
JAVA_DIR=/opt/OpenJDK-8u60-bin
|
||
|
||
mkdir $SRC/build
|
||
cd $SRC/build
|
||
|
||
LC_ALL=C \
|
||
CFLAGS="$CFLAGS -fno-delete-null-pointer-checks -fno-omit-frame-pointer -fno-lifetime-dse" \
|
||
CXXFLAGS="$CXXFLAGS -fno-delete-null-pointer-checks -fno-omit-frame-pointer -fno-lifetime-dse" \
|
||
JAVA_HOME=$JAVA_DIR \
|
||
PATH=$JAVA_DIR/bin:$PATH \
|
||
CONFIG_SHELL=/bin/bash \
|
||
../icedtea-$icedtea_version/configure \
|
||
--prefix=/usr/lib/java/$name \
|
||
--disable-docs \
|
||
--disable-downloading \
|
||
--disable-precompiled-headers \
|
||
--disable-tests \
|
||
--disable-system-pcsc \
|
||
--disable-system-sctp \
|
||
--enable-system-cups \
|
||
--enable-system-fontconfig \
|
||
--enable-system-gconf \
|
||
--enable-system-gio \
|
||
--enable-system-gtk \
|
||
--enable-system-jpeg \
|
||
--enable-system-kerberos \
|
||
--enable-system-lcms \
|
||
--enable-system-png \
|
||
--enable-system-zlib \
|
||
--enable-nss \
|
||
--enable-sunec \
|
||
--enable-non-nss-curves \
|
||
--enable-improved-font-rendering \
|
||
--with-openjdk-src-zip=$SRC/openjdk-$openjdk_version.tar.xz \
|
||
--with-hotspot-src-zip=$SRC/hotspot-$openjdk_version.tar.xz \
|
||
--with-corba-src-zip=$SRC/corba-$openjdk_version.tar.xz \
|
||
--with-jaxp-src-zip=$SRC/jaxp-$openjdk_version.tar.xz \
|
||
--with-jaxws-src-zip=$SRC/jaxws-$openjdk_version.tar.xz \
|
||
--with-jdk-src-zip=$SRC/jdk-$openjdk_version.tar.xz \
|
||
--with-langtools-src-zip=$SRC/langtools-$openjdk_version.tar.xz \
|
||
--with-nashorn-src-zip=$SRC/nashorn-$openjdk_version.tar.xz \
|
||
--with-pkgversion=MILIS \
|
||
--with-jdk-home=$JAVA_DIR
|
||
|
||
LC_ALL=C \
|
||
CFLAGS="$CFLAGS -fno-delete-null-pointer-checks -fno-omit-frame-pointer -fno-lifetime-dse" \
|
||
CXXFLAGS="$CXXFLAGS -fno-delete-null-pointer-checks -fno-omit-frame-pointer -fno-lifetime-dse" \
|
||
JAVA_HOME=$JAVA_DIR \
|
||
PATH=$JAVA_DIR/bin:$PATH \
|
||
make
|
||
|
||
mkdir -p $PKG/usr/lib/java/$name
|
||
cp -r openjdk.build/images/j2sdk-image/* $PKG/usr/lib/java/$name
|
||
|
||
# remove unneeded files
|
||
rm -f $PKG/usr/lib/java/$name/src.zip
|
||
rm -rf $PKG/usr/lib/java/$name/{demo,sample}
|
||
rm -f $PKG/usr/lib/java/$name/man/ja
|
||
rm -rf $PKG/usr/lib/java/$name/man/ja_JP.UTF-8
|
||
find $PKG/usr/lib/java/$name -name '*.ja' -delete
|
||
|
||
# deduplicate
|
||
rm $PKG/usr/lib/java/$name/jre/lib/amd64/libjawt.so
|
||
ln -s ../../../../lib/amd64/libjawt.so \
|
||
$PKG/usr/lib/java/$name/jre/lib/amd64/libjawt.so
|
||
rm $PKG/usr/lib/java/$name/jre/lib/amd64/jli/libjli.so
|
||
ln -s ../../../../lib/amd64/jli/libjli.so \
|
||
$PKG/usr/lib/java/$name/jre/lib/amd64/jli/libjli.so
|
||
for f in $PKG/usr/lib/java/$name/jre/bin/* ; do
|
||
if [ -f $PKG/usr/lib/java/$name/bin/${f##*/} ]; then
|
||
rm $f
|
||
ln -s ../../bin/${f##*/} $f
|
||
fi
|
||
done
|
||
|
||
sed -e "/# cd \/etc\/openssl\/certs/s//# cd \/usr\/share\/$name\/certs/" \
|
||
-e '/@AWK@/s//\/usr\/bin\/awk/' \
|
||
-e '/@ECHO@/s//\/bin\/echo/' \
|
||
-e '/@EXPR@/s//\/usr\/bin\/expr/' \
|
||
-e '/@LN@/s//\/bin\/ln/' \
|
||
-e '/@LS@/s//\/bin\/ls/' \
|
||
-e '/@MKDIR@/s//\/bin\/mkdir/' \
|
||
-e '/@OPENSSL@/s//\/bin\/openssl/' \
|
||
-e "/@SSLDIR@/s//\/usr\/share\/$name/" \
|
||
-e '/@PREFIX@/s//\/usr/' \
|
||
-e '/@RM@/s//\/bin\/rm/' \
|
||
-e '/@LOCALBASE@/s//\/usr/' \
|
||
-e "/@DATADIR@/s//\/usr\/share\/$name/" \
|
||
-e 's/self extract/self -f $certfile extract/' \
|
||
-e 's/self rehash/self -f $certfile rehash/' \
|
||
$SRC/mozilla-rootcerts.sh > $SRC/mozilla-rootcerts
|
||
|
||
# generate java's cacerts
|
||
# big thanks to pkgsrc's mozilla-rootcerts and openjdk pkg's for this part
|
||
rm -f $PKG/usr/lib/java/$name/jre/lib/security/cacerts
|
||
mkdir $SRC/cacerts
|
||
cd $SRC/cacerts
|
||
sh $SRC/mozilla-rootcerts -f $SRC/certdata.txt extract
|
||
for cert in *.pem; do
|
||
JAVA_HOME=$PKG/usr/lib/java/$name \
|
||
PATH=$JAVA_HOME/bin:$PATH \
|
||
keytool \
|
||
-noprompt \
|
||
-importcert \
|
||
-keystore $PKG/usr/lib/java/$name/jre/lib/security/cacerts \
|
||
-alias $(echo $cert | sed 's,.*/\([^/]*\)\.pem,\1,') \
|
||
-file $cert \
|
||
-storepass changeit
|
||
done
|
||
}
|