-
Notifications
You must be signed in to change notification settings - Fork 104
/
zproject_vagrant.gsl
88 lines (74 loc) · 2.28 KB
/
zproject_vagrant.gsl
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
# Generate vagrantfile for project
#
# This is a code generator built using the iMatix GSL code generation
# language. See https://github.com/zeromq/gsl for details.
#
# Copyright (c) the Contributors as noted in the AUTHORS file.
# This file is part of zproject.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
register_target ("vagrant", "packaging for Vagrant")
.macro generate_vagrant_file ()
.output "Vagrantfile"
#e -*- mode: ruby -*-
# vi: set ft=ruby :
# This will setup a clean Ubuntu1404 LTS env
$script = <<SCRIPT
apt-get update
apt-get install -y python-pip python-dev git htop virtualenvwrapper python2.7 python-virtualenv python-support cython \\
git build-essential libtool pkg-config autotools-dev autoconf automake cmake uuid-dev libpcre3-dev valgrind \\
libffi-dev
# only execute this next line if interested in updating the man pages as well (adds to build time):
# sudo apt-get install -y asciidoc
.for use where !optional & defined (use.tarball)
cd /home/vagrant
wget $(use.tarball)
tar -xzf \$(basename "$(use.tarball)")
rm \$(basename "$(use.tarball)")
cd /home/vagrant/\$(basename "$(use.tarball)" .tar.gz)
\./configure
make
make install
ldconfig
.endfor
.for use where !optional & !defined (use.tarball)
cd /home/vagrant
git clone --quiet $(use.repository) $(use.project)
cd /home/vagrant/$(use.project)
\./autogen.sh
\./configure
make
make install
ldconfig
.endfor
cd /vagrant
\./autogen.sh
\./configure
make
make check
make install
ldconfig
SCRIPT
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
VAGRANTFILE_LOCAL = 'Vagrantfile.local'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = 'ubuntu/trusty64'
config.vm.provision "shell", inline: $script
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--cpus", "2", "--ioapic", "on", "--memory", "1024" ]
end
if File.file?(VAGRANTFILE_LOCAL)
external = File.read VAGRANTFILE_LOCAL
eval external
end
end
.if file.exists ("Vagrantfile.in")
$(file.slurp ("Vagrantfile.in"))
.endif
.endmacro
function target_vagrant
generate_vagrant_file ()
endfunction