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