-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_packages.bash
executable file
·229 lines (194 loc) · 5.84 KB
/
create_packages.bash
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
#!/bin/sh
# Copyright (c) by Maxim Sokolsky (2:5020/828.777). This file is part of fidoip. It is free software and it is covered
# by the GNU general public license. See the file LICENSE for details. */
# Usage: create_packages.bash
# If you setup connection via proxy uncomment raw GIT_PROXY below:
# GIT_PROXY="http://server:port"
CWD=$(pwd)
OSNAME=$(uname)
CWD=$(pwd)
HOMEDIR=$(cd ../; pwd) # Fidoip installation directory
SYSOS=$(uname -s) # Packages architecture
ARCH=$(uname -m) # Packages architecture
OSTYPE=$(uname -o 2>/dev/null || uname -p)
BUILD=${BUILD:-fido_my1} # Build number packages initials
IDN=$(id -un) # User's name
IDG=$(id -gn) # User's group
T1="root"
T2="Linux"
T3="FreeBSD"
T4="DragonFly"
cd $CWD || exit
echo
if [ "$T1" = "$IDN" ]; then
echo "WARNING! You are running this script under root."
echo "You may better to start it under unpriveleged user."
echo
echo "To do this please create new unpriveleged user now and then login"
echo "and start this script again."
echo
exit
else
echo "You running this script under "$IDN" user."
echo
fi
echo "Creating FIDONet packages and saving it to $CWD/packages/ directory."
sleep 3
f1()
{
echo '------------------------------------------------------------------------------'
echo "Checking whether some necessary packages installed on this mashine:"
echo '------------------------------------------------------------------------------'
sleep 3
echo ""
## make sure git archiver available
git=$(which git)
if [ -x "$git" ]
then
echo "Git found: $git"
else
echo "ERROR: git not found."
echo "So it will not be possible extract fidoip sources on this machine."
echo " You should take steps to get git installed,"
echo " as described in documentation of fidoip."
sleep 3
exit
fi
echo ""
echo '------------------------------------------------------------------------------'
sleep 1
## make sure C compiler/linker available
gccloc=$(which gcc)
if [ -x "$gccloc" ]
then
echo "C compiler found: $gccloc"
else
echo "WARNING: gcc not found."
fi
echo ""
echo '------------------------------------------------------------------------------'
sleep 1
## make sure C++ compiler/linker available
gploc=$(which g++)
if [ -x "$gploc" ]
then
echo "C++ compiler found: $gploc"
else
echo "WARNING: c++ support for gcc not found."
exit
fi
echo ""
echo '------------------------------------------------------------------------------'
sleep 1
clang=$(which clang)
if [ -x "$clang" ]
then
echo "Clang package found: $clang"
else
echo "ERROR: clang package not found."
echo "Please install it and run this script again."
echo " You should take steps to get clang installed,"
echo " as described in in documentation of fidoip."
sleep 1
exit
fi
echo ""
echo '------------------------------------------------------------------------------'
sleep 1
clangplus=$(which clang++)
if [ -x "$clangplus" ]
then
echo "Clang++ package found: $clangplus"
else
echo "ERROR: clang++ not found."
echo "Please install it and run this script again."
echo " You should take steps to get clang++ installed,"
echo " as described in in documentation of fidoip."
sleep 3
exit
fi
echo ""
echo '------------------------------------------------------------------------------'
sleep 1
cmake=$(which cmake)
if [ -x "$cmake" ]
then
echo "Cmake package found: $cmake"
else
echo "ERROR: cmake package not found."
echo "Please install it and run this script again."
echo " You should take steps to get cmake installed,"
echo " as described in in documentation of fidoip."
sleep 3
exit
fi
echo ""
echo '------------------------------------------------------------------------------'
sleep 1
echo ""
export CC="$clang"
export CXX="$clangplus"
if [ -n "$GIT_PROXY" ]
then
echo "http_proxy setup: $GIT_PROXY"
export http_proxy="$GIT_PROXY"
echo "https_proxy setup: $GIT_PROXY"
export https_proxy="$GIT_PROXY"
echo "GIT_PROXY setup: $GIT_PROXY"
git config --global http.proxy "$GIT_PROXY"
sleep 2
echo
fi
echo ''
echo '------------------------------------------------------------------------------'
echo '| Starting creating packages of FIDONet (BinkD, Husky HPT and GoldEd+).|'
echo '------------------------------------------------------------------------------'
echo ''
sleep 5
cd binkd || exit
sh binkd.Build
cd ../husky || exit
sh husky.Build
cd ../golded || exit
sh golded.Build
cd "$CWD" || exit
echo
echo '------------------------------------------------------------------------------'
echo " Done! Creation of packages BinkD, Husky HPT and GoldEd+ are finished."
echo '------------------------------------------------------------------------------'
echo " FIDONet *.tgz packages saved to this directory: "
echo " $CWD/packages/ "
echo '------------------------------------------------------------------------------'
echo
sleep 3
echo '------------------------------------------------------------------------------'
echo " To install FIDONet packages to directory $HOMEDIR run this 4 commands: "
echo
sleep 1
echo "cd $HOMEDIR"
echo
echo "tar -xzpf $(ls -t "$CWD"/packages/binkd*.tgz | head -n1) -C ."
echo
sleep 1
echo "tar -xzpf $(ls -t "$CWD"/packages/husky*.tgz | head -n1) -C ."
echo
sleep 1
echo "tar -xzpf $(ls -t "$CWD"/packages/golded*.tgz | head -n1) -C ."
echo
sleep 1
echo ' Then again go back to this directory: '
echo
sleep 1
echo " cd $CWD"
echo
sleep 1
echo ' and start "bash ./setup_config.bash" to create configuration for point setup '
echo 'or use "bash ./setup_node.bash" to create configuration for node setup. '
echo
sleep 1
echo '------------------------------------------------------------------------------'
echo ' Visit https://sf.net/projects/fidoip/ for info and updates. '
echo '------------------------------------------------------------------------------'
}
f1
#End of create_packages.sh