summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Chen <john.chen@mongodb.com>2019-11-14 15:34:43 +0000
committerevergreen <evergreen@mongodb.com>2019-11-14 15:34:43 +0000
commit0c099ddadccc4faafd0a90e4b5711e89755d1d7a (patch)
treee730d30af78a40ce70070cfe02dfc697c2692bc6
parent77ee1adf0405b5b3e95030dd8f57a4562121ace7 (diff)
downloadmongo-0c099ddadccc4faafd0a90e4b5711e89755d1d7a.tar.gz
SERVER-37769 Platform Support: SUSE15
(cherry picked from commit 2bb9313de4c53d31051e30af49a1ead10535e5d2) (cherry picked from commit f9a18c73435b292d7937401e9ded361b38742559)
-rwxr-xr-xbuildscripts/packager.py25
1 files changed, 20 insertions, 5 deletions
diff --git a/buildscripts/packager.py b/buildscripts/packager.py
index a43ba2e588b..8121d7b8601 100755
--- a/buildscripts/packager.py
+++ b/buildscripts/packager.py
@@ -727,13 +727,28 @@ def make_rpm(distro, build_os, arch, spec, srcdir):
# Do the build.
flags.extend(["-D", "dynamic_version " + spec.pversion(distro), "-D", "dynamic_release " + spec.prelease(), "-D", "_topdir " + topdir])
- sysassert(["rpmbuild", "-ba", "--target", distro_arch] + flags + ["%s/SPECS/mongodb%s.spec" % (topdir, suffix)])
- r=distro.repodir(arch, build_os, spec)
- ensure_dir(r)
+
+ # Versions of RPM after 4.4 ignore our BuildRoot tag so we need to
+ # specify it on the command line args to rpmbuild
+ #
+ # Current versions of RHEL at the time of this writing (RHEL < 8) patch in
+ # the old behavior so that our BuildRoot tag still works on these versions.
+ #
+ # Probably need to add RHEL 8 to this when we start building for it
+ if distro.name() == "suse" and distro.repo_os_version(build_os) == "15":
+ flags.extend([
+ "--buildroot", os.path.join(topdir, "BUILDROOT"),
+ ])
+
+ sysassert(["rpmbuild", "-ba", "--target", distro_arch] + flags +
+ ["%s/SPECS/mongodb%s.spec" % (topdir, suffix)])
+ repo_dir = distro.repodir(arch, build_os, spec)
+ ensure_dir(repo_dir)
+
# FIXME: see if some combination of shutil.copy<hoohah> and glob
# can do this without shelling out.
- sysassert(["sh", "-c", "cp -v \"%s/RPMS/%s/\"*.rpm \"%s\""%(topdir, distro_arch, r)])
- return r
+ sysassert(["sh", "-c", "cp -v \"%s/RPMS/%s/\"*.rpm \"%s\""%(topdir, distro_arch, repo_dir)])
+ return repo_dir
def make_rpm_repo(repo):
oldpwd=os.getcwd()