]>
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 \ | |
d06c1ff8 TG |
11 | desktop-file-utils groff graphviz rpmdevtools \ |
12 | kernel-devel-`uname -r` | |
b56b2566 | 13 | echo "search extra update built-in" >/etc/depmod.d/search_path.conf |
ecf68fa4 MS |
14 | cd /vagrant |
15 | ./boot.sh | |
b56b2566 AZ |
16 | SCRIPT |
17 | ||
18 | $configure_ovs = <<SCRIPT | |
19 | mkdir -p ~/build | |
20 | cd ~/build | |
21 | /vagrant/configure --with-linux=/lib/modules/`uname -r`/build | |
22 | SCRIPT | |
23 | ||
24 | $build_ovs = <<SCRIPT | |
25 | cd ~/build | |
26 | make | |
27 | SCRIPT | |
28 | ||
29 | $install_rpm = <<SCRIPT | |
30 | cd ~/build | |
31 | PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac` | |
32 | make && make dist | |
33 | rpmdev-setuptree | |
34 | cp openvswitch-$PACKAGE_VERSION.tar.gz $HOME/rpmbuild/SOURCES | |
d06c1ff8 | 35 | rpmbuild --bb -D "kversion `uname -r`" /vagrant/rhel/openvswitch-kmod-fedora.spec |
b56b2566 AZ |
36 | rpmbuild --bb --without check /vagrant/rhel/openvswitch-fedora.spec |
37 | sudo rpm -e openvswitch | |
38 | sudo rpm -ivh $HOME/rpmbuild/RPMS/x86_64/openvswitch-$PACKAGE_VERSION-1.fc20.x86_64.rpm | |
39 | sudo systemctl enable openvswitch | |
40 | sudo systemctl start openvswitch | |
41 | sudo systemctl status openvswitch | |
42 | SCRIPT | |
43 | ||
44 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
ecf68fa4 MS |
45 | config.vm.box = "chef/fedora-20" |
46 | config.vm.provision "bootstrap", type: "shell", inline: $bootstrap_fedora | |
b56b2566 AZ |
47 | config.vm.provision "configure_ovs", type: "shell", inline: $configure_ovs, privileged: false |
48 | config.vm.provision "build_ovs", type: "shell", inline: $build_ovs, privileged: false | |
49 | config.vm.provision "install_rpm", type: "shell", inline: $install_rpm, privileged: false | |
50 | end |