diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2016-01-12 11:52:40 -0500 |
---|---|---|
committer | Jason Carey <jcarey@argv.me> | 2016-03-07 19:10:05 -0500 |
commit | 42c2e03063e1f918f759f48da143575b17b93706 (patch) | |
tree | 8ed7bd454168484ad0636b5711dddce8d41dc973 /buildscripts | |
parent | d4f12cbf84c857943961cc5f973a4286b42c940e (diff) | |
download | mongo-42c2e03063e1f918f759f48da143575b17b93706.tar.gz |
SERVER-22111 packager.py - Add support for ubuntu1504 on ppc64le
(cherry picked from commit 5d3eaacef4f0d019799be993713affcea5e309c0)
Diffstat (limited to 'buildscripts')
-rwxr-xr-x | buildscripts/packager-enterprise.py | 22 | ||||
-rwxr-xr-x | buildscripts/packager.py | 20 |
2 files changed, 30 insertions, 12 deletions
diff --git a/buildscripts/packager-enterprise.py b/buildscripts/packager-enterprise.py index 23985671446..fa0e538334c 100755 --- a/buildscripts/packager-enterprise.py +++ b/buildscripts/packager-enterprise.py @@ -41,9 +41,6 @@ import tempfile import time import urlparse -# The MongoDB names for the architectures we support. -DEFAULT_ARCHES=["x86_64"] - # Made up names for the flavors of distribution we package for. DISTROS=["suse", "debian","redhat","ubuntu","amazon"] @@ -105,15 +102,20 @@ class EnterpriseDistro(packager.Distro): else: raise Exception("BUG: unsupported platform?") - def build_os(self): + def build_os(self, arch): """Return the build os label in the binary package to download ("rhel57", "rhel62" and "rhel70" for redhat, the others are delegated to the super class """ + if arch == "ppc64le": + if self.n == 'ubuntu': + return [ "ubuntu1504" ] + else: + return [] if re.search("(redhat|fedora|centos)", self.n): return [ "rhel70", "rhel62", "rhel57" ] else: - return super(EnterpriseDistro, self).build_os() + return super(EnterpriseDistro, self).build_os(arch) def main(argv): @@ -138,12 +140,13 @@ def main(argv): try: # Download the binaries. urlfmt="http://downloads.mongodb.com/linux/mongodb-linux-%s-enterprise-%s-%s.tgz" + made_pkg = False # Build a package for each distro/spec/arch tuple, and # accumulate the repository-layout directories. for (distro, arch) in packager.crossproduct(distros, args.arches): - for build_os in distro.build_os(): + for build_os in distro.build_os(arch): if build_os in args.distros or not args.distros: if args.tarball: @@ -156,6 +159,11 @@ def main(argv): repo = make_package(distro, build_os, arch, spec, srcdir) make_repo(repo, distro, build_os, spec) + made_pkg = True + + if not made_pkg: + raise Exception("No valid combination of distro and arch selected") + finally: os.chdir(oldcwd) @@ -250,7 +258,7 @@ def make_deb_repo(repo, distro, build_os, spec): Label: mongodb Suite: %s Codename: %s/mongodb-enterprise -Architectures: amd64 +Architectures: amd64 ppc64el Components: %s Description: MongoDB packages """ % (distro.repo_os_version(build_os), distro.repo_os_version(build_os), distro.repo_component()) diff --git a/buildscripts/packager.py b/buildscripts/packager.py index d601e8e85ce..27e55f5b8e7 100755 --- a/buildscripts/packager.py +++ b/buildscripts/packager.py @@ -42,7 +42,7 @@ import time import urlparse # The MongoDB names for the architectures we support. -DEFAULT_ARCHES=["x86_64"] +ARCH_CHOICES=["x86_64", "ppc64le"] # Made up names for the flavors of distribution we package for. DISTROS=["suse", "debian","redhat","ubuntu", "amazon"] @@ -133,8 +133,12 @@ class Distro(object): def archname(self, arch): if re.search("^(debian|ubuntu)", self.n): + if arch == "ppc64le": + return "ppc64el" return "i386" if arch.endswith("86") else "amd64" elif re.search("^(suse|centos|redhat|fedora|amazon)", self.n): + if arch == "ppc64le": + return "ppc64le" return "i686" if arch.endswith("86") else "x86_64" else: raise Exception("BUG: unsupported platform?") @@ -205,6 +209,8 @@ class Distro(object): return "precise" elif build_os == 'ubuntu1404': return "trusty" + elif build_os == 'ubuntu1504': + return "vivid" else: raise Exception("unsupported build_os: %s" % build_os) elif self.n == 'debian': @@ -223,10 +229,13 @@ class Distro(object): else: raise Exception("BUG: unsupported platform?") - def build_os(self): + def build_os(self, arch): """Return the build os label in the binary package to download ("rhel55", "rhel62" and "rhel70" for redhat, "ubuntu1204" and "ubuntu1404" for Ubuntu, "debian71" for Debian), and "suse11" for SUSE)""" + # Community builds only support amd64 + if not arch == "x86_64": + raise Exception("BUG: unsupported architecture") if re.search("(suse)", self.n): return [ "suse11", "suse12" ] @@ -254,7 +263,8 @@ def get_args(distros): DISTRO_CHOICES=[] for distro in distros: - DISTRO_CHOICES.extend(distro.build_os()) + for arch in ARCH_CHOICES: + DISTRO_CHOICES.extend(distro.build_os(arch)) parser = argparse.ArgumentParser(description='Build MongoDB Packages') parser.add_argument("-s", "--server-version", help="Server version to build (e.g. 2.7.8-rc0)", required=True) @@ -262,7 +272,7 @@ def get_args(distros): parser.add_argument("-r", "--release-number", help="RPM release number base", type=int, required=False) parser.add_argument("-d", "--distros", help="Distros to build for", choices=DISTRO_CHOICES, required=False, default=[], action='append') parser.add_argument("-p", "--prefix", help="Directory to build into", required=False) - parser.add_argument("-a", "--arches", help="Architecture to build", choices=DEFAULT_ARCHES, default=DEFAULT_ARCHES, required=False, action='append') + parser.add_argument("-a", "--arches", help="Architecture to build", choices=ARCH_CHOICES, default=[], required=False, action='append') parser.add_argument("-t", "--tarball", help="Local tarball to package instead of downloading (only valid with one distro/arch combination)", required=False, type=lambda x: is_valid_file(parser, x)) args = parser.parse_args() @@ -299,7 +309,7 @@ def main(argv): # accumulate the repository-layout directories. for (distro, arch) in crossproduct(distros, args.arches): - for build_os in distro.build_os(): + for build_os in distro.build_os(arch): if build_os in args.distros or not args.distros: if args.tarball: |