| [cc2b3c2] | 1 | # Vagrantfile to prepare virtual environment using VirtualBox provider to develop OGAgent. | 
|---|
|  | 2 |  | 
|---|
|  | 3 | VAGRANTFILE_API_VERSION = "2" | 
|---|
|  | 4 | # VM provider: Oracle VM VirtualBox. | 
|---|
|  | 5 | ENV['VAGRANT_DEFAULT_PROVIDER'] = "virtualbox" | 
|---|
|  | 6 | # Language. | 
|---|
|  | 7 | LANGUAGE = "es_ES" | 
|---|
|  | 8 | ENV['LC_ALL'] = LANGUAGE + ".UTF-8" | 
|---|
| [b32e00f] | 9 | # Amount of virtual memory and virtual CPUs. | 
|---|
| [cc2b3c2] | 10 | VMMEM = 4096 | 
|---|
|  | 11 | VMCPUS = 4 | 
|---|
|  | 12 | # OpenGnsys boot-tools environment provisioning script. | 
|---|
|  | 13 | SCRIPT = <<EOT | 
|---|
|  | 14 | # Set language. | 
|---|
|  | 15 | export LANG="#{LANGUAGE}.UTF-8" | 
|---|
| [d908628] | 16 | dnf install -y glibc-locale-source glibc-langpack-${LANG%_*} | 
|---|
| [a0f197e] | 17 | localedef -v -c -i ${LANG%.*} -f UTF-8 $LANG 2>/dev/null | 
|---|
|  | 18 | localectl set-locale LANG=$LANG | 
|---|
|  | 19 | localectl set-keymap ${LANG%_*} | 
|---|
|  | 20 | localectl set-x11-keymap ${LANG%_*} | 
|---|
| [cc2b3c2] | 21 | # Update repositories. | 
|---|
| [a0f197e] | 22 | dnf install -y http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm | 
|---|
| [cc2b3c2] | 23 | # Install main dependencies. | 
|---|
| [8db55ed] | 24 | dnf install -y gcc-c++ debhelper dpkg-dev pyqt4-devel rpm-build subversion samba-winbind wine.i686 mingw32-wine-gecko wine-mono cabextract xar | 
|---|
| [4b82beb] | 25 | setsebool -P wine_mmap_zero_ignore=on mmap_low_allowed=on | 
|---|
| [cc2b3c2] | 26 | # Install desktop (XFCE) and GUI utils. | 
|---|
| [6129d4a] | 27 | dnf install -y @xfce-desktop-environment firefox VirtualBox-guest kmod-VirtualBox akmod-VirtualBox akmods | 
|---|
| [d908628] | 28 | systemctl set-default graphical.target | 
|---|
| [a0f197e] | 29 | sed -i '$d' /usr/lib/udev/rules.d/60-vboxguest.rules | 
|---|
|  | 30 | akmods && systemctl restart systemd-modules-load.service | 
|---|
| [d908628] | 31 | # Install ATOM editor by default (less disk space). | 
|---|
|  | 32 | wget -q https://atom.io/download/rpm -O /tmp/atom.rpm && dnf install -y /tmp/atom.rpm && rm -f /tmp/atom.rpm | 
|---|
| [b32e00f] | 33 | # Comment out next line if you prefer to install Eclipse IDE for Python (it needs more disk space). | 
|---|
| [d908628] | 34 | #dnf install -y eclipse-pydev eclipse-nls-${LANG%_*} | 
|---|
| [cc2b3c2] | 35 | # Download OGAgent environment installer. | 
|---|
| [3cc5bd2] | 36 | BRANCH="devel" | 
|---|
|  | 37 | wget -qc --unlink https://raw.githubusercontent.com/opengnsys/OpenGnsys/$BRANCH/installer/ogagent-devel-installer.sh -O /home/vagrant/ogagent-devel-installer.sh | 
|---|
|  | 38 | chmod +x /home/vagrant/ogagent-devel-installer.sh | 
|---|
| [cc2b3c2] | 39 | # Instructions. | 
|---|
|  | 40 | echo "Manual operations:" | 
|---|
| [6129d4a] | 41 | echo "- Reboot VM or launch desktop: startxfce4 &" | 
|---|
| [cc2b3c2] | 42 | echo "- Enlarge VM window." | 
|---|
|  | 43 | echo "- To prepare OGAgent environment, execute: ./ogagent-devel-installer.sh" | 
|---|
| [d908628] | 44 | echo "- If you use the default Atom IDE:" | 
|---|
|  | 45 | echo "  - Open a Project located in /home/vagrant/ogagent/src directory." | 
|---|
|  | 46 | echo "- Only if you enable Eclipse IDE installation, you need to configure it before coding:" | 
|---|
| [cc2b3c2] | 47 | echo "  - Set Python interpreter on Preferences/PyDev/Interpreters/Python Interpreter." | 
|---|
| [a0f197e] | 48 | echo "  - Create a new PyDev Project located in /home/vagrant/ogagent/src directory." | 
|---|
| [cc2b3c2] | 49 | EOT | 
|---|
|  | 50 |  | 
|---|
|  | 51 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | 
|---|
|  | 52 |  | 
|---|
|  | 53 | # OpenGnsys boot-tools environment VM definition. | 
|---|
|  | 54 | config.vm.define "ogAgent" do |ag| | 
|---|
| [d908628] | 55 | ag.ssh.insert_key = false | 
|---|
| [cc2b3c2] | 56 | # Specific VirtualBox configuration. | 
|---|
|  | 57 | ag.vm.provider "virtualbox" do |vb| | 
|---|
|  | 58 | # VM name, memory and CPUs. | 
|---|
|  | 59 | vb.name = "ogAgent" | 
|---|
|  | 60 | vb.memory = VMMEM | 
|---|
|  | 61 | vb.cpus = VMCPUS | 
|---|
|  | 62 | vb.gui = true | 
|---|
|  | 63 | end | 
|---|
|  | 64 | # VM base and host name. | 
|---|
| [3cc5bd2] | 65 | ag.vm.box = "fedora/27-cloud-base" | 
|---|
| [cc2b3c2] | 66 | ag.vm.hostname = "ogAgent" | 
|---|
| [9d42c8e] | 67 | # Comment to disable synced folder. | 
|---|
|  | 68 | ag.vm.synced_folder ".", "/vagrant" | 
|---|
| [cc2b3c2] | 69 | # Launch provisioning script. | 
|---|
|  | 70 | ag.vm.provision "shell", inline: SCRIPT | 
|---|
|  | 71 | end | 
|---|
|  | 72 |  | 
|---|
|  | 73 | end | 
|---|
|  | 74 |  | 
|---|