56 lines
3.3 KiB
Bash
56 lines
3.3 KiB
Bash
# This is the recipe.sh script. It is executed by BPM in a temporary directory when compiling a source package
|
|
# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE
|
|
# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT
|
|
|
|
# The build function is executed in the source directory
|
|
# This function is used to compile the source code
|
|
build() {
|
|
unset MAKEFLAGS
|
|
|
|
[ -z "$BOOT_JDK" ] && export BOOT_JDK=/usr/lib/java/openjdk-${BPM_PKG_VERSION%%.*}/
|
|
|
|
bash configure --enable-unlimited-crypto \
|
|
--disable-warnings-as-errors \
|
|
--with-extra-cflags="$CFLAGS" \
|
|
--with-extra-cxxflags="$CXXFLAGS" \
|
|
--with-extra-ldflags="$LDFLAGS" \
|
|
--with-stdc++lib=dynamic \
|
|
--with-giflib=system \
|
|
--with-harfbuzz=system \
|
|
--with-lcms=system \
|
|
--with-libjpeg=system \
|
|
--with-libpng=system \
|
|
--with-zlib=system \
|
|
--with-version-build=${BPM_PKG_VERSION##*+} \
|
|
--with-version-pre="" \
|
|
--with-version-opt="" \
|
|
--with-cacerts-file=/etc/pki/tls/java/cacerts \
|
|
--with-boot-jdk="$BOOT_JDK"
|
|
make images
|
|
}
|
|
|
|
# The package function is executed in the source directory
|
|
# This function is used to move the compiled files into the output directory
|
|
package() {
|
|
install -d "$BPM_OUTPUT"/usr/lib/java/openjdk-${BPM_PKG_VERSION%%.*}
|
|
cp -r build/*/images/jdk/* "$BPM_OUTPUT"/usr/lib/java/openjdk-${BPM_PKG_VERSION%%.*}/
|
|
chown -R root:root "$BPM_OUTPUT"/usr/lib/java/openjdk-${BPM_PKG_VERSION%%.*}
|
|
|
|
# Symlink cacerts
|
|
ln -sf /etc/ssl/certs/java/cacerts "$BPM_OUTPUT"/usr/lib/java/openjdk-${BPM_PKG_VERSION%%.*}/lib/security/cacerts
|
|
|
|
# Install icons
|
|
for size in 16 24 32 48; do
|
|
install -Dm644 src/java.desktop/unix/classes/sun/awt/X11/java-icon${size}.png "$BPM_OUTPUT"/usr/share/icons/hicolor/${size}x${size}/apps/openjdk-${BPM_PKG_VERSION%%.*}.png
|
|
done
|
|
|
|
# Install desktop files
|
|
sed "s/%version%/${BPM_PKG_VERSION%%.*}/g" "$BPM_WORKDIR"/openjdk-java.desktop.in | install -Dm644 /dev/stdin "$BPM_OUTPUT"/usr/share/applications/openjdk-${BPM_PKG_VERSION%%.*}-java.desktop
|
|
sed "s/%version%/${BPM_PKG_VERSION%%.*}/g" "$BPM_WORKDIR"/openjdk-jconsole.desktop.in | install -Dm644 /dev/stdin "$BPM_OUTPUT"/usr/share/applications/openjdk-${BPM_PKG_VERSION%%.*}-jconsole.desktop
|
|
sed "s/%version%/${BPM_PKG_VERSION%%.*}/g" "$BPM_WORKDIR"/openjdk-jshell.desktop.in | install -Dm644 /dev/stdin "$BPM_OUTPUT"/usr/share/applications/openjdk-${BPM_PKG_VERSION%%.*}-jshell.desktop
|
|
|
|
# Install package license
|
|
install -Dm644 "$BPM_SOURCE"/LICENSE "$BPM_OUTPUT"/usr/share/licenses/openjdk-${BPM_PKG_VERSION%%.*}/LICENSE
|
|
install -Dm644 "$BPM_SOURCE"/ASSEMBLY_EXCEPTION "$BPM_OUTPUT"/usr/share/licenses/openjdk-${BPM_PKG_VERSION%%.*}/ASSEMBLY_EXCEPTION
|
|
}
|