From 26303862c8755c2be7dffbe9ecdaf3eb681ed6ee Mon Sep 17 00:00:00 2001 From: Andrew Hughes Date: Fri, 11 Oct 2024 00:01:09 +0100 Subject: [PATCH] Add build scripts to repository to ease remembering all CentOS & RHEL targets and options Related: RHEL-58786 --- java-1.8.0-openjdk.spec | 1 + scripts/builds/build_centos.sh | 29 +++++++++++++ scripts/builds/build_centos_portable_build.sh | 29 +++++++++++++ scripts/builds/build_rhel_7_portable_build.sh | 29 +++++++++++++ scripts/builds/build_rhel_8.sh | 43 +++++++++++++++++++ scripts/builds/build_rhel_9.sh | 43 +++++++++++++++++++ scripts/builds/build_rhel_portable_build.sh | 29 +++++++++++++ scripts/builds/build_vanilla.sh | 43 +++++++++++++++++++ 8 files changed, 246 insertions(+) create mode 100755 scripts/builds/build_centos.sh create mode 100755 scripts/builds/build_centos_portable_build.sh create mode 100755 scripts/builds/build_rhel_7_portable_build.sh create mode 100755 scripts/builds/build_rhel_8.sh create mode 100755 scripts/builds/build_rhel_9.sh create mode 100755 scripts/builds/build_rhel_portable_build.sh create mode 100755 scripts/builds/build_vanilla.sh diff --git a/java-1.8.0-openjdk.spec b/java-1.8.0-openjdk.spec index 5b2d644..40bb681 100644 --- a/java-1.8.0-openjdk.spec +++ b/java-1.8.0-openjdk.spec @@ -2948,6 +2948,7 @@ cjc.mainProgram(args) - Bump version of bundled zlib to 1.3.1 following JDK-8324632 - Include backport of JDK-8328999 to update giflib to 5.2.2 - Bump version of bundled giflib to 5.2.2 following JDK-8328999 +- Add build scripts to repository to ease remembering all CentOS & RHEL targets and options - Resolves: RHEL-58786 - Resolves: RHEL-17187 diff --git a/scripts/builds/build_centos.sh b/scripts/builds/build_centos.sh new file mode 100755 index 0000000..5625b93 --- /dev/null +++ b/scripts/builds/build_centos.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +# Copyright (C) 2024 Red Hat, Inc. +# Written by: +# Andrew John Hughes +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +# Builds the RPM on CentOS 9 or 10 + +centpkg -v build + +# Local Variables: +# compile-command: "shellcheck build_centos.sh" +# fill-column: 80 +# indent-tabs-mode: nil +# sh-basic-offset: 4 +# End: diff --git a/scripts/builds/build_centos_portable_build.sh b/scripts/builds/build_centos_portable_build.sh new file mode 100755 index 0000000..41eb62f --- /dev/null +++ b/scripts/builds/build_centos_portable_build.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +# Copyright (C) 2024 Red Hat, Inc. +# Written by: +# Andrew John Hughes +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +# Builds the portable on CentOS + +centpkg -v build --target java-openjdk-portable-build --rhel-target none + +# Local Variables: +# compile-command: "shellcheck build_centos_portable_build.sh" +# fill-column: 80 +# indent-tabs-mode: nil +# sh-basic-offset: 4 +# End: diff --git a/scripts/builds/build_rhel_7_portable_build.sh b/scripts/builds/build_rhel_7_portable_build.sh new file mode 100755 index 0000000..9edc89b --- /dev/null +++ b/scripts/builds/build_rhel_7_portable_build.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +# Copyright (C) 2024 Red Hat, Inc. +# Written by: +# Andrew John Hughes +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +# Builds the portable on RHEL 7 + +rhpkg -v build + +# Local Variables: +# compile-command: "shellcheck build_rhel_7_portable_build.sh" +# fill-column: 80 +# indent-tabs-mode: nil +# sh-basic-offset: 4 +# End: diff --git a/scripts/builds/build_rhel_8.sh b/scripts/builds/build_rhel_8.sh new file mode 100755 index 0000000..c1ea948 --- /dev/null +++ b/scripts/builds/build_rhel_8.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +# Copyright (C) 2024 Red Hat, Inc. +# Written by: +# Andrew John Hughes +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +# Builds the RPM on RHEL 8 + +NVR=${1} +USER=${2} + +if test "${NVR}" = ""; then + echo "${0} "; + exit 1; +fi + +if test "${USER}" = ""; then + echo "${0} "; + exit 2; +fi + +METADATA="{\"osci\": {\"upstream_nvr\": \"${NVR}\", \"upstream_owner_name\": \"${USER}\"}, \"rhel-target\": \"latest\"}" +rhpkg -v build --target=java-openjdk-rhel-8-build --custom-user-metadata "${METADATA}" + +# Local Variables: +# compile-command: "shellcheck build_rhel_8.sh" +# fill-column: 80 +# indent-tabs-mode: nil +# sh-basic-offset: 4 +# End: diff --git a/scripts/builds/build_rhel_9.sh b/scripts/builds/build_rhel_9.sh new file mode 100755 index 0000000..a39e35f --- /dev/null +++ b/scripts/builds/build_rhel_9.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +# Copyright (C) 2024 Red Hat, Inc. +# Written by: +# Andrew John Hughes +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +# Builds the RPM on RHEL 9 + +NVR=${1} +USER=${2} + +if test "${NVR}" = ""; then + echo "${0} "; + exit 1; +fi + +if test "${USER}" = ""; then + echo "${0} "; + exit 2; +fi + +METADATA="{\"osci\": {\"upstream_nvr\": \"${NVR}\", \"upstream_owner_name\": \"${USER}\"}, \"rhel-target\": \"latest\"}" +rhpkg -v build --target=java-openjdk-rhel-9-build --custom-user-metadata "${METADATA}" + +# Local Variables: +# compile-command: "shellcheck build_rhel_9.sh" +# fill-column: 80 +# indent-tabs-mode: nil +# sh-basic-offset: 4 +# End: diff --git a/scripts/builds/build_rhel_portable_build.sh b/scripts/builds/build_rhel_portable_build.sh new file mode 100755 index 0000000..3fd6a22 --- /dev/null +++ b/scripts/builds/build_rhel_portable_build.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +# Copyright (C) 2024 Red Hat, Inc. +# Written by: +# Andrew John Hughes +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +# Builds the portable on RHEL 8 + +rhpkg -v build --target=java-openjdk-rhel-8-build --skip-nvr-check + +# Local Variables: +# compile-command: "shellcheck build_rhel_portable_build.sh" +# fill-column: 80 +# indent-tabs-mode: nil +# sh-basic-offset: 4 +# End: diff --git a/scripts/builds/build_vanilla.sh b/scripts/builds/build_vanilla.sh new file mode 100755 index 0000000..c4f67f7 --- /dev/null +++ b/scripts/builds/build_vanilla.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +# Copyright (C) 2024 Red Hat, Inc. +# Written by: +# Andrew John Hughes +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +# Builds a scratch build of vanilla OpenJDK with no local patches + +SEPARATE_ARCHES=${1} +CMD="--target java-openjdk-rhel-8-build --skip-nvr-check --nowait"; +SUPPORTED_ARCHES="aarch64 ppc64le s390x x86_64"; + +if [ "x${SEPARATE_ARCHES}" = "x" ] ; then + SEPARATE_ARCHES=0; +fi + +if [ ${SEPARATE_ARCHES} -eq 1 ] ; then + for arch in ${SUPPORTED_ARCHES}; do \ + rhpkg -v build --arches ${arch} --scratch ${CMD} ; \ + done && brew watch-task --mine +else + rhpkg -v build ${CMD} && brew watch-task --mine +fi + +# Local Variables: +# compile-command: "shellcheck build_vanilla.sh" +# fill-column: 80 +# indent-tabs-mode: nil +# sh-basic-offset: 4 +# End: