#Packager: Dimitris Tzemos pkgname=openjre pkgver=7u40 pkgrel=1dj options=('noautodotnew') dotnew=('etc/java/java.security' 'etc/java/java.policy' 'etc/java/jvm.cfg' 'etc/java/nss.cfg') _icedtea_ver=2.4.0 # check "${srcdir}/icedtea7"/Makefile.am _CORBA_CHANGESET=71d5ec2f3dfb _HOTSPOT_CHANGESET=c67fd7874b1a # see "${srcdir}/icedtea7"/hotspot.map _JAXP_CHANGESET=5eaf3bca7f68 _JAXWS_CHANGESET=9d2007a13c02 _JDK_CHANGESET=29ce11184945 _LANGTOOLS_CHANGESET=ffb1b6bc4750 _OPENJDK_CHANGESET=9c74cb4a3ae8 _CACAO_VERSION=e215e36be9fc _JAMVM_VERSION=7c8dceb90880616b7dd670f257961a1f5f371ec3 _CACAO_BASE_URL=http://icedtea.classpath.org/download/drops/cacao _JAMVM_BASE_URL=http://icedtea.classpath.org/download/drops/jamvm _ICEDTEA_PREFIX=icedtea7-forest-2.4 _ICEDTEA_HG_URL=http://icedtea.classpath.org/hg/release/${_ICEDTEA_PREFIX} _url=${_ICEDTEA_HG_URL} source=(http://icedtea.classpath.org/download/source/icedtea-${_icedtea_ver}.tar.gz{,.sig} ${_url}/archive/${_OPENJDK_CHANGESET}.tar.gz # openjdk.tar.gz ${_url}/corba/archive/${_CORBA_CHANGESET}.tar.gz # corba.tar.gz ${_url}/jaxp/archive/${_JAXP_CHANGESET}.tar.gz # jaxp.tar.gz ${_url}/jaxws/archive/${_JAXWS_CHANGESET}.tar.gz # jaxws.tar.gz ${_url}/jdk/archive/${_JDK_CHANGESET}.tar.gz # jdk.tar.gz ${_url}/langtools/archive/${_LANGTOOLS_CHANGESET}.tar.gz # langtools.tar.gz ${_url}/hotspot/archive/${_HOTSPOT_CHANGESET}.tar.gz # hotspot.tar.gz ${_CACAO_BASE_URL}/${_CACAO_VERSION}.tar.gz ${_JAMVM_BASE_URL}/jamvm-${_JAMVM_VERSION}.tar.gz 'generate-cacerts.pl' 'icedtea,zero_debuginfo.patch' 'openjdk.arm_fixes.patch' 'icedtea_zero_buildfix.patch' 'openjre.csh' 'openjre.sh' ) docs=("ASSEMBLY_EXCEPTION" "LICENSE" "README*" "THIRD_PARTY_README") url=http://openjdk.java.net/ slackdesc=\ ( #|-----handy-ruler------------------------------------------------------| "Java(TM) 2 Platform Standard Edition Runtime Environment." "The J2SE(TM) Runtime Environment (JRE) is intended for software" "developers and vendors to redistribute with their applications." "It contains the Java virtual machine, runtime class libraries, and" "Java application launcher that are necessary to run programs written" "in the Java programming language." ) build() { JAVAVER=7u40 JAVABLD=b40 ICEDTEA=2.4.0 VERSION="${JAVAVER}_${JAVABLD}" # If BOOTSTRAP is set to "YES" then we bootstrap the build using GCC's # java compiler (gcj) instead of a depending on a pre-installed version # of OpenJDK to build OpenJDK. BOOTSTRAP=${BOOTSTRAP:-"YES"} SRC_OPENJDK=openjdk.tar.gz SRC_HOTSPOT=hotspot.tar.gz SRC_CORBA=corba.tar.gz SRC_JAXP=jaxp.tar.gz SRC_JAXWS=jaxws.tar.gz SRC_JDK=jdk.tar.gz SRC_LANGTOOLS=langtools.tar.gz SRC_CACAO=cacao-e215e36be9fc.tar.gz if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" LIBDIRSUFFIX="" LIB_ARCH=i386 ARCH_OPTS="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" LIBDIRSUFFIX="" LIB_ARCH=i386 ARCH_OPTS="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" LIB_ARCH=amd64 ARCH_OPTS="" elif [ "$ARCH" = "arm" ]; then SLKCFLAGS="-O2" LIBDIRSUFFIX="" LIB_ARCH=$ARCH ARCH_OPTS="--enable-cacao --with-cacao-src-zip=$SRC/${SRC_CACAO}" elif [ "$ARCH" = "armv7hl" ]; then SLKCFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16" LIBDIRSUFFIX="" LIB_ARCH=$ARCH ARCH_OPTS="--enable-cacao --with-cacao-src-zip=$SRC/${SRC_CACAO}" else SLKCFLAGS="-O2" LIBDIRSUFFIX="" LIB_ARCH=$ARCH ARCH_OPTS="" fi case "ARCH" in arm*) TARGET=$ARCH-slackware-linux-gnueabi ;; *) TARGET=$ARCH-slackware-linux ;; esac cd $SRC mv c67fd7874b1a.tar.gz hotspot.tar.gz mv 5eaf3bca7f68.tar.gz jaxp.tar.gz mv 9d2007a13c02.tar.gz jaxws.tar.gz mv 29ce11184945.tar.gz jdk.tar.gz mv 9c74cb4a3ae8.tar.gz openjdk.tar.gz mv ffb1b6bc4750.tar.gz langtools.tar.gz mv 71d5ec2f3dfb.tar.gz corba.tar.gz mv e215e36be9fc.tar.gz cacao-e215e36be9fc.tar.gz cd icedtea-$ICEDTEA || exit 1 # We start with creating a proper build environment. # Prevent an error which aborts the build: mkdir -p bootstrap/boot/jre/lib unset CLASSPATH unset JAVA_HOME unset MAKEFLAGS if [ "$BOOTSTRAP" = "YES" -o "$BOOTSTRAP" = "yes" ]; then # Use gcc's java compiler: export JVMDIR=/usr/lib${LIBDIRSUFFIX}/jvm export ALT_BOOTDIR=/usr/lib${LIBDIRSUFFIX}/jvm export ECJJAR=/usr/share/java/ecj.jar export RTJAR=/tmp/icedtea-$ICEDTEA/bootstrap/boot/jre/lib/rt.jar ! echo $PATH | grep -q jvm/bin && export PATH=/usr/lib${LIBDIRSUFFIX}/jvm/bin:$PATH EXTRA_OPTS="--enable-bootstrap --with-gcj=/usr/bin/gcj" # Bootstrap without cacao: ARCH_OPTS="" else # Use a pre-installed OpenJDK: export JVMDIR=/usr/lib${LIBDIRSUFFIX}/java EXTRA_OPTS="--disable-bootstrap" fi export ANT_HOME=/usr/share/ant export ALT_FREETYPE_LIB_PATH=/usr/lib${LIBDIRSUFFIX} export ALT_PARALLEL_COMPILE_JOBS="${NUMJOBS/-j}" export BUILD_NUMBER=$JAVABLD export HOTSPOT_BUILD_JOBS="${ALT_PARALLEL_COMPILE_JOBS}" export LANG=C export OS_VARIANT_NAME="Slackware" export OS_VARIANT_VERSION=$(cat /etc/slackware-version | cut -f2 -d' ') cp $SRC/*.patch $SRC/icedtea-$ICEDTEA/patches/ export DISTRIBUTION_BOOT_PATCHES="patches/openjdk.arm_fixes.patch" CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ --with-abs-install-dir=/usr/lib${LIBDIRSUFFIX}/java \ --with-pkgversion=Slackware \ --with-parallel-jobs=${HOTSPOT_BUILD_JOBS} \ --with-corba-src-zip=$SRC/${SRC_CORBA} \ --with-hotspot-src-zip=$SRC/${SRC_HOTSPOT} \ --with-jaxp-src-zip=$SRC/${SRC_JAXP} \ --with-jaxws-src-zip=$SRC/${SRC_JAXWS} \ --with-jdk-src-zip=$SRC/${SRC_JDK} \ --with-langtools-src-zip=$SRC/${SRC_LANGTOOLS} \ --with-openjdk-src-zip=$SRC/${SRC_OPENJDK} \ --with-jdk-home=${JVMDIR} \ --disable-docs \ --disable-jamvm \ --disable-jdk-tests \ --disable-langtools-tests \ --disable-system-lcms \ --enable-nss \ $ARCH_OPTS \ $EXTRA_OPTS \ --build=$TARGET #--with-javac=${JVMDIR}/bin/javac || return 1 # In bootstrap build on Slackware 14, avoid a DSO linking error: sed -i -e "s/-o native-ecj/-lgcj -o native-ecj/" Makefile make VERBOSE=TRUE || exit 1 # Move the generated jre and sdk images to the respective packages: mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/java cp -a openjdk.build/j2re-image \ $PKG/usr/lib${LIBDIRSUFFIX}/java/jre # Generate a cacerts file from the certificates installed through our # ca-certificates package - the "cacerts" in the OpenJDK sources is empty. # This will only work if we already have a proper JDK/JRE installed: if which keytool 1>/dev/null 2>&1 ; then mkdir certgen ( cd certgen cp $SRC/generate-cacerts.pl . for cert in /usr/share/ca-certificates/*/*.crt; do openssl x509 -text -in "${cert}" >> all.crt done perl generate-cacerts.pl keytool all.crt install -p -m0644 cacerts $PKG/usr/lib${LIBDIRSUFFIX}/java/jre/lib/security ) else echo "** Not installing a proper cacerts file !" echo "** Missing keytool program (do you really have a Java installed?)" fi # Pick a selection of fontconfig files: cp -a $PKG/usr/lib${LIBDIRSUFFIX}/java/jre/lib/fontconfig{.Ubuntu,}.properties.src cp -a $PKG/usr/lib${LIBDIRSUFFIX}/java/jre/lib/fontconfig{.Ubuntu,}.bfc # Symlinks are present in Slackware historically: ( cd $PKG/usr/lib${LIBDIRSUFFIX}/java ln -sf jre jre${VERSION} ln -sf jre/bin bin ) || exit 1 # Add the profile scripts: mkdir -p $PKG/etc/profile.d mkdir -p $SRC/profile.d cp $SRC/openjre.sh $SRC/profile.d cp $SRC/openjre.csh $SRC/profile.d for file in $(ls $SRC/profile.d/openjre*) ; do cat $file | sed -e "s#lib/java#lib${LIBDIRSUFFIX}/java#" \ > $PKG/etc/profile.d/$(basename $file) done chmod 755 $PKG/etc/profile.d/* # Add menu entries and icons: for i in 16 24 32 48 ; do mkdir -p ${PKG}/usr/share/icons/hicolor/${i}x${i}/apps install -m644 openjdk/jdk/src/solaris/classes/sun/awt/X11/java-icon${i}.png \ ${PKG}/usr/share/icons/hicolor/${i}x${i}/apps/java.png done mkdir -p ${PKG}/usr/share/applications install -m644 *.desktop ${PKG}/usr/share/applications/ rm ${PKG}/usr/share/applications/javaws.desktop rm ${PKG}/usr/share/applications/jconsole.desktop rm ${PKG}/usr/share/applications/policytool.desktop # We do not create symlinks for binaries in /usr/bin , instead we add the # Java directory to the $PATH : for FILE in ${PKG}/usr/share/applications/*.desktop \ ; do sed -i -e "s,^Exec=/usr/bin/,Exec=," $FILE done # User-modifiable configuration files go to /etc : mkdir -p $PKG/etc/java mv $PKG/usr/lib${LIBDIRSUFFIX}/java/jre/lib/${LIB_ARCH}/jvm.cfg $PKG/etc/java/jvm.cfg ln -sf /etc/java/jvm.cfg $PKG/usr/lib${LIBDIRSUFFIX}/java/jre/lib/${LIB_ARCH}/jvm.cfg mv $PKG/usr/lib${LIBDIRSUFFIX}/java/jre/lib/security/java.policy $PKG/etc/java/java.policy ln -sf /etc/java/java.policy $PKG/usr/lib${LIBDIRSUFFIX}/java/jre/lib/security/java.policy mv $PKG/usr/lib${LIBDIRSUFFIX}/java/jre/lib/security/java.security $PKG/etc/java/java.security ln -sf /etc/java/java.security $PKG/usr/lib${LIBDIRSUFFIX}/java/jre/lib/security/java.security cat << EOF > $PKG/usr/lib${LIBDIRSUFFIX}/java/jre/lib/security/nss.cfg name = NSS nssLibraryDirectory = /usr/lib${LIBDIRSUFFIX}/seamonkey nssDbMode = noDb attributes = compatibility EOF cat $PKG/usr/lib${LIBDIRSUFFIX}/java/jre/lib/security/nss.cfg | sed -e 's/seamonkey-.*$/seamonkey/' > $PKG/etc/java/nss.cfg ln -sf /etc/java/nss.cfg $PKG/usr/lib${LIBDIRSUFFIX}/java/jre/lib/security/nss.cfg # NOTE: # The openjre does not build a mozilla plugin: install icedtea-web instead. ( cd $PKG/usr/lib${LIBDIRSUFFIX} ln -sf ./java/jre/lib/${LIB_ARCH}/server/libjvm.so . ) # Add documentation files: mkdir -p $PKG/usr/doc/$pkgname-$pkgver/icedtea ( cd openjdk cp -a \ ASSEMBLY_EXCEPTION LICENSE README* THIRD_PARTY_README \ $PKG/usr/doc/$pkgname-$pkgver ) cp -a \ AUTHORS COPYING HACKING INSTALL NEWS README* THANKYOU \ $PKG/usr/doc/$pkgname-$pkgver/icedtea # If there's a ChangeLog, installing at least part of the recent history # is useful, but don't let it get totally out of control: if [ -r ChangeLog ]; then for DOCSDIR in $(echo $PKG/usr/doc/$pkgname-$pkgver) do cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog touch -r ChangeLog $DOCSDIR/ChangeLog done fi }