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