summaryrefslogtreecommitdiff
path: root/cookbooks/gnuradio/recipes/default.rb
blob: 3bebda987919bcb284e53e5862b25d1ba87c20c9 (plain)
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
include_recipe 'gnuradio::packages'

directory node[:workingdir] do
  owner 'vagrant'
  group 'vagrant'
  mode '0755'
  action :create
end

git 'Checkout gnuradio' do
    repository node[:repos][:gnuradio]
    reference 'master'
    action :checkout
    revision 'v3.6.5'
    destination node[:workingdir] + '/gnuradio'
    user 'vagrant'
    group 'vagrant'
end

git 'Checkout rtl-sdr' do
    repository node[:repos][:rtlsdr]
    reference 'master'
    action :checkout
    destination node[:workingdir] + '/rtl-sdr'
    user 'vagrant'
    group 'vagrant'
end

git 'Checkout hackrf' do
    repository node[:repos][:hackrf]
    reference 'master'
    action :checkout
    destination node[:workingdir] + '/hackrf'
    user 'vagrant'
    group 'vagrant'
end

git 'Checkout gr-osmosdr' do
    repository node[:repos][:gr_osmosdr]
    reference 'master'
    action :checkout
    revision 'gr3.6'
    destination node[:workingdir] + '/gr-osmosdr'
    user 'vagrant'
    group 'vagrant'
end

git 'Checkout gqrx' do
    repository node[:repos][:gqrx]
    reference 'master'
    action :checkout
    destination node[:workingdir] + '/gqrx'
    user 'vagrant'
    group 'vagrant'
end

bash 'Compile rtl-sdr' do
    user 'vagrant'
    group 'vagrant'
    cwd node[:workingdir] + '/rtl-sdr'
    code <<-EOH
        cmake . -DINSTALL_UDEV_RULES=ON
        make clean
        make
    EOH
end

bash 'Install rtl-sdr' do
    cwd node[:workingdir] + '/rtl-sdr'
    code <<-EOH
        make install
        ldconfig
    EOH
end

bash 'Compile libhackrf' do
    user 'vagrant'
    group 'vagrant'
    cwd node[:workingdir] + '/hackrf/host/libhackrf'
    code <<-EOH
        cmake .
        make clean
        make
    EOH
end

bash 'Install libhackrf' do
    cwd node[:workingdir] + '/hackrf/host/libhackrf'
    code <<-EOH
        make install
        ldconfig
    EOH
end

bash 'Compile hackrf-tools' do
    user 'vagrant'
    group 'vagrant'
    cwd node[:workingdir] + '/hackrf/host/hackrf-tools'
    code <<-EOH
        cmake .
        make clean
        make
    EOH
end

bash 'Install hackrf-tools' do
    cwd node[:workingdir] + '/hackrf/host/hackrf-tools'
    code <<-EOH
        make install
        ldconfig
    EOH
end

bash 'Compile GNU Radio' do
    user 'vagrant'
    group 'vagrant'
    cwd node[:workingdir] + '/gnuradio'
    code <<-EOH
        export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
        mkdir build && cd build
        make clean
        cmake -DENABLE_BAD_BOOST=ON ../
        make clean
        make
    EOH
end

bash 'Install GNU Radio' do
    cwd node[:workingdir] + '/gnuradio'
    code <<-EOH
        cd build
        make install
        ldconfig
    EOH
end

bash 'Compile gr-osmosdr' do
    user 'vagrant'
    group 'vagrant'
    cwd node[:workingdir] + '/gr-osmosdr'
    code <<-EOH
        cmake .
        make clean
        make
    EOH
end

bash 'Install gr-osmosdr' do
    cwd node[:workingdir] + '/gr-osmosdr'
    code <<-EOH
        make install
        ldconfig
    EOH
end

bash 'Compile gqrx' do
    user 'vagrant'
    group 'vagrant'
    cwd node[:workingdir] + '/gqrx'
    code <<-EOH
        qmake gqrx.pro
        make
    EOH
end