summaryrefslogtreecommitdiff
path: root/config-sdk/package_all.sh
blob: 41f786a2c407fb7855285db7c6ae15e77ea50761 (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
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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
#!/bin/bash

ADDON_WORK_BASE=./extension/core-add-ons
BASE_WORK_BASE=./extension/base
ND_WORK_BASE=./extension/NativeAppDevelopment
NDCLI_WORK_BASE=./extension/NativeAppDevelopment-CLI
RS_WORK_BASE=./extension/rootstrap
OUTPUT_BASE=./extension/output

source ./extension/version_info

if [ $# != 2 ]
then
    echo "Usage : package_all.sh <profile> <platform verion>"
    echo "    format of platform version : 4.0, 5.0 , 5.5 or 6.0"
    exit 1
fi

PROFILE=$1
VERSION=$2

if [ $VERSION != "4.0" -a $VERSION != "5.0" -a $VERSION != "5.5" -a $VERSION != "6.0" ]
then
VERSION="6.0"
fi


###############################################################################
# Addon
###############################################################################
ADDON_PACKAGE_NAME="${PROFILE}-${VERSION}-core-add-ons"
#ADDON_PACKAGE_NAME="${PROFILE}-v${MAIN_VERSION}-${VERSION}-core-add-ons"
function create_addon_pkginfo()
{
	if [ x"$1" = x"all" ]
	then
	OUTPUT_FILE=$2
	MERGE_FLAG="true"
	else
	OUTPUT_FILE=${ADDON_WORK_BASE}/pkginfo.manifest
	MERGE_FLAG="false"
	echo -n "" > ${OUTPUT_FILE}
	fi

    #pkginfo.manifest
	#Package : <profile>-<version>-<platform version>-core-add-ons
	#Version : 0.0.1
	#OS : ubuntu-32, ubuntu-64, windows-32, windows-64, macos-64
	#Build-host-os : ubuntu-64
	#Maintainer : TizenSDK<tizensdk@samsung.com>
	#Uncompressed-size : 117727
	#Description : Samples/Templates for developing core project.

	echo "Package : ${ADDON_PACKAGE_NAME}" >> ${OUTPUT_FILE}
	echo "Version : ${MINOR_VERSION}" >> ${OUTPUT_FILE}
	echo "OS : ${SUPPORT_OS}" >> ${OUTPUT_FILE}
	echo "Build-host-os : ${BUILD_OS}" >> ${OUTPUT_FILE}
	echo "Maintainer : ${MAINTAINER}" >> ${OUTPUT_FILE}
	if [ $MERGE_FLAG = "true" ]
	then
	echo "Path : /binary/${ADDON_ZIP}" >> ${OUTPUT_FILE}
	echo "Origin : local" >> ${OUTPUT_FILE}
	SHA256=`sha256sum ${OUTPUT_BASE}/binary/${ADDON_ZIP} | awk '{print $1}'`
	echo "SHA256 : ${SHA256}" >> ${OUTPUT_FILE}
	echo "Size : $(stat -c%s ${OUTPUT_BASE}/binary/${ADDON_ZIP})" >> ${OUTPUT_FILE}
	fi
	DATA_SIZE=`du -sb ${ADDON_WORK_BASE}/data | awk '{print $1}'`
	echo "Uncompressed-size : ${DATA_SIZE}" >> ${OUTPUT_FILE}
	echo "Description : Samples/Templates for developing core project." >> ${OUTPUT_FILE}
}

make_addon_data()
{
#	DATA_PATH="${ADDON_WORK_BASE}/data/platforms/tizen-${VERSION}/${PROFILE}-v${MAIN_VERSION}"
	DATA_PATH="${ADDON_WORK_BASE}/data/platforms/tizen-${VERSION}/${PROFILE}"
	mkdir -p $DATA_PATH
	cp -rf ${ADDON_WORK_BASE}/template/* ${DATA_PATH}
#### change template ####
	UI_PATH="${DATA_PATH}/samples/Template/Native/basic-ui"
	UIEDC_PATH="${DATA_PATH}/samples/Template/Native/basic-edc-ui"
	SVC_PATH="${DATA_PATH}/samples/Template/Native/ServiceApp"
	SLIB_PATH="${DATA_PATH}/samples/Template/Native/SharedLibrary"
	IOTJS_PATH="${DATA_PATH}/samples/Template/Native/IoTjsApp"
	THINGS_PATH="${DATA_PATH}/samples/Template/Native/things-app"

	sed -i "s/tizen_iot/${PROFILE}/g" ${UI_PATH}/description.xml
	sed -i "s/tizen_iot/${PROFILE}/g" ${UIEDC_PATH}/description.xml
	sed -i "s/tizen_iot/${PROFILE}/g" ${SVC_PATH}/description.xml
	sed -i "s/tizen_iot/${PROFILE}/g" ${SLIB_PATH}/description.xml
	sed -i "s/tizen_iot/${PROFILE}/g" ${IOTJS_PATH}/description.xml
	sed -i "s/tizen_iot/${PROFILE}/g" ${THINGS_PATH}/description.xml
}

clean_up_addon()
{
	pushd ${ADDON_WORK_BASE}
	DEL_LIST=`ls | grep -v template`
	echo $DEL_LIST
	rm -rf ${DEL_LIST}
	popd
}

ADDON_ZIP=${ADDON_PACKAGE_NAME}_${MINOR_VERSION}_${BUILD_OS}.zip
## input : base_dir, outpu_name
compress_data()
{
	pushd $1
	if [ -e changelog ]
	then
	IN_DATA="pkginfo.manifest changelog"
	else
	IN_DATA="pkginfo.manifest"
	fi
	zip -r $2 data data/* $IN_DATA > /dev/null
	popd
}

echo "#####################################"
echo " Processing add-ons"
echo "#####################################"
echo "clean up the previous data for addon"
clean_up_addon
echo "making ${ADDON_PACKAGE_NAME} for addon"
make_addon_data
echo "making pkginfo.manifest for addon"
create_addon_pkginfo
echo "compress addon"
compress_data ${ADDON_WORK_BASE} ${ADDON_ZIP}



###############################################################################
# RootStrap
###############################################################################
#RS_PACKAGE_NAME="${PROFILE}-v${MAIN_VERSION}-${VERSION}-rs-device.core"
RS_PACKAGE_NAME="${PROFILE}-${VERSION}-rs-device.core"

function create_rs_pkginfo()
{
	if [ x"$1" = x"all" ]
	then
	OUTPUT_FILE=$2
	MERGE_FLAG="true"
	else
	OUTPUT_FILE=${RS_WORK_BASE}/pkginfo.manifest
	MERGE_FLAG="false"
	echo -n "" > ${OUTPUT_FILE}
	fi

    #pkginfo.manifest
	#Package : tizen_network_audio_armv7l-v1.0-6.0-rs-arm.core
	#Version : 0.0.1
	#OS : ubuntu-64, windows-64, macos-64
	#Build-host-os : ubuntu-64
	#Maintainer : TizenSDK<tizensdk@samsung.com>
	#Attribute : binary
	#Uncompressed-size : 69284978
	#Description : tizen 6.0 arm rootstrap for native app development

	echo "Package : ${RS_PACKAGE_NAME}" >> ${OUTPUT_FILE}
	echo "Version : ${MINOR_VERSION}" >> ${OUTPUT_FILE}
	echo "OS : ${SUPPORT_OS}" >> ${OUTPUT_FILE}
	echo "Build-host-os : ${BUILD_OS}" >> ${OUTPUT_FILE}
	echo "Maintainer : ${MAINTAINER}" >> ${OUTPUT_FILE}
	echo "Attribute : binary" >> ${OUTPUT_FILE}
	if [ $MERGE_FLAG = "true" ]
	then
	echo "Path : /binary/${RS_ZIP}" >> ${OUTPUT_FILE}
	echo "Origin : local" >> ${OUTPUT_FILE}
	SHA256=`sha256sum ${OUTPUT_BASE}/binary/${RS_ZIP} | awk '{print $1}'`
	echo "SHA256 : ${SHA256}" >> ${OUTPUT_FILE}
	echo "Size : $(stat -c%s ${OUTPUT_BASE}/binary/${RS_ZIP})" >> ${OUTPUT_FILE}
	fi
	DATA_SIZE=`du -sb ${RS_WORK_BASE}/data | awk '{print $1}'`
	echo "Uncompressed-size : ${DATA_SIZE}" >> ${OUTPUT_FILE}
	echo "Description : tizen ${VERSION} arm rootstrap for native app development" >> ${OUTPUT_FILE}
}

make_rs_data()
{
	ZIP_FILE=`ls ./.pkg/`
	unzip ./.pkg/${ZIP_FILE} -d ${RS_WORK_BASE} > /dev/null

#	CHG_FILE_LIST=`find ${RS_WORK_BASE} -name ${PROFILE}-${VERSION}* | sort -r`
#	for AFILE in $CHG_FILE_LIST
#	do
#		CHG_NAME=`echo $AFILE | sed -e "s/${PROFILE}-${VERSION}/${PROFILE}-v${MAIN_VERSION}-${VERSION}/g"`
#		mv $AFILE $CHG_NAME
#	done
#	AFILE=`find ${RS_WORK_BASE} -name ${PROFILE} | sort -r`
#	CHG_NAME=`echo $AFILE | sed -e "s/${PROFILE}/${PROFILE}-v${MAIN_VERSION}/g"`
#	mv $AFILE $CHG_NAME
#	sed -i "s|${PROFILE}|${PROFILE}-v${MAIN_VERSION}|g" ${RS_WORK_BASE}/data/tools/smart-build-interface/plugins/${PROFILE}-v${MAIN_VERSION}-${VERSION}-device.core.xml
}

clean_up_rootstrap()
{
	rm -rf ${RS_WORK_BASE}/*
}


RS_ZIP=${RS_PACKAGE_NAME}_${MINOR_VERSION}_${BUILD_OS}.zip

echo "#####################################"
echo " Processing rootstrap"
echo "#####################################"
echo "clean up the previous data for rootstrap"
clean_up_rootstrap
echo "making ${RS_PACKAGE_NAME} for rootstrap"
make_rs_data
echo "making pkginfo.manifest for rootstrap"
create_rs_pkginfo
echo "compress rootstrap"
compress_data ${RS_WORK_BASE} ${RS_ZIP}

###############################################################################
# NativeDevelopment-CLI
###############################################################################
#NDCLI_PACKAGE_NAME="${PROFILE}-v${MAIN_VERSION}-${VERSION}-NativeAppDevelopment-CLI"
NDCLI_PACKAGE_NAME="${PROFILE}-${VERSION}-NativeAppDevelopment-CLI"

function create_ndcli_pkginfo()
{
	if [ x"$1" = x"all" ]
	then
	OUTPUT_FILE=$2
	MERGE_FLAG="true"
	else
	OUTPUT_FILE=${NDCLI_WORK_BASE}/pkginfo.manifest
	MERGE_FLAG="false"
	echo -n "" > ${OUTPUT_FILE}
	fi

	#Package : tizen_network_audio_armv7l-v1.0-6.0-NativeAppDevelopment-CLI
	#Label : Native app. development (CLI)
	#Version : 0.0.1
	#OS : ubuntu-32, ubuntu-64, windows-32, windows-64, macos-64
	#Build-host-os : ubuntu-64
	#Maintainer : TizenSDK<tizensdk@samsung.com>
	#Attribute : root
	#Install-dependency : tizen_network_audio_armv7l-v1.0-6.0-rs-arm.core, tizen_network_audio_armv7l-v1.0-6.0-core-add-ons
	#Source : meta-extension-components
	#Uncompressed-size : 8192
	#C-SelectedGroup : NativeCLI, NativeToolchain-Gcc-6.2
	#C-advanced : true
	#Description : Tizen Custom Platform CLI.

	echo "Package : ${NDCLI_PACKAGE_NAME}" >> ${OUTPUT_FILE}
	echo "Label  : Native app. development (CLI)" >> ${OUTPUT_FILE}
	echo "Version : ${MINOR_VERSION}" >> ${OUTPUT_FILE}
	echo "OS : ${SUPPORT_OS}" >> ${OUTPUT_FILE}
	echo "Build-host-os : ${BUILD_OS}" >> ${OUTPUT_FILE}
	echo "Maintainer : ${MAINTAINER}" >> ${OUTPUT_FILE}
	echo "Attribute : root" >> ${OUTPUT_FILE}
	echo "Install-dependency : ${RS_PACKAGE_NAME}, ${ADDON_PACKAGE_NAME}" >> ${OUTPUT_FILE}
	echo "Source : meta-extension-components" >> ${OUTPUT_FILE}
	if [ $MERGE_FLAG = "true" ]
	then
	echo "Path : /binary/${NDCLI_ZIP}" >> ${OUTPUT_FILE}
	echo "Origin : local" >> ${OUTPUT_FILE}
	SHA256=`sha256sum ${OUTPUT_BASE}/binary/${NDCLI_ZIP} | awk '{print $1}'`
	echo "SHA256 : ${SHA256}" >> ${OUTPUT_FILE}
	echo "Size : $(stat -c%s ${OUTPUT_BASE}/binary/${NDCLI_ZIP})" >> ${OUTPUT_FILE}
	fi
	DATA_SIZE=`du -sb ${NDCLI_WORK_BASE}/data | awk '{print $1}'`
	echo "Uncompressed-size : ${DATA_SIZE}" >> ${OUTPUT_FILE}
	echo "C-SelectedGroup : NativeCLI, NativeToolchain-Gcc-6.2" >> ${OUTPUT_FILE}
	echo "C-advanced : true" >> ${OUTPUT_FILE}
	echo "Description : Tizen Custom Platform CLI" >> ${OUTPUT_FILE}
}

clean_up_ndcli()
{
	pushd ${NDCLI_WORK_BASE}
	DEL_LIST=`ls | grep -v changelog | grep -v data`
	echo $DEL_LIST
	rm -rf ${DEL_LIST}
	popd
}

#NDCLI_ZIP=${NDCLI_PACKAGE_NAME}_v${MAIN_VERSION}_${MINOR_VERSION}_${BUILD_OS}.zip
NDCLI_ZIP=${NDCLI_PACKAGE_NAME}_${MINOR_VERSION}_${BUILD_OS}.zip

echo "#####################################"
echo " Processing NativeDevelopment-CLI"
echo "#####################################"
echo "clean up the previous data for nativedevelopment-cli"
clean_up_ndcli
echo "making pkginfo.manifest for nativedevelopment-cli"
create_ndcli_pkginfo
echo "compress nativedevelopment-cli"
compress_data ${NDCLI_WORK_BASE} ${NDCLI_ZIP}



###############################################################################
# NativeDevelopment
###############################################################################
#ND_PACKAGE_NAME="${PROFILE}-v${MAIN_VERSION}-${VERSION}-NativeAppDevelopment"
ND_PACKAGE_NAME="${PROFILE}-${VERSION}-NativeAppDevelopment"

function create_nd_pkginfo()
{
	if [ x"$1" = x"all" ]
	then
	OUTPUT_FILE=$2
	MERGE_FLAG="true"
	else
	OUTPUT_FILE=${ND_WORK_BASE}/pkginfo.manifest
	MERGE_FLAG="false"
	echo -n "" > ${OUTPUT_FILE}
	fi

	#Package : tizen_network_audio_armv7l-v1.0-6.0-NativeAppDevelopment
	#Label : Native app. development (IDE)
	#Version : 0.0.1
	#OS : ubuntu-64, windows-64, macos-64
	#Build-host-os : ubuntu-64
	#Maintainer : TizenSDK<tizensdk@samsung.com>
	#Attribute : root
	#Install-dependency : tizen_network_audio_armv7l-v1.0-6.0-rs-arm.core, tizen_network_audio_armv7l-v1.0-6.0-core-add-ons
	#Source : meta-extension-components
	#Uncompressed-size : 8192
	#C-SelectedGroup : tizen_network_audio_armv7l-v1.0-6.0-NativeAppDevelopment-CLI, NativeCLI, NativeIDE, NativeToolchain-Gcc-4.9
	#C-ExtName : tizen_network_audio_armv7l-v1.0-6.0 Native app. development
	#C-Platform : 6.0
	#C-ExtProfile : tizen_network_audio_armv7l-v1.0
	#C-DevelopEnv : NativeAppDevelopment
	#C-ExtPath : platforms/tizen-6.0/tizen_network_audio_armv7l-v1.0
	#Description : Tizen Custom Platform IDE.

	echo "Package : ${ND_PACKAGE_NAME}" >> ${OUTPUT_FILE}
	echo "Label  : Native app. development (IDE)" >> ${OUTPUT_FILE}
	echo "Version : ${MINOR_VERSION}" >> ${OUTPUT_FILE}
	echo "OS : ${SUPPORT_OS}" >> ${OUTPUT_FILE}
	echo "Build-host-os : ${BUILD_OS}" >> ${OUTPUT_FILE}
	echo "Maintainer : ${MAINTAINER}" >> ${OUTPUT_FILE}
	echo "Attribute : root" >> ${OUTPUT_FILE}
	echo "Install-dependency : ${RS_PACKAGE_NAME}, ${ADDON_PACKAGE_NAME}" >> ${OUTPUT_FILE}
	echo "Source : meta-extension-components" >> ${OUTPUT_FILE}
	if [ $MERGE_FLAG = "true" ]
	then
	echo "Path : /binary/${ND_ZIP}" >> ${OUTPUT_FILE}
	echo "Origin : local" >> ${OUTPUT_FILE}
	SHA256=`sha256sum ${OUTPUT_BASE}/binary/${ND_ZIP} | awk '{print $1}'`
	echo "SHA256 : ${SHA256}" >> ${OUTPUT_FILE}
	echo "Size : $(stat -c%s ${OUTPUT_BASE}/binary/${ND_ZIP})" >> ${OUTPUT_FILE}
	fi
	DATA_SIZE=`du -sb ${ND_WORK_BASE}/data | awk '{print $1}'`
	echo "Uncompressed-size : ${DATA_SIZE}" >> ${OUTPUT_FILE}
	echo "C-SelectedGroup : ${NDCLI_PACKAGE_NAME}, NativeCLI, NativeIDE, NativeToolchain-Gcc-4.9" >> ${OUTPUT_FILE}
#	echo "C-ExtName : ${PROFILE}-v${MAIN_VERSION}-${VERSION} Native app. development" >> ${OUTPUT_FILE}
	echo "C-ExtName : ${PROFILE}-${VERSION} Native app. development" >> ${OUTPUT_FILE}
	echo "C-Platform : ${VERSION}" >> ${OUTPUT_FILE}
#	echo "C-ExtProfile : ${PROFILE}-v${MAIN_VERSION}" >> ${OUTPUT_FILE}
	echo "C-ExtProfile : ${PROFILE}" >> ${OUTPUT_FILE}
	echo "C-DevelopEnv : NativeAppDevelopment" >> ${OUTPUT_FILE}
#	echo "C-ExtPath : platforms/tizen-6.0/${PROFILE}-v${MAIN_VERSION}" >> ${OUTPUT_FILE}
	echo "C-ExtPath : platforms/tizen-${VERSION}/${PROFILE}" >> ${OUTPUT_FILE}
	echo "Description : Tizen Custom Platform IDE." >> ${OUTPUT_FILE}
}

clean_up_nd()
{
	pushd ${ND_WORK_BASE}
	DEL_LIST=`ls | grep -v changelog | grep -v data`
	echo $DEL_LIST
	rm -rf ${DEL_LIST}
	popd
}


#ND_ZIP=${ND_PACKAGE_NAME}_v${MAIN_VERSION}_${MINOR_VERSION}_${BUILD_OS}.zip
ND_ZIP=${ND_PACKAGE_NAME}_${MINOR_VERSION}_${BUILD_OS}.zip

echo "#####################################"
echo " Processing NativeDevelopment"
echo "#####################################"
echo "clean up the previous data for nativedevelopment"
clean_up_nd
echo "making pkginfo.manifest for nativedevelopment"
create_nd_pkginfo
echo "compress nativedevelopment"
compress_data ${ND_WORK_BASE} ${ND_ZIP}


###############################################################################
# Base
###############################################################################
#BASE_PACKAGE_NAME="${PROFILE}-v${MAIN_VERSION}-${VERSION}"
BASE_PACKAGE_NAME="${PROFILE}-${VERSION}"

function create_base_pkginfo()
{
	if [ x"$1" = x"all" ]
	then
	OUTPUT_FILE=$2
	MERGE_FLAG="true"
	else
	OUTPUT_FILE=${BASE_WORK_BASE}/pkginfo.manifest
	MERGE_FLAG="false"
	echo -n "" > ${OUTPUT_FILE}
	fi

	#Package : tizen_network_audio_armv7l-v1.0-6.0
	#Label : tizen_network_audio_armv7l-v1.0-6.0
	#Version : 0.0.1
	#OS : ubuntu-32, ubuntu-64, windows-32, windows-64, macos-64
	#Build-host-os : ubuntu-64
	#Maintainer : TizenSDK<tizensdk@samsung.com>
	#Attribute : root
	#Install-dependency : tizen_network_audio_armv7l-v1.0-6.0-NativeAppDevelopment, tizen_network_audio_armv7l-v1.0-6.0-NativeAppDevelopment-CLI
	#Source : meta-extension-components
	#Uncompressed-size : 8192
	#Description : Tizen Custom Platform.


	echo "Package : ${BASE_PACKAGE_NAME}" >> ${OUTPUT_FILE}
	echo "Label  : ${BASE_PACKAGE_NAME}" >> ${OUTPUT_FILE}
	echo "Version : ${MINOR_VERSION}" >> ${OUTPUT_FILE}
	echo "OS : ${SUPPORT_OS}" >> ${OUTPUT_FILE}
	echo "Build-host-os : ${BUILD_OS}" >> ${OUTPUT_FILE}
	echo "Maintainer : ${MAINTAINER}" >> ${OUTPUT_FILE}
	echo "Attribute : root" >> ${OUTPUT_FILE}
	echo "Install-dependency : ${ND_PACKAGE_NAME}, ${NDCLI_PACKAGE_NAME}" >> ${OUTPUT_FILE}
	echo "Source : meta-extension-components" >> ${OUTPUT_FILE}
	if [ $MERGE_FLAG = "true" ]
	then
	echo "Path : /binary/${BASE_ZIP}" >> ${OUTPUT_FILE}
	echo "Origin : local" >> ${OUTPUT_FILE}
	SHA256=`sha256sum ${OUTPUT_BASE}/binary/${BASE_ZIP} | awk '{print $1}'`
	echo "SHA256 : ${SHA256}" >> ${OUTPUT_FILE}
	echo "Size : $(stat -c%s ${OUTPUT_BASE}/binary/${BASE_ZIP})" >> ${OUTPUT_FILE}
	fi
	DATA_SIZE=`du -sb ${BASE_WORK_BASE}/data | awk '{print $1}'`
	echo "Uncompressed-size : ${DATA_SIZE}" >> ${OUTPUT_FILE}
	echo "Description : Tizen Custom Platform" >> ${OUTPUT_FILE}
}

clean_up_base()
{
	pushd ${BASE_WORK_BASE}
	DEL_LIST=`ls | grep -v changelog | grep -v data`
	echo $DEL_LIST
	rm -rf ${DEL_LIST}
	popd
}

#BASE_ZIP=${BASE_PACKAGE_NAME}_v${MAIN_VERSION}_${MINOR_VERSION}_${BUILD_OS}.zip
BASE_ZIP=${BASE_PACKAGE_NAME}_${MINOR_VERSION}_${BUILD_OS}.zip

echo "#####################################"
echo " Processing Base"
echo "#####################################"
echo "clean up the previous data for base"
clean_up_base
echo "making pkginfo.manifest for base"
create_base_pkginfo
echo "compress base"
compress_data ${BASE_WORK_BASE} ${BASE_ZIP}

######################
# Merge
######################

echo "######################"
echo "# Merge"
echo "######################"

if [ ! -d ${OUTPUT_BASE}/binary ]
then
	mkdir -p ${OUTPUT_BASE}/binary
else
	rm -rf ${OUTPUT_BASE}/binary/*
	rm -f ${OUTPUT_BASE}/pkg_list_*
fi

mv -f ${ADDON_WORK_BASE}/${ADDON_ZIP} ${OUTPUT_BASE}/binary/
mv -f ${RS_WORK_BASE}/${RS_ZIP} ${OUTPUT_BASE}/binary/
mv -f ${NDCLI_WORK_BASE}/${NDCLI_ZIP} ${OUTPUT_BASE}/binary/
mv -f ${ND_WORK_BASE}/${ND_ZIP} ${OUTPUT_BASE}/binary/
mv -f ${BASE_WORK_BASE}/${BASE_ZIP} ${OUTPUT_BASE}/binary/

PKG_LIST_FILE=${OUTPUT_BASE}/pkg_list

echo -n "" > ${PKG_LIST_FILE}_ubuntu-64

create_addon_pkginfo all ${PKG_LIST_FILE}_ubuntu-64
echo "" >> ${PKG_LIST_FILE}_ubuntu-64
create_rs_pkginfo all ${PKG_LIST_FILE}_ubuntu-64
echo "" >> ${PKG_LIST_FILE}_ubuntu-64
create_nd_pkginfo all ${PKG_LIST_FILE}_ubuntu-64
echo "" >> ${PKG_LIST_FILE}_ubuntu-64
create_ndcli_pkginfo all ${PKG_LIST_FILE}_ubuntu-64
echo "" >> ${PKG_LIST_FILE}_ubuntu-64
create_base_pkginfo all ${PKG_LIST_FILE}_ubuntu-64

cp -f ${PKG_LIST_FILE}_ubuntu-64 ${PKG_LIST_FILE}_windows-64
cp -f ${PKG_LIST_FILE}_ubuntu-64 ${PKG_LIST_FILE}_windows-32
cp -f ${PKG_LIST_FILE}_ubuntu-64 ${PKG_LIST_FILE}_ubuntu-32
cp -f ${PKG_LIST_FILE}_ubuntu-64 ${PKG_LIST_FILE}_macos-64

pushd ${OUTPUT_BASE}
echo ${BASE_PACKAGE_NAME}.zip
zip -r ../${BASE_PACKAGE_NAME}.zip *
popd