-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathbuild.sh
executable file
·247 lines (239 loc) · 6.88 KB
/
build.sh
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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
#!/bin/bash
# You can execute this script with different parameters:
# default - compiling promet basic programms
# server - compiling promet server programms
# components - compiling components needed
# plugins - compiling plugins
# tools - compiling commandline plugins
# imap - compiling imapserver
# xmpp - compiling xmpp messaging interface
# mail - send/reveive mail components
# feed - reveive feed and social components
# mqtt - receive messages from mqtt brooker
# sync - sync_db
# archive - archivestore program to extract archived files
# statistics - the repoting and statistics tool
# help - cleanup help.db from test data and zip it
# importdata - Zip the standard Importdata
# all - compiling all
# default - compiling program only (using by default)
cd $(dirname "$0")
. ./promet/setup/build-tools/setup_enviroment.sh
if [ -d $BUILD_DIR ]
then
echo "."
else
mkdir -p $BUILD_DIR
fi
if [ -d $OUTPUT_DIR ]
then
echo "."
else
mkdir -p $OUTPUT_DIR
fi
get_submodules()
{
git submodule sync --recursive
git submodule foreach --recursive 'git reset --hard'
git submodule update --init --recursive
}
build_default()
{
echo "Building default..."
. ./promet/source/plugins/build.sh $2
. ./promet/source/tools/build.sh $2
if [ $? -ne 0 ]; then
exit 1
fi
. ./promet/source/tools/build_visual.sh $2
if [ $? -ne 0 ]; then
exit 1
fi
. ./promet/source/messagemanager/build.sh $2
if [ $? -ne 0 ]; then
exit 1
fi
. ./promet/source/promet.erp/build.sh $2
if [ $? -ne 0 ]; then
exit 1
fi
. ./promet/source/production/build.sh $2
if [ $? -ne 0 ]; then
exit 1
fi
. ./promet/help/build.sh
. ./promet/importdata/build.sh $2
}
build_server()
{
. ./promet/source/tools/build.sh $2
if [ $? -ne 0 ]; then
exit 1
fi
sleep 2
. ./promet/source/webservers/build_imap.sh $2
if [ $? -ne 0 ]; then
exit 1
fi
sleep 2
. ./promet/source/sync/build_mail.sh $2
if [ $? -ne 0 ]; then
exit 1
fi
sleep 2
. ./promet/source/sync/build_feed.sh $2
if [ $? -ne 0 ]; then
exit 1
fi
sleep 2
. ./promet/source/sync/build_mqtt.sh $2
if [ $? -ne 0 ]; then
exit 1
fi
sleep 2
. ./promet/source/sync/build_fhem.sh $2
if [ $? -ne 0 ]; then
exit 1
fi
sleep 2
. ./promet/source/sync/build.sh $2
if [ $? -ne 0 ]; then
exit 1
fi
sleep 2
. ./promet/source/webservers/build_xmpp.sh $2
if [ $? -ne 0 ]; then
exit 1
fi
sleep 2
. ./promet/source/scripts/build.sh $2
if [ $? -ne 0 ]; then
exit 1
fi
if [ "x$TARGET_OS" = "xlinux" ]; then
. ./promet/setup/i386-linux/build_server.sh $2
fi
sleep 2
}
build_all()
{
echo "Building all..."
. ./promet/help/build.sh "$2"
build_server $1 $2;
sleep 2
build_default $1 $2;
. ./promet/source/meeting/build.sh $2
if [ $? -ne 0 ]; then
exit 1
fi
sleep 2
. ./promet/source/tools/build_archivestore.sh $2
if [ $? -ne 0 ]; then
exit 1
fi
sleep 2
. ./promet/source/statistics/build.sh $2
if [ $? -ne 0 ]; then
exit 1
fi
sleep 2
if [ "x$TARGET_OS" != "xwin32" ]; then
. ./promet/importdata/build.sh "$2"
fi
sleep 2
if [ "x$TARGET_OS" = "xwin32" ]; then
. ./promet/setup/i386-win32/build.sh $2
. ./promet/setup/portableapps/build.sh $2
fi
sleep 2
if [ "x$TARGET_OS" = "xlinux" ]; then
. ./promet/setup/i386-linux/build.sh $2
fi
}
upload()
{
if [ "x$TARGET_OS" = "xwin32" ]; then
. ./promet/setup/i386-win32/upload.sh
fi
if [ "x$TARGET_OS" = "xlinux" ]; then
. ./promet/setup/i386-linux/upload.sh
fi
}
clean_all()
{
rm -f -r $OUTPUT_DIR
mkdir -p $OUTPUT_DIR
rm -f -r promet/source/base/dbintfs/lib
rm -f -r promet/source/base/dbintfs/base_scripts/lib
rm -f -r promet/source/base/dbintfs/base_pm/lib
rm -f -r promet/source/promet.erp/lib
rm -f -r promet/source/tools/lib
rm -f -r promet/source/projectmanagement/lib
rm -f -r promet/source/clientmanagement/lib
rm -f -r promet/source/messageimport/lib
rm -f -r promet/source/archivestore/lib
rm -f -r promet/source/base/base_calendar/lib
rm -f -r promet/source/base/base_documents/lib
rm -f -r promet/source/base_erp/lib
rm -f -r promet/source/base/base_messaging/lib
rm -f -r promet/source/base/base_ocr/lib
rm -f -r promet/source/base/base_office/lib
rm -f -r promet/source/base_phone/lib
rm -f -r promet/source/base_pm/lib
rm -f -r promet/source/base_repair/lib
rm -f -r promet/source/base_wiki/lib
rm -f -r promet/source/base_help/lib
rm -f -r promet/source/base/base_frames/lib
rm -f -r promet/source/base/base_forms/lib
rm -f -r promet/source/base/base_inet/lib
rm -f -r promet/source/base/base_docmanage/lib
rm -f -r promet/source/meeting/lib
rm -f -r promet/source/testcases/lib
rm -f -r promet/source/webstat/lib
rm -f -r promet/source/checkout/lib
rm -f -r promet/source/webservers/lib
rm -f -r promet/source/import/lib
rm -f -r promet/source/pos/lib
rm -f -r promet/source/statistics/lib
rm -f -r promet/source/sync/lib
rm -f -r promet/source/timeregistering/lib
rm -f -r promet/source/tools/lib
rm -f -r promet/source/components/zeos/packages/lazarus/lib
rm -f -r promet/general/lib
find promet/source -type f -iname "*.compiled" -exec rm -f {} \;
find promet/source -type f -iname "*.bak" -exec rm -f {} \;
find promet/source -type f -iname "*.ppu" -exec rm -f {} \;
find promet/source -type f -iname "*.o" -exec rm -f {} \;
find promet/source -type f -iname "*.or" -exec rm -f {} \;
find promet/source -type f -iname "*.rst" -exec rm -f {} \;
}
case $1 in
tests) . ./promet/source/testcases/build.sh $2;;
components) . ./promet/source/components/build.sh $2;;
plugins) . ./promet/source/plugins/build.sh $2;;
tools) . ./promet/source/tools/build.sh $2;;
visual) . ./promet/source/tools/build_visual.sh $2;;
importdata) . ./promet/importdata/build.sh $2;;
help) . ./promet/help/build.sh $2;;
promet) . ./promet/source/promet.erp/build.sh $2;;
messageman) . ./promet/source/messagemanager/build.sh $2;;
meeting) . ./promet/source/meeting/build.sh $2;;
archive) . ./promet/source/tools/build_archivestore.sh $2;;
statistics) . ./promet/source/statistics/build.sh $2;;
imap) . ./promet/source/webservers/build_imap.sh $2;;
xmpp) . ./promet/source/webservers/build_xmpp.sh $2;;
mail) . ./promet/source/sync/build_mail.sh $2;;
feed) . ./promet/source/sync/build_feed.sh $2;;
mqtt) . ./promet/source/sync/build_mqtt.sh $2;;
fhem) . ./promet/source/sync/build_fhem.sh $2;;
sync) . ./promet/source/sync/build.sh $2;;
winclients) . ./promet/setup/i386-win32/build.sh $2;;
portable) . ./promet/setup/portableapps/build.sh $2;;
linclients) . ./promet/setup/i386-linux/build.sh $2;;
upload) upload;;
clean) clean_all;;
submodules) get_submodules;;
server) build_server $1 $2;;
all) build_all $1 $2;;
*) build_default $1 $2;;
esac