Roger Meier | 14ff9c8 | 2013-05-30 14:11:45 +0200 | [diff] [blame] | 1 | # -*- mode: ruby -*- |
| 2 | # vi: set ft=ruby : |
| 3 | |
Carl Yeksigian | 1ed7991 | 2013-06-03 18:29:31 -0400 | [diff] [blame] | 4 | # |
| 5 | # Licensed to the Apache Software Foundation (ASF) under one |
| 6 | # or more contributor license agreements. See the NOTICE file |
| 7 | # distributed with this work for additional information |
| 8 | # regarding copyright ownership. The ASF licenses this file |
| 9 | # to you under the Apache License, Version 2.0 (the |
| 10 | # "License"); you may not use this file except in compliance |
| 11 | # with the License. You may obtain a copy of the License at |
| 12 | # |
| 13 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 14 | # |
| 15 | # Unless required by applicable law or agreed to in writing, |
| 16 | # software distributed under the License is distributed on an |
| 17 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 18 | # KIND, either express or implied. See the License for the |
| 19 | # specific language governing permissions and limitations |
| 20 | # under the License. |
| 21 | # |
| 22 | |
jfarrell | 9dbea36 | 2013-08-17 18:35:13 -0400 | [diff] [blame] | 23 | $build_and_test = <<SCRIPT |
| 24 | echo "Provisioning system to compile and test Apache Thrift." |
Roger Meier | 14ff9c8 | 2013-05-30 14:11:45 +0200 | [diff] [blame] | 25 | sudo apt-get update -qq -y |
| 26 | sudo apt-get upgrade -qq -y |
jfarrell | 9dbea36 | 2013-08-17 18:35:13 -0400 | [diff] [blame] | 27 | |
| 28 | # Install Dependencies |
| 29 | # --- |
| 30 | # General dependencies |
jfarrell | 2fa3df3 | 2013-08-18 11:20:53 -0400 | [diff] [blame] | 31 | sudo apt-get install -qq libboost-dev libboost-test-dev libboost-program-options-dev libevent-dev automake libtool flex bison pkg-config g++ libssl-dev make libqt4-dev git debhelper |
jfarrell | 9dbea36 | 2013-08-17 18:35:13 -0400 | [diff] [blame] | 32 | |
| 33 | # Java dependencies |
jfarrell | 2fa3df3 | 2013-08-18 11:20:53 -0400 | [diff] [blame] | 34 | sudo apt-get install -qq ant openjdk-7-jdk libcommons-lang3-java |
jfarrell | 9dbea36 | 2013-08-17 18:35:13 -0400 | [diff] [blame] | 35 | |
| 36 | # Python dependencies |
| 37 | sudo apt-get install -qq python-all python-all-dev python-all-dbg python-setuptools |
| 38 | |
| 39 | # Ruby dependencies |
| 40 | sudo apt-get install -qq ruby rubygems |
| 41 | sudo gem install bundler rake |
| 42 | |
| 43 | # Perl dependencies |
Roger Meier | 14ff9c8 | 2013-05-30 14:11:45 +0200 | [diff] [blame] | 44 | sudo apt-get install -qq libbit-vector-perl |
jfarrell | 9dbea36 | 2013-08-17 18:35:13 -0400 | [diff] [blame] | 45 | |
| 46 | # Php dependencies |
jfarrell | 2fa3df3 | 2013-08-18 11:20:53 -0400 | [diff] [blame] | 47 | sudo apt-get install -qq php5 php5-dev php5-cli php-pear |
jfarrell | 9dbea36 | 2013-08-17 18:35:13 -0400 | [diff] [blame] | 48 | |
| 49 | # GlibC dependencies |
Roger Meier | 14ff9c8 | 2013-05-30 14:11:45 +0200 | [diff] [blame] | 50 | sudo apt-get install -qq libglib2.0-dev |
jfarrell | 9dbea36 | 2013-08-17 18:35:13 -0400 | [diff] [blame] | 51 | |
| 52 | # Erlang dependencies |
| 53 | sudo apt-get install -qq erlang-base erlang-eunit erlang-dev |
| 54 | |
| 55 | # GO dependencies |
| 56 | echo "golang-go golang-go/dashboard boolean false" | debconf-set-selections |
| 57 | sudo apt-get -y install -qq golang golang-go |
| 58 | |
| 59 | # Haskell dependencies |
| 60 | sudo apt-get install -qq ghc6 cabal-install libghc6-binary-dev libghc6-network-dev libghc6-http-dev libghc-hashable-dev libghc-unordered-containers-dev libghc-vector-dev |
| 61 | |
| 62 | # Node.js dependencies |
| 63 | sudo apt-get install -qq npm |
| 64 | |
| 65 | # CSharp |
Roger Meier | 14ff9c8 | 2013-05-30 14:11:45 +0200 | [diff] [blame] | 66 | sudo apt-get install -qq mono-gmcs mono-devel libmono-system-web2.0-cil |
Roger Meier | 14ff9c8 | 2013-05-30 14:11:45 +0200 | [diff] [blame] | 67 | sudo apt-get install -qq mingw32 mingw32-binutils mingw32-runtime |
jfarrell | 9753cde | 2013-06-21 14:53:39 -0500 | [diff] [blame] | 68 | |
jfarrell | 9dbea36 | 2013-08-17 18:35:13 -0400 | [diff] [blame] | 69 | # Customize the system |
| 70 | # --- |
| 71 | # Default java to latest 1.7 version |
| 72 | update-java-alternatives -s java-1.7.0-openjdk-amd64 |
| 73 | |
jfarrell | 9753cde | 2013-06-21 14:53:39 -0500 | [diff] [blame] | 74 | # PHPUnit package broken in ubuntu. see https://bugs.launchpad.net/ubuntu/+source/phpunit/+bug/701544 |
| 75 | sudo apt-get upgrade pear |
| 76 | sudo pear channel-discover pear.phpunit.de |
| 77 | sudo pear channel-discover pear.symfony.com |
| 78 | sudo pear channel-discover components.ez.no |
| 79 | sudo pear update-channels |
| 80 | sudo pear upgrade-all |
| 81 | sudo pear install --alldeps phpunit/PHPUnit |
| 82 | |
jfarrell | 9dbea36 | 2013-08-17 18:35:13 -0400 | [diff] [blame] | 83 | date > /etc/vagrant.provisioned |
| 84 | |
| 85 | # Start the source build |
| 86 | # --- |
| 87 | echo "Starting Apache Thrift build..." |
Carl Yeksigian | 1ed7991 | 2013-06-03 18:29:31 -0400 | [diff] [blame] | 88 | cd /thrift |
Roger Meier | 14ff9c8 | 2013-05-30 14:11:45 +0200 | [diff] [blame] | 89 | sh bootstrap.sh |
jfarrell | 69b02aa | 2013-06-20 15:40:48 -0500 | [diff] [blame] | 90 | sh configure --without-erlang |
Roger Meier | 14ff9c8 | 2013-05-30 14:11:45 +0200 | [diff] [blame] | 91 | make |
| 92 | make dist |
| 93 | make check |
jfarrell | 9dbea36 | 2013-08-17 18:35:13 -0400 | [diff] [blame] | 94 | echo "Finished building Apache Thrift." |
| 95 | |
Roger Meier | 14ff9c8 | 2013-05-30 14:11:45 +0200 | [diff] [blame] | 96 | SCRIPT |
| 97 | |
| 98 | Vagrant.configure("2") do |config| |
| 99 | # Ubuntu 12.04 LTS (Precise Pangolin) |
| 100 | config.vm.box = "precise64" |
| 101 | config.vm.box_url = "http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-vagrant-amd64-disk1.box" |
| 102 | # config.vm.box = "precise32" |
| 103 | # config.vm.box_url = "http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-vagrant-i386-disk1.box" |
| 104 | |
Carl Yeksigian | 1ed7991 | 2013-06-03 18:29:31 -0400 | [diff] [blame] | 105 | config.vm.synced_folder "../", "/thrift" |
| 106 | |
jfarrell | b6f23e8 | 2013-06-21 13:36:18 -0500 | [diff] [blame] | 107 | config.vm.provider :virtualbox do |vbox| |
| 108 | vbox.customize ["modifyvm", :id, "--memory", "1024"] |
| 109 | vbox.customize ["modifyvm", :id, "--cpus", "2"] |
| 110 | end |
| 111 | |
Roger Meier | 14ff9c8 | 2013-05-30 14:11:45 +0200 | [diff] [blame] | 112 | # call the script |
jfarrell | 9dbea36 | 2013-08-17 18:35:13 -0400 | [diff] [blame] | 113 | config.vm.provision :shell, :inline => $build_and_test |
| 114 | |
Roger Meier | 14ff9c8 | 2013-05-30 14:11:45 +0200 | [diff] [blame] | 115 | end |