development/openjdk7: Move template preamble to top of script.

Signed-off-by: B. Watson <yalhcru@gmail.com>
This commit is contained in:
B. Watson 2022-03-12 12:50:43 -05:00
parent ada647d46c
commit 8d48f8269c

View file

@ -23,6 +23,54 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=openjdk7
VERSION=${VERSION:-7u321}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
DVER=1.7.0_$(printf $VERSION | cut -du -f2)
ICEDTEA=icedtea-2.6.28
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm; echo "Unsupported arch $ARCH"; exit 1;;
*) ARCH=$( uname -m ) ;;
esac
fi
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
fi
TMP=${TMP:-/tmp/SBo}
BUILD_DIR=$TMP/$PRGNAM
SBO_PATCH_DIR="${BUILD_DIR}/jdk-archive-patch"
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "x86_64" ]; then
LIB_ARCH=amd64
LIBDIRSUFFIX="64"
else
LIB_ARCH=i386
LIBDIRSUFFIX=""
fi
# Check for the gcc5 package, and abort if not found:
if [ ! -x /usr/bin/gcc-5 ]; then
echo "This requires the gcc5 package to build."
echo "Please install gcc5 and rerun this script."
exit 1
else
source /etc/profile.d/gcc5.sh # Set the environment
fi
BOOT_JAVA=/usr/lib${LIBDIRSUFFIX}/jvm
function createPatchedJdkArchive() {
mkdir -p ${SBO_PATCH_DIR} && cd ${SBO_PATCH_DIR}
@ -57,57 +105,6 @@ function fixJdkArchiveChecksum() {
sed -r -i "s/^(\s*JDK_SHA256SUM\s*=\s*).*$/\1${newChecksum}/" Makefile
}
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=openjdk7
VERSION=${VERSION:-7u321}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
DVER=1.7.0_$(printf $VERSION | cut -du -f2)
ICEDTEA=icedtea-2.6.28
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm; echo "Unsupported arch $ARCH"; exit 1;;
*) ARCH=$( uname -m ) ;;
esac
fi
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
fi
TMP=${TMP:-/tmp/SBo}
BUILD_DIR=$TMP/$PRGNAM
SBO_PATCH_DIR="${BUILD_DIR}/jdk-archive-patch"
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "x86_64" ]; then
LIB_ARCH=amd64
LIBDIRSUFFIX="64"
else
LIB_ARCH=i386
LIBDIRSUFFIX=""
fi
# Check for the gcc5 package, and abort if not found:
if [ ! -x /usr/bin/gcc-5 ]; then
echo "This requires the gcc5 package to build."
echo "Please install gcc5 and rerun this script."
exit 1
else
source /etc/profile.d/gcc5.sh # Set the environment
fi
BOOT_JAVA=/usr/lib${LIBDIRSUFFIX}/jvm
set -e
rm -rf $BUILD_DIR $PKG