forked from km4ack/pi-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flsuite.function
202 lines (180 loc) · 5.63 KB
/
flsuite.function
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
#script to install FLDIGI from source
#20200121 km4ack
BUILDDIR=$HOME/.bap-source-files
mkdir -p ${BUILDDIR}
FLSTART() {
#find how much memory we are working with
FREEMEM=$(free -m | grep Mem: | awk '{ print $2 }')
echo ${FREEMEM}
##################################
# INCREASE SWAP
##################################
#increase swap file if less than 3G memory
if [ ${FREEMEM} -lt 3000 ]; then
echo "Increasing Swap size for build"
#increase swap size
sudo sed -i 's/#CONF_SWAPFILE=\/var\/swap/CONF_SWAPFILE=\/var\/swap/' /etc/dphys-swapfile
sudo sed -i 's/CONF_SWAPSIZE=100/CONF_SWAPSIZE=1024/' /etc/dphys-swapfile
sudo /etc/init.d/dphys-swapfile restart
sleep 10
fi
##################################
# DEPENDS
##################################
#install needed depends
sudo apt-get install -y libfltk1.3-dev libjpeg9-dev libxft-dev libxinerama-dev libxcursor-dev libsndfile1-dev libsamplerate0-dev portaudio19-dev libpulse-dev libusb-1.0-0-dev texinfo libudev-dev
##################################
# FLXMLRPC
##################################
FLX=$(ldconfig -p | grep flxmlrpc)
if [ -z "$FLX" ]; then
#determine latest FLXMLRPC & download
FLXM=$(curl -s https://www.w1hkj.com/files/flxmlrpc/ | grep .tar.gz | sed 's/.*ref="//;s/">.*$//')
XMPKG=$(echo ${FLXM} | sed 's/.tar.gz//')
cd ${BUILDDIR} || return
wget --tries 2 --connect-timeout=60 https://www.w1hkj.com/files/flxmlrpc/${FLXM}
tar -zxvf ${FLXM}
rm ./*.gz #THIS IS DANGEROUS -- SEE SC2035
#build FLXMLRPC
cd ${XMPKG} || return
./configure --prefix=/usr/local --enable-static
make
sudo make install
sudo ldconfig
sudo make clean
fi
}
##################################
# FLRIG
##################################
FLRIG() {
#Determine latest FLRIG
RIGTAR=$(curl -s https://www.w1hkj.com/files/flrig/ | grep .tar.gz | sed 's/.*ref="//;s/".*$//')
RIGPKG=$(echo ${RIGTAR} | sed 's/.tar.gz//')
#Download latest FLRIG
cd ${BUILDDIR} || return
wget --tries 2 --connect-timeout=60 https://www.w1hkj.com/files/flrig/${RIGTAR}
tar -zxvf ${RIGTAR}
rm ./*.gz #THIS IS DANGEROUS -- SEE SC2035
#Build FLRIG
cd ${RIGPKG} || return
./configure --prefix=/usr/local --enable-static
make
sudo make install
sudo ldconfig
sudo make clean
sudo apt-mark manual libjpeg9
}
##################################
# FLWRAP
##################################
FLWRAP() {
#Determine latest FLWRAP
WRAPTAR=$(curl -s https://www.w1hkj.com/files/flwrap/ | grep .tar.gz | sed 's/.*ref="//;s/".*$//')
WRAPPKG=$(echo ${WRAPTAR} | sed 's/.tar.gz//')
#Download latest FLWRAP
cd ${BUILDDIR} || return
wget --tries 2 --connect-timeout=60 https://www.w1hkj.com/files/flwrap/${WRAPTAR}
tar -zxvf ${WRAPTAR}
rm ./*.gz #THIS IS DANGEROUS -- SEE SC2035
#Build FLRIG
cd ${WRAPPKG} || return
./configure --prefix=/usr/local --enable-static
make
sudo make install
sudo ldconfig
sudo make clean
}
##################################
# FLDIGI
##################################
FLDIGI() {
#Determine latest FLDIGI
FLTAR=$(curl -s https://www.w1hkj.com/files/fldigi/ | grep .tar.gz | sed 's/.*fldigi/fldigi/;s/.gz.*$/.gz/')
FLPKG=$(echo ${FLTAR} | sed 's/.tar.gz//')
#Download latest FLDIGI tar file
cd ${BUILDDIR} || return
wget --tries 2 --connect-timeout=60 https://www.w1hkj.com/files/fldigi/${FLTAR}
tar -zxvf ${FLTAR}
rm ./*.gz #THIS IS DANGEROUS -- SEE SC2035
#build FLDIGI
cd ${FLPKG} || return
./configure --prefix=/usr/local --enable-static
make
sudo make install
sudo ldconfig
sudo make clean
}
##################################
# FLMSG
##################################
FLMSG() {
#Determine latest FLMSG
MSGTAR=$(curl -s https://www.w1hkj.com/files/flmsg/ | grep .tar.gz | sed 's/.*ref="//;s/">.*$//')
MSGPKG=$(echo ${MSGTAR} | sed 's/.tar.gz//')
#download FLMSG
cd ${BUILDDIR} || return
wget --tries 2 --connect-timeout=60 https://www.w1hkj.com/files/flmsg/${MSGTAR}
tar -zxvf ${MSGTAR}
rm ./*.gz #THIS IS DANGEROUS -- SEE SC2035
#Build FLMSG
cd ${MSGPKG} || return
./configure --prefix=/usr/local --enable-static --without-flxmlrpc
make
sudo make install
sudo ldconfig
sudo make clean
}
##################################
# FLAMP
##################################
FLAMP() {
#determine latest FLAMP
AMPTAR=$(curl -s https://www.w1hkj.com/files/flamp/ | grep .tar.gz | tail -1 | sed 's/.*ref="//;s/">.*$//')
AMPPKG=$(echo ${AMPTAR} | sed 's/.tar.gz//')
#download FLAMP
cd ${BUILDDIR} || return
wget --tries 2 --connect-timeout=60 https://www.w1hkj.com/files/flamp/$AMPTAR
tar -zxvf ${AMPTAR}
rm ./*.gz #THIS IS DANGEROUS -- SEE SC2035
#build FLAMP
cd ${AMPPKG} || return
./configure --prefix=/usr/local --enable-static
make
sudo make install
sudo ldconfig
sudo make clean
}
##################################
# FLNET
##################################
FLNET() {
#determine lastest FLNET
NETTAR=$(curl -s https://www.w1hkj.com/files/flnet/ | grep .tar.gz | sed 's/.*ref="//;s/">.*$//')
NETPKG=$(echo ${NETTAR} | sed 's/.tar.gz//')
#download FLNET
cd ${BUILDDIR} || return
wget --tries 2 --connect-timeout=60 https://www.w1hkj.com/files/flnet/$NETTAR
tar -zxvf ${NETTAR}
rm ./*.gz #THIS IS DANGEROUS -- SEE SC2035
#build FLNET
cd ${NETPKG} || return
./configure --prefix=/usr/local --enable-static
make
sudo make install
sudo ldconfig
sudo make clean
}
##################################
# RESET SWAP
##################################
FLSTOP() {
#reset swap size to default
if [ ${FREEMEM} -lt 3000 ]; then
echo "Resetting swap size to default"
#increase swap size
sudo sed -i 's/CONF_SWAPFILE=\/var\/swap/#CONF_SWAPFILE=\/var\/swap/' /etc/dphys-swapfile
sudo sed -i 's/CONF_SWAPSIZE=1024/CONF_SWAPSIZE=100/' /etc/dphys-swapfile
sudo /etc/init.d/dphys-swapfile restart
fi
}