Vagrantfile 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # -*- mode: ruby -*-
  2. # vi: set ft=ruby :
  3. $setup = <<SCRIPT
  4. apt-get update
  5. apt-get install -y git autoconf libtool make valgrind libpq-dev
  6. URL=https://sourceforge.net/projects/levent/files/libevent
  7. LIB=libevent-2.0
  8. VER=22-stable
  9. wget -q $URL/$LIB/$LIB.$VER.tar.gz && tar -zxf $LIB.$VER.tar.gz
  10. cd $LIB.$VER/ && ./autogen.sh && ./configure -q && make -s
  11. sudo make install && cd .. && rm -rf $LIB.$VER*
  12. SRC=vagrant
  13. DST=wolfssl
  14. cp -rp /$SRC/ $DST/
  15. echo "cd $DST" >> .bashrc
  16. echo "read -p 'Sync $DST? (y/n) ' -n 1 -r" >> .bashrc
  17. echo "echo # new line" >> .bashrc
  18. echo 'if [[ \$REPLY =~ ^[Yy]$ ]]; then' >> .bashrc
  19. echo " echo -e '\e[0;32mRunning $DST sync\e[0m'" >> .bashrc
  20. echo " ./pull_to_vagrant.sh" >> .bashrc
  21. echo "fi" >> .bashrc
  22. cd $DST
  23. ./autogen.sh
  24. ./configure
  25. make check
  26. cd ..
  27. chown -hR vagrant:vagrant $DST/ /tmp/output
  28. SCRIPT
  29. VAGRANTFILE_API_VERSION = "2"
  30. Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  31. config.vm.box = "hashicorp/precise64"
  32. config.vm.provision "shell", inline: $setup
  33. config.vm.network "forwarded_port", guest: 11111, host: 33333
  34. end