# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.synced_folder ".", "/vagrant", disabled: true
  config.vm.provider "virtualbox" do |v|
    v.memory = 2048
    v.cpus = 2
  end

  config.vm.define "fedora36" do |fedora36|
    fedora36.vm.box = "generic/fedora36"
    fedora36.vm.synced_folder "../../..", "/shared", type: "rsync",
      rsync__args: ["--verbose", "--archive", "-z", "--delete"]
    fedora36.vm.provision "shell", :path => "build-rpm.sh", :args => "fedora36", :privileged => false
  end

  config.vm.define "fedora37" do |fedora37|
    fedora37.vm.box = "generic/fedora37"
    fedora37.vm.synced_folder "../../..", "/shared", type: "rsync",
      rsync__args: ["--verbose", "--archive", "-z", "--delete"]
    fedora37.vm.provision "shell", :path => "build-rpm.sh", :args => "fedora37", :privileged => false
  end

  config.vm.define "centos7" do |centos7|
    centos7.vm.box = "centos/7"
    centos7.vm.synced_folder "../../..", "/shared", type: "rsync",
      rsync__args: ["--verbose", "--archive", "-z", "--copy-links"]
    centos7.vm.provision "shell", :path => "build-rpm.sh", :args => "centos7", :privileged => false
  end

  config.vm.define "debian10" do |debian10|
    debian10.vm.box = "roboxes/debian10"
    debian10.vm.synced_folder "../../..", "/shared", type: "rsync",
      rsync__args: ["--verbose", "--archive", "-z", "--delete"]
    debian10.vm.provision "shell", :path => "build-pkg.sh", :args => "debian10", :privileged => false
  end

  config.vm.define "debian11" do |debian11|
    debian11.vm.box = "generic/debian11"
    debian11.vm.synced_folder "../../..", "/shared", type: "rsync",
      rsync__args: ["--verbose", "--archive", "-z", "--delete"]
    debian11.vm.provision "shell", :path => "build-pkg.sh", :args => "debian11", :privileged => false
  end

  config.vm.define "trusty" do |trusty|
    trusty.vm.box = "ubuntu/trusty64"
    trusty.vm.synced_folder "../../..", "/shared"
    trusty.vm.provision "shell", :path => "build-pkg.sh", :args => "ubuntu1404", :privileged => false
  end

  config.vm.define "xenial" do |xenial|
    xenial.vm.box = "ubuntu/xenial64"
    xenial.vm.synced_folder "../../..", "/shared"
    xenial.vm.provision "shell", :path => "build-pkg.sh", :args => "ubuntu1604", :privileged => false
  end

  config.vm.define "bionic" do |bionic|
    bionic.vm.box = "ubuntu/bionic64"
    bionic.vm.synced_folder "../../..", "/shared"
    bionic.vm.provision "shell", :path => "build-pkg.sh", :args => "ubuntu1804", :privileged => false
  end

  config.vm.define "focal" do |focal|
    focal.vm.box = "generic/ubuntu2004"
    focal.vm.synced_folder "../../..", "/shared", type: "rsync",
      rsync__args: ["--verbose", "--archive", "-z", "--copy-links"]
    focal.vm.provision "shell", :path => "build-pkg.sh", :args => "ubuntu2004", :privileged => false
  end

  config.vm.define "jammy" do |jammy|
    jammy.vm.box = "alvistack/ubuntu-22.04"
    jammy.vm.synced_folder "../../..", "/shared", type: "rsync",
      rsync__args: ["--verbose", "--archive", "-z", "--copy-links"]
    jammy.vm.provision "shell", :path => "build-pkg.sh", :args => "ubuntu2204", :privileged => false
  end

  config.vm.define "kinetic" do |kinetic|
    kinetic.vm.box = "ubuntu/kinetic64"
    kinetic.vm.synced_folder "../../..", "/shared", type: "rsync",
      rsync__args: ["--verbose", "--archive", "-z", "--copy-links"]
    kinetic.vm.provision "shell", :path => "build-pkg.sh", :args => "ubuntu2210", :privileged => false
  end

end
