]> git.proxmox.com Git - mirror_ovs.git/blob - Vagrantfile
doc: v2: fix bad link to dpdk advance installation guide
[mirror_ovs.git] / Vagrantfile
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 Vagrant.require_version ">=1.7.0"
7
8 $bootstrap_fedora = <<SCRIPT
9 dnf -y update
10 dnf -y install autoconf automake openssl-devel libtool \
11 python-twisted-core python-zope-interface \
12 desktop-file-utils groff graphviz rpmdevtools nc \
13 wget python-six pyftpdlib checkpolicy selinux-policy-devel \
14 libcap-ng-devel kernel-devel-`uname -r` ethtool
15 echo "search extra update built-in" >/etc/depmod.d/search_path.conf
16 SCRIPT
17
18 $bootstrap_debian = <<SCRIPT
19 aptitude -y update
20 aptitude -y upgrade
21 aptitude -y install -R \
22 build-essential dpkg-dev lintian devscripts fakeroot \
23 debhelper dh-autoreconf uuid-runtime \
24 autoconf automake libtool \
25 python-all python-twisted-core python-twisted-conch \
26 xdg-utils groff graphviz netcat \
27 wget python-six ethtool \
28 libcap-ng-dev libssl-dev python-dev openssl \
29 python-pyftpdlib python-flake8 \
30 linux-headers-`uname -r`
31 SCRIPT
32
33 $bootstrap_centos = <<SCRIPT
34 yum -y update
35 yum -y install autoconf automake openssl-devel libtool \
36 python-twisted-core python-zope-interface \
37 desktop-file-utils groff graphviz rpmdevtools nc \
38 wget python-six pyftpdlib checkpolicy selinux-policy-devel \
39 libcap-ng-devel kernel-devel-`uname -r` ethtool
40 SCRIPT
41
42 $configure_ovs = <<SCRIPT
43 cd /vagrant
44 ./boot.sh
45 [ -f Makefile ] && ./configure && make distclean
46 mkdir -p ~/build
47 cd ~/build
48 /vagrant/configure --with-linux=/lib/modules/`uname -r`/build --enable-silent-rules
49 SCRIPT
50
51 $build_ovs = <<SCRIPT
52 cd ~/build
53 make
54 SCRIPT
55
56 $test_kmod = <<SCRIPT
57 cd ~/build
58 make check-kmod RECHECK=yes
59 SCRIPT
60
61 $install_rpm = <<SCRIPT
62 cd ~/build
63 PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac`
64 make && make dist
65 rpmdev-setuptree
66 cp openvswitch-$PACKAGE_VERSION.tar.gz $HOME/rpmbuild/SOURCES
67 rpmbuild --bb -D "kversion `uname -r`" /vagrant/rhel/openvswitch-kmod-fedora.spec
68 rpmbuild --bb --without check /vagrant/rhel/openvswitch-fedora.spec
69 rpm -e openvswitch
70 rpm -ivh $HOME/rpmbuild/RPMS/x86_64/openvswitch-$PACKAGE_VERSION-1.fc23.x86_64.rpm
71 systemctl enable openvswitch
72 systemctl start openvswitch
73 systemctl status openvswitch
74 SCRIPT
75
76 $install_centos_rpm = <<SCRIPT
77 cd ~/build
78 PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac`
79 make && make dist
80 rpmdev-setuptree
81 cp openvswitch-$PACKAGE_VERSION.tar.gz $HOME/rpmbuild/SOURCES
82 rpmbuild --bb -D "kversion `uname -r`" /vagrant/rhel/openvswitch-kmod-rhel6.spec
83 rpmbuild --bb --without check /vagrant/rhel/openvswitch.spec
84 rpm -e openvswitch
85 rpm -ivh $HOME/rpmbuild/RPMS/x86_64/openvswitch-$PACKAGE_VERSION-1.x86_64.rpm
86 systemctl enable openvswitch
87 systemctl start openvswitch
88 systemctl status openvswitch
89 SCRIPT
90
91 $install_deb = <<SCRIPT
92 cd ~/build
93 PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac`
94 make dist
95 cd ~/
96 ln -sf ~/build/openvswitch-$PACKAGE_VERSION.tar.gz openvswitch_$PACKAGE_VERSION.orig.tar.gz
97 rm -rf ~/openvswitch-$PACKAGE_VERSION
98 tar xzf openvswitch_$PACKAGE_VERSION.orig.tar.gz
99 cd ~/openvswitch-$PACKAGE_VERSION
100 debuild -us -uc
101 dpkg -i ../openvswitch-{common,switch}*deb
102 systemctl enable openvswitch-switch
103 systemctl start openvswitch-switch
104 systemctl status openvswitch-switch
105 SCRIPT
106
107 $test_ovs_system_userspace = <<SCRIPT
108 cd ~/build
109 make check-system-userspace RECHECK=yes
110 SCRIPT
111
112 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
113 config.vm.define "debian-8" do |debian|
114 debian.vm.box = "debian/jessie64"
115 debian.vm.synced_folder ".", "/vagrant", type: "rsync"
116 debian.vm.provision "bootstrap", type: "shell", inline: $bootstrap_debian
117 debian.vm.provision "configure_ovs", type: "shell", inline: $configure_ovs
118 debian.vm.provision "build_ovs", type: "shell", inline: $build_ovs
119 debian.vm.provision "test_ovs_kmod", type: "shell", inline: $test_kmod
120 debian.vm.provision "test_ovs_system_userspace", type: "shell", inline: $test_ovs_system_userspace
121 debian.vm.provision "install_deb", type: "shell", inline: $install_deb
122 end
123 config.vm.define "fedora-23" do |fedora|
124 fedora.vm.box = "bento/fedora-23"
125 fedora.vm.provision "bootstrap", type: "shell", inline: $bootstrap_fedora
126 fedora.vm.provision "configure_ovs", type: "shell", inline: $configure_ovs
127 fedora.vm.provision "build_ovs", type: "shell", inline: $build_ovs
128 fedora.vm.provision "test_ovs_kmod", type: "shell", inline: $test_kmod
129 fedora.vm.provision "test_ovs_system_userspace", type: "shell", inline: $test_ovs_system_userspace
130 fedora.vm.provision "install_rpm", type: "shell", inline: $install_rpm
131 end
132 config.vm.define "centos-7.2" do |centos|
133 centos.vm.box = "bento/centos-7.2"
134 centos.vm.synced_folder ".", "/vagrant", type: "rsync"
135 centos.vm.provision "bootstrap", type: "shell", inline: $bootstrap_centos
136 centos.vm.provision "configure_ovs", type: "shell", inline: $configure_ovs
137 centos.vm.provision "build_ovs", type: "shell", inline: $build_ovs
138 centos.vm.provision "test_ovs_kmod", type: "shell", inline: $test_kmod
139 centos.vm.provision "test_ovs_system_userspace", type: "shell", inline: $test_ovs_system_userspace
140 centos.vm.provision "install_rpm", type: "shell", inline: $install_centos_rpm
141 end
142 end