]>
Commit | Line | Data |
---|---|---|
b56b2566 AZ |
1 | # -*- mode: ruby -*- |
2 | # vi: set ft=ruby : | |
3 | ||
4 | # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
5 | VAGRANTFILE_API_VERSION = "2" | |
6 | ||
7 | $bootstrap_fedora = <<SCRIPT | |
8 | yum -y update | |
9 | yum -y install autoconf automake openssl-devel libtool \ | |
10 | python-twisted-core python-zope-interface PyQt4 \ | |
11 | desktop-file-utils groff graphviz rpmdevtools | |
12 | echo "search extra update built-in" >/etc/depmod.d/search_path.conf | |
ecf68fa4 MS |
13 | cd /vagrant |
14 | ./boot.sh | |
b56b2566 AZ |
15 | SCRIPT |
16 | ||
17 | $configure_ovs = <<SCRIPT | |
18 | mkdir -p ~/build | |
19 | cd ~/build | |
20 | /vagrant/configure --with-linux=/lib/modules/`uname -r`/build | |
21 | SCRIPT | |
22 | ||
23 | $build_ovs = <<SCRIPT | |
24 | cd ~/build | |
25 | make | |
26 | SCRIPT | |
27 | ||
28 | $install_rpm = <<SCRIPT | |
29 | cd ~/build | |
30 | PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac` | |
31 | make && make dist | |
32 | rpmdev-setuptree | |
33 | cp openvswitch-$PACKAGE_VERSION.tar.gz $HOME/rpmbuild/SOURCES | |
34 | rpmbuild --bb --without check /vagrant/rhel/openvswitch-fedora.spec | |
35 | sudo rpm -e openvswitch | |
36 | sudo rpm -ivh $HOME/rpmbuild/RPMS/x86_64/openvswitch-$PACKAGE_VERSION-1.fc20.x86_64.rpm | |
37 | sudo systemctl enable openvswitch | |
38 | sudo systemctl start openvswitch | |
39 | sudo systemctl status openvswitch | |
40 | SCRIPT | |
41 | ||
42 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
ecf68fa4 MS |
43 | config.vm.box = "chef/fedora-20" |
44 | config.vm.provision "bootstrap", type: "shell", inline: $bootstrap_fedora | |
b56b2566 AZ |
45 | config.vm.provision "configure_ovs", type: "shell", inline: $configure_ovs, privileged: false |
46 | config.vm.provision "build_ovs", type: "shell", inline: $build_ovs, privileged: false | |
47 | config.vm.provision "install_rpm", type: "shell", inline: $install_rpm, privileged: false | |
48 | end |