forked from PDAL/PDAL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
118 lines (100 loc) · 3.15 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'socket'
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
config.vm.hostname = "pdal-vagrant"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.host_name = "pdal-vagrant"
# Set the bash environment variable PDAL_VAGRANT_SSH_FORWARD_AGENT to any
# value to turn on ssh forwarding. This allows you to use your host machine's
# ssh credentials inside your guest box, for example when interacting with
# private github repositories.
#
# To confirm that ssh fowarding is working, run the following from inside the
# guest machine:
#
# ssh -T git@github.com
#
# You should see something like "Hi <your name here>! You've successfully
# authenticated, but GitHub does not provide shell access."
#
# You may need to run `ssh-add` on your host machine to add your private key
# identities to the authentication agent.
if ENV['PDAL_VAGRANT_SSH_FORWARD_AGENT']
config.ssh.forward_agent = true
end
config.vm.network :forwarded_port, guest: 80, host: 8080
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "4096"]
vb.customize ["modifyvm", :id, "--cpus", "2"]
vb.customize ["modifyvm", :id, "--ioapic", "on"]
vb.name = "pdal-vagrant"
end
if RUBY_PLATFORM.include? "darwin"
config.vm.network "private_network", ip: "192.168.50.4"
config.vm.synced_folder ".", "/vagrant", nfs: true
if Socket.gethostname.include? "pyro" # Howard's machine
config.vm.synced_folder "/Users/hobu/dev/git/pointcloud", "/pointcloud", nfs: true
end
end
ppaRepos = [
"ppa:ubuntugis/ppa",
"ppa:boost-latest/ppa"
]
packageList = [
"git",
"build-essential",
"pkg-config",
"cmake",
"libgeos-dev",
"libgdal-dev",
"libpq-dev",
"python-all-dev",
"python-numpy",
"libproj-dev",
"libtiff4-dev",
"libxml2-dev",
"boost1.55",
"libbz2-dev",
"libsqlite0-dev",
"cmake-curses-gui",
"screen",
"postgis",
"libcunit1-dev",
"postgresql-server-dev-9.1",
"postgresql-9.1-postgis",
"libmsgpack-dev",
"libgeos++-dev",
"vim",
"libeigen3-dev",
"libvtk5-dev",
"libflann-dev"
];
if Dir.glob("#{File.dirname(__FILE__)}/.vagrant/machines/default/*/id").empty?
pkg_cmd = ""
pkg_cmd << "apt-get update -qq; apt-get install -q -y python-software-properties; "
if ppaRepos.length > 0
ppaRepos.each { |repo| pkg_cmd << "add-apt-repository -y " << repo << " ; " }
pkg_cmd << "apt-get update -qq; "
end
# install packages we need we need
pkg_cmd << "apt-get install -q -y " + packageList.join(" ") << " ; "
config.vm.provision :shell, :inline => pkg_cmd
scripts = [
"startup.sh",
"libgeotiff.sh",
"nitro.sh",
"hexer.sh",
"p2g.sh",
"soci.sh",
"laszip.sh",
"pcl.sh",
"pdal.sh",
"pgpointcloud.sh"
];
scripts.each { |script| config.vm.provision :shell, :path => "scripts/vagrant/" << script }
end
end