PKGBUILDs/extra/java7-openjdk/PKGBUILD

347 lines
14 KiB
Bash
Raw Normal View History

2013-03-22 00:52:43 +00:00
# $Id: PKGBUILD 179933 2013-03-12 17:11:40Z andyrtr $
# Maintainer: Andreas Radke <andyrtr@archlinux.org>
# Maintainer: Guillaume ALAUX <guillaume@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - removed doc package, --disable-docs in configure, this is measured in lifetimes to build on ARM
# - --enable-zero, hotspot changeset, url changed to use Zero hotspot source.
# original changeset left commented to be able to spot changes on package upgrades
# - added our architectures to set _JARCH
# - strip -D_FORTIFY_SOURCE=2 from C/CXXFLAGS
2013-10-21 22:42:19 +00:00
#noautobuild=1
2013-08-01 12:47:28 +00:00
2013-09-24 01:55:28 +00:00
pkgname=('jre7-openjdk-headless' 'jre7-openjdk' 'jdk7-openjdk' 'openjdk7-src')
2013-03-22 00:52:43 +00:00
pkgbase=java7-openjdk
_java_ver=7
2014-07-16 12:47:34 +00:00
_icedtea_ver=2.5.1
2013-03-22 00:52:43 +00:00
2013-06-10 21:24:53 +00:00
# check "${srcdir}/icedtea-${_icedtea_ver}"/Makefile.am
2014-07-17 00:21:07 +00:00
_JDK_UPDATE_VERSION=65
2013-03-22 00:52:43 +00:00
_bootstrap=0 # 0/1 for quick build or full bootstrap
2013-10-21 22:42:19 +00:00
pkgver=${_java_ver}.u${_JDK_UPDATE_VERSION}_${_icedtea_ver}
2014-07-09 16:47:19 +00:00
pkgrel=3
2013-03-22 00:52:43 +00:00
arch=('i686' 'x86_64')
url="http://icedtea.classpath.org"
license=('custom')
options=('!emptydirs')
makedepends=('jdk7-openjdk' 'libxp' 'libxslt'
'alsa-lib' 'apache-ant>=1.8.1' 'giflib' 'libpng>=1.5.7' 'gtk2'
2014-03-29 16:38:21 +00:00
'java-rhino' 'libpulse>=0.9.11' 'zip' 'unzip' 'cpio' 'fastjar' 'wget' 'procps-ng' 'inetutils'
'eclipse-ecj')
2013-03-22 00:52:43 +00:00
2014-06-14 17:18:40 +00:00
_icedtea_url=http://icedtea.classpath.org/download
2014-07-16 12:47:34 +00:00
_drops_url=${_icedtea_url}/drops/icedtea7/${_icedtea_ver}
2014-06-14 17:18:40 +00:00
source=(${_icedtea_url}/source/icedtea-${_icedtea_ver}.tar.gz
2014-07-16 12:47:34 +00:00
icedtea_${_icedtea_ver}_openjdk.tar.bz2::${_drops_url}/openjdk.tar.bz2
icedtea_${_icedtea_ver}_corba.tar.bz2::${_drops_url}/corba.tar.bz2
icedtea_${_icedtea_ver}_jaxp.tar.bz2::${_drops_url}/jaxp.tar.bz2
icedtea_${_icedtea_ver}_jaxws.tar.bz2::${_drops_url}/jaxws.tar.bz2
icedtea_${_icedtea_ver}_jdk.tar.bz2::${_drops_url}/jdk.tar.bz2
icedtea_${_icedtea_ver}_langtools.tar.bz2::${_drops_url}/langtools.tar.bz2
icedtea_${_icedtea_ver}_hotspot.tar.bz2::${_drops_url}/hotspot.tar.bz2
2013-03-22 00:52:43 +00:00
fontconfig-paths.diff
openjdk7_nonreparenting-wm.diff
2014-06-14 20:06:40 +00:00
giflib_5.1.diff
2013-03-22 00:52:43 +00:00
jdk7-openjdk.profile
jdk7-openjdk.profile.csh
jre7-openjdk.profile
2013-04-22 19:25:38 +00:00
jre7-openjdk.profile.csh)
2014-07-16 12:47:34 +00:00
sha256sums=('06483c252099d41e33eade8ceee9231a15ba1e9594f90e2d32943d17c8802acd'
'0496072760c521aa184f3c26c1f515a89ef6f9a88df14fa888c6ee6cdd9379b7'
'd476f22db32e028cc30dda47fec81e5ba0e113f029c3ed7a30edf8fc1404819b'
'd13778e5bbf6cda22a40b9d5186d2a7d1a3f34d998b1ac4d65fe3abd12fffa25'
'29c39856af1153620023c3fa0313be2f23dc02208db1a8429ca80d1eebfce06f'
'76194344fca5db4c79e4a2af28efd9fbb2e38e879b5afc59042874519bb5f7fc'
'374174ea3b7eb2bb81d9dfae4749d7b3c9037d07004aa59aaa5e8ed5fba922d3'
'78d57f7c207d8f56bba2ee6aec232a836fd51830d352cfa4804d8077d9a7b32b'
2013-03-22 00:52:43 +00:00
'9ad943ceb3dbcdf45d72974fc3667886a7ed65c69ab9abc17be5412827551a7f'
2013-10-21 22:42:19 +00:00
'56b919ababb13bd6afdcdaceb112b529b6e82539255f2dae9a7e5eb91645164b'
2014-06-14 20:06:40 +00:00
'77fba3032edf6cce549cd4e174d9296684b20f4589dc59179fcc8cba7426a4e9'
2013-03-22 00:52:43 +00:00
'bd55299e08e6f8e61ba5baad0990170891801a29a1e8137e502b5e8a10fc37ea'
'3f28f8bfc6dd105a07f747d7135c77a77de433e2b8647dd7520a900135203fbd'
'b7c045b08ad55a9f79390c104fa846d0e7dbb49fccffb2fab2a3824b6b19c9c8'
2013-04-22 19:25:38 +00:00
'89d99d8ac269ca66e2e279aff652d5aac938a35faec93cd8cff8f048052bd3ce')
2013-03-22 00:52:43 +00:00
2014-07-16 12:47:34 +00:00
noextract=(icedtea_${_icedtea_ver}_openjdk.tar.bz2
icedtea_${_icedtea_ver}_corba.tar.bz2
icedtea_${_icedtea_ver}_jaxp.tar.bz2
icedtea_${_icedtea_ver}_jaxws.tar.bz2
icedtea_${_icedtea_ver}_jdk.tar.bz2
icedtea_${_icedtea_ver}_lanbtools.tar.bz2
icedtea_${_icedtea_ver}_hotspot.tar.bz2)
2014-06-14 17:18:40 +00:00
[ "$CARCH" = "x86_64" ] && _JARCH=amd64
[ "$CARCH" = "i686" ] && _JARCH=i386
[ "$CARCH" = "arm" -o "$CARCH" = "armv6h" -o "$CARCH" = "armv7h" ] && _JARCH=arm
_jvmdir=/usr/lib/jvm/java-7-openjdk
_imgdir="icedtea-${_icedtea_ver}/openjdk.build/j2sdk-image"
_nonheadless=(bin/policytool
lib/${_JARCH}/libjsoundalsa.so
lib/${_JARCH}/libsplashscreen.so
lib/${_JARCH}/xawt/libmawt.so)
2013-03-22 00:52:43 +00:00
build() {
cd "${srcdir}/icedtea-${_icedtea_ver}"
CFLAGS=`echo $CFLAGS | sed -e 's/-D_FORTIFY_SOURCE=2//'` && CXXFLAGS="$CFLAGS"
export ALT_PARALLEL_COMPILE_JOBS="${MAKEFLAGS/-j}"
export HOTSPOT_BUILD_JOBS="${ALT_PARALLEL_COMPILE_JOBS}"
. /etc/profile.d/apache-ant.sh
2014-06-14 17:18:40 +00:00
cp "${srcdir}"/*.diff "${srcdir}"/icedtea-${_icedtea_ver}/patches
2013-05-20 15:42:12 +00:00
export DISTRIBUTION_PATCHES="patches/fontconfig-paths.diff \
2014-06-14 20:06:40 +00:00
patches/openjdk7_nonreparenting-wm.diff \
patches/giflib_5.1.diff"
2013-03-22 00:52:43 +00:00
if [ "$_bootstrap" = "1" ]; then
BOOTSTRAPOPT="--enable-bootstrap --with-ecj-jar=/usr/share/java/ecj.jar"
else
BOOTSTRAPOPT="--disable-bootstrap"
fi
./configure \
2014-06-14 17:18:40 +00:00
${BOOTSTRAPOPT} \
2013-03-22 00:52:43 +00:00
--with-parallel-jobs="${MAKEFLAGS/-j}" \
--disable-tests \
--disable-downloading --disable-Werror \
2014-06-14 17:18:40 +00:00
--with-pkgversion="Arch Linux ARM build ${pkgver}-${pkgrel}-${CARCH}" \
2013-03-22 00:52:43 +00:00
--with-jdk-home=${JAVA_HOME} \
2014-07-16 12:47:34 +00:00
--with-openjdk-src-zip="${srcdir}/icedtea_${_icedtea_ver}_openjdk.tar.bz2" \
--with-hotspot-src-zip="${srcdir}/icedtea_${_icedtea_ver}_hotspot.tar.bz2" \
--with-corba-src-zip="${srcdir}/icedtea_${_icedtea_ver}_corba.tar.bz2" \
--with-jaxp-src-zip="${srcdir}/icedtea_${_icedtea_ver}_jaxp.tar.bz2" \
--with-jaxws-src-zip="${srcdir}/icedtea_${_icedtea_ver}_jaxws.tar.bz2" \
--with-jdk-src-zip="${srcdir}/icedtea_${_icedtea_ver}_jdk.tar.bz2" \
--with-langtools-src-zip="${srcdir}/icedtea_${_icedtea_ver}_langtools.tar.bz2" \
2013-03-22 00:52:43 +00:00
--enable-nss \
--with-rhino \
--with-abs-install-dir=${_jvmdir} \
2014-07-09 16:47:19 +00:00
--enable-infinality=no \
2013-03-22 00:52:43 +00:00
--disable-docs \
--enable-zero
make
}
check() {
cd "${srcdir}/icedtea-${_icedtea_ver}"
# make -k check
}
package_jre7-openjdk-headless() {
2014-06-14 17:18:40 +00:00
pkgdesc='OpenJDK Java 7 headless runtime environment'
2013-03-22 00:52:43 +00:00
depends=('libjpeg-turbo' 'lcms2' 'nss' 'ca-certificates-java')
optdepends=('libcups: needed for Java Mauve support - libmawt.so'
2014-06-14 17:18:40 +00:00
'fontconfig: needed for Java Mauve support - libmawt.so'
'java-rhino: for some JavaScript support')
2013-03-22 00:52:43 +00:00
provides=('java-runtime-headless=7')
conflicts=('openjdk6')
2014-06-14 17:18:40 +00:00
# Upstream config files that should go to etc and get backup
_backup_etc=(etc/java-7-openjdk/${_JARCH}/jvm.cfg
etc/java-7-openjdk/calendars.properties
etc/java-7-openjdk/content-types.properties
etc/java-7-openjdk/flavormap.properties
etc/java-7-openjdk/fontconfig.bfc
etc/java-7-openjdk/fontconfig.properties
etc/java-7-openjdk/images/cursors/cursors.properties
etc/java-7-openjdk/logging.properties
etc/java-7-openjdk/management/jmxremote.access
etc/java-7-openjdk/management/jmxremote.password
etc/java-7-openjdk/management/management.properties
etc/java-7-openjdk/management/snmp.acl
etc/java-7-openjdk/net.properties
etc/java-7-openjdk/psfont.properties.ja
etc/java-7-openjdk/psfontj2d.properties
etc/java-7-openjdk/security/java.policy
etc/java-7-openjdk/security/java.security
etc/java-7-openjdk/security/nss.cfg
etc/java-7-openjdk/sound.properties
etc/java-7-openjdk/tz.properties)
backup=(${_backup_etc[@]}
etc/profile.d/jre.sh
etc/profile.d/jre.csh)
2013-03-22 00:52:43 +00:00
install=jre7-openjdk-headless.install
2014-06-14 17:18:40 +00:00
cd "${srcdir}/${_imgdir}/jre"
2013-03-22 00:52:43 +00:00
2014-06-14 17:18:40 +00:00
install -d -m755 "${pkgdir}${_jvmdir}/jre"
cp -a bin lib "${pkgdir}${_jvmdir}/jre"
2013-03-22 00:52:43 +00:00
2014-06-14 17:18:40 +00:00
# Set config files
mv "${pkgdir}${_jvmdir}"/jre/lib/fontconfig.{Ubuntu.properties.src,properties}
mv "${pkgdir}${_jvmdir}"/jre/lib/fontconfig.{Ubuntu.bfc,bfc}
mv "${pkgdir}${_jvmdir}"/jre/lib/management/jmxremote.password{.template,}
mv "${pkgdir}${_jvmdir}"/jre/lib/management/snmp.acl{.template,}
rm -f "${pkgdir}${_jvmdir}"/jre/lib/fontconfig.*.bfc
rm -f "${pkgdir}${_jvmdir}"/jre/lib/fontconfig.*.properties.src
rm -f "${pkgdir}${_jvmdir}"/jre/lib/fontconfig.properties.src
2013-03-22 00:52:43 +00:00
2014-06-14 17:18:40 +00:00
# Remove 'non-headless' files
for f in ${_nonheadless[@]}; do
rm "${pkgdir}${_jvmdir}/jre/${f}"
done
2013-03-22 00:52:43 +00:00
2014-06-14 17:18:40 +00:00
# Man pages
pushd "${pkgdir}${_jvmdir}/jre/bin"
install -d -m 755 "${pkgdir}"/usr/share/man/{,ja/}man1/
for file in *; do
install -m 644 "${srcdir}/${_imgdir}/man/man1/${file}.1" \
"${pkgdir}/usr/share/man/man1/${file}.1"
install -m 644 "${srcdir}/${_imgdir}/man/ja/man1/${file}.1" \
"${pkgdir}/usr/share/man/ja/man1/${file}.1"
2013-03-22 00:52:43 +00:00
done
2014-06-14 17:18:40 +00:00
popd
2013-03-22 00:52:43 +00:00
# Link binaries into /usr/bin
2014-06-14 17:18:40 +00:00
pushd "${pkgdir}${_jvmdir}/jre/bin"
install -d -m755 "${pkgdir}/usr/bin/"
2013-03-22 00:52:43 +00:00
for file in *; do
2014-06-14 17:18:40 +00:00
ln -sf ${_jvmdir}/jre/bin/${file} "${pkgdir}/usr/bin"
2013-03-22 00:52:43 +00:00
done
popd
# Link JKS keystore from ca-certificates-java
2014-06-14 17:18:40 +00:00
rm -f "${pkgdir}${_jvmdir}/jre/lib/security/cacerts"
2013-09-24 01:55:28 +00:00
ln -sf /etc/ssl/certs/java/cacerts "${pkgdir}${_jvmdir}/jre/lib/security/cacerts"
2013-03-22 00:52:43 +00:00
# Set some variables
2014-06-14 17:18:40 +00:00
install -d -m755 "${pkgdir}/etc/profile.d/"
install -m755 "${srcdir}/jre7-openjdk.profile" "${pkgdir}/etc/profile.d/jre.sh"
install -m755 "${srcdir}/jre7-openjdk.profile.csh" "${pkgdir}/etc/profile.d/jre.csh"
2013-03-22 00:52:43 +00:00
# Install license
2014-06-14 17:18:40 +00:00
install -d -m755 "${pkgdir}/usr/share/licenses/${pkgbase}/"
2013-03-22 00:52:43 +00:00
install -m644 ASSEMBLY_EXCEPTION LICENSE THIRD_PARTY_README \
2014-06-14 17:18:40 +00:00
"${pkgdir}/usr/share/licenses/${pkgbase}"
2013-08-18 18:28:11 +00:00
ln -sf /usr/share/licenses/${pkgbase} "${pkgdir}/usr/share/licenses/${pkgname}"
2014-06-14 17:18:40 +00:00
# Move config files that were set in _backup_etc from ./lib to /etc
for file in ${_backup_etc[@]}; do
_filepkgpath=${_jvmdir}/jre/lib/${file#etc/java-7-openjdk/}
install -D -m 644 "${pkgdir}${_filepkgpath}" "${pkgdir}/${file}"
ln -sf /${file} "${pkgdir}${_filepkgpath}"
2013-03-22 00:52:43 +00:00
done
}
2014-06-14 17:18:40 +00:00
2013-03-22 00:52:43 +00:00
package_jre7-openjdk() {
2014-06-14 17:18:40 +00:00
pkgdesc='OpenJDK Java 7 full runtime environment'
2013-03-22 00:52:43 +00:00
depends=('jre7-openjdk-headless' 'xdg-utils' 'hicolor-icon-theme')
optdepends=('icedtea-web-java7: web browser plugin + Java Web Start'
'alsa-lib: for basic sound support'
'giflib: for gif format support'
'libpulse: for advanced sound support'
'gtk2: for the Gtk+ look and feel - desktop usage'
'libxtst: linked in xawt/libmawt.so - desktop usage')
provides=('java-runtime=7')
conflicts=('openjdk6')
2014-06-14 17:18:40 +00:00
install=jre7-openjdk.install
cd "${srcdir}/${_imgdir}/jre"
for f in ${_nonheadless[@]}; do
install -D ${f} "${pkgdir}${_jvmdir}/jre/${f}"
done
2013-03-22 00:52:43 +00:00
# Link binaries into /usr/bin
2014-06-14 17:18:40 +00:00
pushd "${pkgdir}${_jvmdir}/jre/bin"
install -d -m755 "${pkgdir}/usr/bin/"
for file in *; do
ln -sf ${_jvmdir}/jre/bin/${file} "${pkgdir}/usr/bin"
done
popd
# Man pages
pushd "${pkgdir}${_jvmdir}/jre/bin"
install -d -m 755 "${pkgdir}"/usr/share/man/{,ja/}man1/
2013-03-22 00:52:43 +00:00
for file in *; do
2014-06-14 17:18:40 +00:00
install -m 644 "${srcdir}/${_imgdir}/man/man1/${file}.1" \
"${pkgdir}/usr/share/man/man1/${file}.1"
install -m 644 "${srcdir}/${_imgdir}/man/ja/man1/${file}.1" \
"${pkgdir}/usr/share/man/ja/man1/${file}.1"
2013-03-22 00:52:43 +00:00
done
popd
# Install icons and menu entries
for s in 16 24 32 48 ; do
2014-06-14 17:18:40 +00:00
install -d -m755 "${pkgdir}/usr/share/icons/hicolor/${s}x${s}/apps/"
2013-03-22 00:52:43 +00:00
install -m644 ../../../openjdk/jdk/src/solaris/classes/sun/awt/X11/java-icon${s}.png \
2014-06-14 17:18:40 +00:00
"${pkgdir}/usr/share/icons/hicolor/${s}x${s}/apps/java.png"
2013-03-22 00:52:43 +00:00
done
2014-06-14 17:18:40 +00:00
2013-03-22 00:52:43 +00:00
# Install desktop files.
2014-06-14 17:18:40 +00:00
install -d -m755 "${pkgdir}/usr/share/applications"
install -m644 "${srcdir}/icedtea-${_icedtea_ver}/policytool.desktop" "${pkgdir}/usr/share/applications"
2013-08-18 18:28:11 +00:00
# link license
2014-06-14 17:18:40 +00:00
install -d -m755 "${pkgdir}/usr/share/licenses"
2013-08-18 18:28:11 +00:00
ln -sf /usr/share/licenses/${pkgbase} "${pkgdir}/usr/share/licenses/${pkgname}"
2013-03-22 00:52:43 +00:00
}
package_jdk7-openjdk() {
2014-06-14 17:18:40 +00:00
pkgdesc='OpenJDK Java 7 development kit'
2013-03-22 00:52:43 +00:00
depends=('jre7-openjdk')
provides=('java-environment=7')
conflicts=('java-environment')
replaces=('openjdk6')
backup=(etc/profile.d/jdk.sh etc/profile.d/jdk.csh)
2014-06-14 17:18:40 +00:00
cd "${srcdir}/${_imgdir}"
2013-03-22 00:52:43 +00:00
# Main files
2014-06-14 17:18:40 +00:00
install -d -m755 "${pkgdir}${_jvmdir}"
2013-03-22 00:52:43 +00:00
2014-06-14 17:18:40 +00:00
cp -a include lib "${pkgdir}${_jvmdir}"
2013-03-22 00:52:43 +00:00
# 'bin' files
pushd bin
2014-06-14 17:18:40 +00:00
install -d -m755 "${pkgdir}${_jvmdir}/bin/" \
"${pkgdir}"/usr/bin/ \
"${pkgdir}"/usr/share/man/{,ja/}man1/
2013-03-22 00:52:43 +00:00
# '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
2014-06-14 17:18:40 +00:00
ln -s ../jre/bin/${b} "${pkgdir}${_jvmdir}/bin/${b}"
2013-03-22 00:52:43 +00:00
else
# Copy binary to jdk/bin/
2014-06-14 17:18:40 +00:00
install -m755 ${b} "${pkgdir}${_jvmdir}/bin/${b}"
2013-03-22 00:52:43 +00:00
# Copy man page
2014-06-14 17:18:40 +00:00
install -m644 ../man/man1/${b}.1 "${pkgdir}/usr/share/man/man1/${b}.1"
install -m644 ../man/ja/man1/${b}.1 "${pkgdir}/usr/share/man/ja/man1/${b}.1"
2013-03-22 00:52:43 +00:00
# Link from /bin/
2014-06-14 17:18:40 +00:00
ln -s ${_jvmdir}/bin/${b} "${pkgdir}/usr/bin/${b}"
2013-03-22 00:52:43 +00:00
fi
done
popd
# Handling 'java-rmi.cgi' separately
2014-06-14 17:18:40 +00:00
install -D -m755 bin/java-rmi.cgi "${pkgdir}${_jvmdir}/bin/java-rmi.cgi"
# Install desktop files.
install -d -m755 "${pkgdir}/usr/share/applications"
install -m644 "${srcdir}/icedtea-${_icedtea_ver}/jconsole.desktop" "${pkgdir}/usr/share/applications"
2013-03-22 00:52:43 +00:00
# Set some variables
2014-06-14 17:18:40 +00:00
install -d -m755 "${pkgdir}/etc/profile.d/"
install -m755 "${srcdir}/${pkgname}.profile" "${pkgdir}/etc/profile.d/jdk.sh"
install -m755 "${srcdir}/${pkgname}.profile.csh" "${pkgdir}/etc/profile.d/jdk.csh"
2013-08-18 18:28:11 +00:00
# link license
2014-06-14 17:18:40 +00:00
install -d -m755 "${pkgdir}/usr/share/licenses"
2013-08-18 18:28:11 +00:00
ln -sf /usr/share/licenses/${pkgbase} "${pkgdir}/usr/share/licenses/${pkgname}"
2013-03-22 00:52:43 +00:00
}
package_openjdk7-src() {
2014-06-14 17:18:40 +00:00
pkgdesc='OpenJDK Java 7 sources'
2013-03-22 00:52:43 +00:00
replaces=('openjdk6-src')
2014-06-14 17:18:40 +00:00
install -D "${srcdir}/${_imgdir}/src.zip" "${pkgdir}${_jvmdir}/src.zip"
2013-03-22 00:52:43 +00:00
}