blob: 5a99127cca6b18ad218106ec0bca3b656e432897 [file] [log] [blame]
Roger Meier14ff9c82013-05-30 14:11:45 +02001# -*- mode: ruby -*-
2# vi: set ft=ruby :
3
Carl Yeksigian1ed79912013-06-03 18:29:31 -04004#
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
jfarrell9dbea362013-08-17 18:35:13 -040023$build_and_test = <<SCRIPT
24echo "Provisioning system to compile and test Apache Thrift."
Roger Meier14ff9c82013-05-30 14:11:45 +020025sudo apt-get update -qq -y
26sudo apt-get upgrade -qq -y
jfarrell9dbea362013-08-17 18:35:13 -040027
28# Install Dependencies
29# ---
30# General dependencies
jfarrell2fa3df32013-08-18 11:20:53 -040031sudo 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
jfarrell9dbea362013-08-17 18:35:13 -040032
33# Java dependencies
Roger Meier3da1c902013-11-16 15:37:20 +010034sudo apt-get install -qq ant openjdk-7-jdk
jfarrell9dbea362013-08-17 18:35:13 -040035
36# Python dependencies
37sudo apt-get install -qq python-all python-all-dev python-all-dbg python-setuptools
38
39# Ruby dependencies
40sudo apt-get install -qq ruby rubygems
41sudo gem install bundler rake
42
43# Perl dependencies
Roger Meier14ff9c82013-05-30 14:11:45 +020044sudo apt-get install -qq libbit-vector-perl
jfarrell9dbea362013-08-17 18:35:13 -040045
46# Php dependencies
jfarrell2fa3df32013-08-18 11:20:53 -040047sudo apt-get install -qq php5 php5-dev php5-cli php-pear
jfarrell9dbea362013-08-17 18:35:13 -040048
49# GlibC dependencies
Roger Meier14ff9c82013-05-30 14:11:45 +020050sudo apt-get install -qq libglib2.0-dev
jfarrell9dbea362013-08-17 18:35:13 -040051
52# Erlang dependencies
53sudo apt-get install -qq erlang-base erlang-eunit erlang-dev
54
55# GO dependencies
56echo "golang-go golang-go/dashboard boolean false" | debconf-set-selections
57sudo apt-get -y install -qq golang golang-go
58
59# Haskell dependencies
60sudo 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
63sudo apt-get install -qq npm
64
65# CSharp
Roger Meier14ff9c82013-05-30 14:11:45 +020066sudo apt-get install -qq mono-gmcs mono-devel libmono-system-web2.0-cil
Roger Meier14ff9c82013-05-30 14:11:45 +020067sudo apt-get install -qq mingw32 mingw32-binutils mingw32-runtime
jfarrell9753cde2013-06-21 14:53:39 -050068
jfarrell9dbea362013-08-17 18:35:13 -040069# Customize the system
70# ---
71# Default java to latest 1.7 version
72update-java-alternatives -s java-1.7.0-openjdk-amd64
73
jfarrell9753cde2013-06-21 14:53:39 -050074# PHPUnit package broken in ubuntu. see https://bugs.launchpad.net/ubuntu/+source/phpunit/+bug/701544
75sudo apt-get upgrade pear
76sudo pear channel-discover pear.phpunit.de
77sudo pear channel-discover pear.symfony.com
78sudo pear channel-discover components.ez.no
79sudo pear update-channels
80sudo pear upgrade-all
81sudo pear install --alldeps phpunit/PHPUnit
82
jfarrell9dbea362013-08-17 18:35:13 -040083date > /etc/vagrant.provisioned
84
85# Start the source build
86# ---
87echo "Starting Apache Thrift build..."
Carl Yeksigian1ed79912013-06-03 18:29:31 -040088cd /thrift
Roger Meier14ff9c82013-05-30 14:11:45 +020089sh bootstrap.sh
jfarrell69b02aa2013-06-20 15:40:48 -050090sh configure --without-erlang
Roger Meier14ff9c82013-05-30 14:11:45 +020091make
92make dist
93make check
jfarrell9dbea362013-08-17 18:35:13 -040094echo "Finished building Apache Thrift."
95
Roger Meier14ff9c82013-05-30 14:11:45 +020096SCRIPT
97
98Vagrant.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 Yeksigian1ed79912013-06-03 18:29:31 -0400105 config.vm.synced_folder "../", "/thrift"
106
jfarrellb6f23e82013-06-21 13:36:18 -0500107 config.vm.provider :virtualbox do |vbox|
108 vbox.customize ["modifyvm", :id, "--memory", "1024"]
109 vbox.customize ["modifyvm", :id, "--cpus", "2"]
110 end
111
Roger Meier14ff9c82013-05-30 14:11:45 +0200112 # call the script
jfarrell9dbea362013-08-17 18:35:13 -0400113 config.vm.provision :shell, :inline => $build_and_test
114
Roger Meier14ff9c82013-05-30 14:11:45 +0200115end