rpm/build_rpms.bsh: drop CentOS 5/6 Go install

Since the original introduction of the rpm/build_rpms.bsh script in
commit 4a7162777913489e7c70a3da3235dcd3eeec553b of PR #332 it has
checked for the absence of the "go" binary and, if it is not found,
installs the golang package, except on CentOS 5 where fetches and
patches a golang.spec file and then builds a local RPM using that
in order to install Go.

However, in commit b560b853a6e557195c0c68875218f45c89dce56b of PR #1298 and
in commit git-lfs/build-dockers@64a3a9fc4d of
PR git-lfs/build-dockers#3 we dropped support for CentOS 5.

And in commit 88430de792d96ec74846779aeb0530a4fb1ff49a of PR #654 we
updated our CentOS Dockerfiles (before they were moved to the
git-lfs/build-dockers repository) to download and install Go from the
googleapis.com service, and we still continue to do this but as of
commit git-lfs/build-dockers@c63850354e
in PR git-lfs/build-dockers#35 we now use the golang.org service.

This direct download obviates the logic in our rpm/build_rpms.bsh
script to install the golang package, and the special handling for
CentOS 5 is also obsolete, so we remove this logic from our script.
This commit is contained in:
Chris Darroch 2022-12-26 22:11:21 -08:00
parent 84bc27e7b3
commit 60dafc2ab6
2 changed files with 0 additions and 40 deletions

@ -42,23 +42,6 @@ $SUDO yum install -y make curl rpm-build tar bison perl-Digest-SHA
mkdir -p ${CURDIR}/{BUILD,BUILDROOT,SOURCES,RPMS,SRPMS}
if ! command -v go; then
echo "Installing go... one way or another"
if [[ ${VERSION_ID[0]} == 5 ]]; then
$SUDO yum install -y curl.x86_64 glibc gcc
${CURDIR}/golang_patch.bsh
"${RPMBUILD[@]}" -ba ${CURDIR}/SPECS/golang.spec
$SUDO yum install -y --nogpgcheck ${CURDIR}/RPMS/noarch/golang-1*.rpm \
${CURDIR}/RPMS/noarch/golang-pkg-bin-linux-amd64-1*.rpm \
${CURDIR}/RPMS/noarch/golang-src-1*.noarch.rpm \
${CURDIR}/RPMS/noarch/golang-pkg-linux-amd64-1*.noarch.rpm \
${CURDIR}/RPMS/noarch/golang-pkg-linux-386-1*.noarch.rpm
else
$SUDO yum install -y epel-release
$SUDO yum install -y golang
fi
fi
if command -v ruby > /dev/null 2>&1; then
IFS_OLD=${IFS}
IFS=.

@ -1,23 +0,0 @@
#!/usr/bin/env bash
set -eu
cd $(dirname ${BASH_SOURCE[0]})/SOURCES
#Get EPEL full list
curl -L -O https://dl.fedoraproject.org/pub/epel/fullfilelist
#Get latest golang src rpm
curl -L -O https://dl.fedoraproject.org/pub/epel/$(grep '^6/SRPMS/golang-[0-9].*src.rpm' fullfilelist)
rpm2cpio golang-*.src.rpm | cpio -diuv
#Patch the spec file to patch the build to work on CentOS 5
sed -ri 's|(^%build)|\1\nsed -i '"'"'s:.*--build-id.*::'"'"' ./src/cmd/go/build.go|' golang*.spec
#Make SPEC CentOS 5 compliant
sed -ri 's|(^Name:.*)|\1\nGroup: Software|' golang.spec
sed -ri 's|(^Name:.*)|\1\nBuildRoot: %(echo %{_topdir}/BUILDROOT/%{name}-%{version})|' golang.spec
sed -ri 's|(^%package\s.*)|\1\nGroup: Software|' golang.spec
sed -i 's|%ifarch %{ix86}|%if %_arch == i686|' golang.spec
sed -i 's|%ifarch %{arm}|%if %_arch == armv6l|' golang.spec
sed -i 's|%ifarch|%if %_arch ==|' golang.spec
#The test WILL fail, so make the rpm not fail
sed -ri 's;(.*run.bash.*);\1|true;' golang.spec
mv golang.spec ../SPECS/