Bug 774112 - Part 2: Implement bootstrap support for popular Linux distros; r=gps
authorkmm <kmm357@gmail.com>
Tue, 11 Sep 2012 16:27:26 -0700
changeset 113151 ac75030f29a7a5f570f3d3d89c81a6d7adb426a5
parent 113150 544c405fb456b4cfdc102cbe14d704c4ead17ae0
child 113152 58338ee54795dffc0e22bd40bf0df510bbf7fe58
push id1708
push userakeybl@mozilla.com
push dateMon, 19 Nov 2012 21:10:21 +0000
treeherdermozilla-beta@27b14fe50103 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs774112
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 774112 - Part 2: Implement bootstrap support for popular Linux distros; r=gps
python/mozboot/mozboot/bootstrap.py
python/mozboot/mozboot/centos.py
python/mozboot/mozboot/fedora.py
python/mozboot/mozboot/mint.py
python/mozboot/mozboot/ubuntu.py
--- a/python/mozboot/mozboot/bootstrap.py
+++ b/python/mozboot/mozboot/bootstrap.py
@@ -1,30 +1,39 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import platform
 import sys
 
+from mozboot.centos import CentOSBootstrapper
+from mozboot.fedora import FedoraBootstrapper
+from mozboot.mint import MintBootstrapper
 from mozboot.osx import OSXBootstrapper
 from mozboot.ubuntu import UbuntuBootstrapper
 
 
 class Bootstrapper(object):
     """Main class that performs system bootstrap."""
 
     def bootstrap(self):
         cls = None
         args = {}
 
         if sys.platform.startswith('linux'):
             distro, version, dist_id = platform.linux_distribution()
 
-            if distro == 'Ubuntu':
+            if distro == 'CentOS':
+                cls = CentOSBootstrapper
+            elif distro == 'Fedora':
+                cls = FedoraBootstrapper
+            elif distro == 'Mint':
+                cls = MintBootstrapper
+            elif distro == 'Ubuntu':
                 cls = UbuntuBootstrapper
             else:
                 raise NotImplementedError('Bootstrap support for this Linux '
                                           'distro not yet available.')
 
             args['version'] = version
             args['dist_id'] = dist_id
 
new file mode 100644
--- /dev/null
+++ b/python/mozboot/mozboot/centos.py
@@ -0,0 +1,30 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this file,
+# You can obtain one at http://mozilla.org/MPL/2.0/.
+
+import os
+import platform
+
+from mozboot.base import BaseBootstrapper
+
+class CentOSBootstrapper(BaseBootstrapper):
+    def __init__(self, version, dist_id):
+        BaseBootstrapper.__init__(self)
+
+        self.version = version
+        self.dist_id = dist_id
+
+    def install_system_packages(self):
+        kern = platform.uname()
+        os.system("sudo yum groupinstall 'Development Tools' 'Development Libraries' 'GNOME Software Development'")
+        os.system("sudo yum install mercurial autoconf213 glibc-static libstdc++-static yasm wireless-tools-devel mesa-libGL-devel alsa-lib-devel libXt-devel")
+        os.system("sudo yum install gtk2-devel")
+        os.system("sudo yum install dbus-glib-devel")
+
+        if ('x86_64' in kern[2]):
+            os.system("sudo rpm -ivh http://pkgs.repoforge.org/yasm/yasm-1.1.0-1.el6.rf.x86_64.rpm")
+        else:
+            os.system("sudo rpm -ivh http://pkgs.repoforge.org/yasm/yasm-1.1.0-1.el6.rf.i686.rpm")
+
+        os.system("sudo yum install curl-devel")
+
new file mode 100644
--- /dev/null
+++ b/python/mozboot/mozboot/fedora.py
@@ -0,0 +1,18 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this file,
+# You can obtain one at http://mozilla.org/MPL/2.0/.
+
+import os
+
+from mozboot.base import BaseBootstrapper
+
+class FedoraBootstrapper(BaseBootstrapper):
+    def __init__(self, version, dist_id):
+        BaseBootstrapper.__init__(self)
+
+        self.version = version
+        self.dist_id = dist_id
+
+    def install_system_packages(self):
+        os.system("sudo yum groupinstall 'Development Tools' 'Development Libraries' 'GNOME Software Development'")
+        os.system("sudo yum install mercurial autoconf213 glibc-static libstdc++-static yasm wireless-tools-devel mesa-libGL-devel alsa-lib-devel libXt-devel")
new file mode 100644
--- /dev/null
+++ b/python/mozboot/mozboot/mint.py
@@ -0,0 +1,18 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this file,
+# You can obtain one at http://mozilla.org/MPL/2.0/.
+
+import os
+
+from mozboot.base import BaseBootstrapper
+
+class MintBootstrapper(BaseBootstrapper):
+    def __init__(self, version, dist_id):
+        BaseBootstrapper.__init__(self)
+
+        self.version = version
+        self.dist_id = dist_id
+
+    def install_system_packages(self):
+        os.system("sudo apt-get build-dep firefox")
+        os.system("sudo apt-get install mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev libxt-dev libiw-dev mesa-common-dev autoconf2.13 yasm uuid")
--- a/python/mozboot/mozboot/ubuntu.py
+++ b/python/mozboot/mozboot/ubuntu.py
@@ -1,15 +1,18 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
+import os
+
 from mozboot.base import BaseBootstrapper
 
 class UbuntuBootstrapper(BaseBootstrapper):
     def __init__(self, version, dist_id):
         BaseBootstrapper.__init__(self)
 
         self.version = version
         self.dist_id = dist_id
 
     def install_system_packages(self):
-        raise NotImplementedError('Bootstrap for Ubuntu not yet implemented.')
+        os.system("sudo apt-get build-dep firefox")
+        os.system("sudo apt-get install mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev libxt-dev libiw-dev mesa-common-dev autoconf2.13 yasm uuid")