@@ -26,7 +26,7 @@ SECRET_TOOL=false
26
26
27
27
SCRIPT_NAME=$( basename -- " $( readlink -f " ${BASH_SOURCE:? } " ) " )
28
28
SCRIPT_DIR=$( dirname -- " $( readlink -f " ${BASH_SOURCE:? } " ) " )
29
- DEPENDENCIES=(' cpio' ' openjdk-8-jre-headless' ' obs-build ' ' wget' ' zip' )
29
+ DEPENDENCIES=(' 7zip ' ' cpio' ' openjdk-8-jre-headless' ' wget' ' zip' )
30
30
31
31
# If color is available use colors
32
32
if which tput > /dev/null 2>&1 && [[ $( tput -T $TERM colors) -ge 8 ]]; then
@@ -45,16 +45,18 @@ function show_help() {
45
45
echo
46
46
echo " Options:"
47
47
echo " -h, --help Display this information"
48
- echo " --tizen-sdk-path Set directory where Tizen will be installed . Default is $TIZEN_SDK_ROOT "
49
- echo " --tizen-sdk-data-path Set directory where Tizen have data. Default is $TIZEN_SDK_DATA_PATH "
50
- echo " --install-dependencies This options install all dependencies. "
48
+ echo " --tizen-sdk-path Set directory for Tizen SDK installation . Default is $TIZEN_SDK_ROOT "
49
+ echo " --tizen-sdk-data-path Set directory for Tizen SDK runtime data. Default is $TIZEN_SDK_DATA_PATH "
50
+ echo " --install-dependencies This option installs all required dependencies"
51
51
echo " --tizen-version Select Tizen version. Default is $TIZEN_VERSION "
52
- echo " --override-secret-tool Circumvent the requirement of having functional D-Bus Secrets service. "
52
+ echo " --override-secret-tool Circumvent the requirement of having functional D-Bus Secrets service"
53
53
echo
54
54
echo " Note:"
55
- echo " The script should run fully with ubuntu. For other distributions you may have to manually"
56
- echo " install all needed dependencies. Use the script specifying --tizen-sdk-path with or"
57
- echo " without --tizen-version. The script will only install Tizen platform for Matter."
55
+ echo " This script does not install full Tizen SDK. It installs only the necessary"
56
+ echo " parts for Matter SDK to be able to build Tizen applications."
57
+ echo " The option '--install-dependencies' should be able to install all required"
58
+ echo " dependencies on any Debian-based distribution. For other distributions the"
59
+ echo " dependencies should be installed manually."
58
60
}
59
61
60
62
# ------------------------------------------------------------------------------
@@ -78,12 +80,12 @@ function warning() {
78
80
# ------------------------------------------------------------------------------
79
81
# Show dependencies
80
82
function show_dependencies() {
81
- warning " Need dependencies for use this script installation SDK: cpio unrpm unzip wget"
82
- warning " Need dependencies for Tizen SDK: JAVA JRE >=8.0"
83
+ warning " Required dependencies for Tizen SDK installation: 7z cpio unzip wget"
84
+ warning " Required dependencies for Tizen SDK: JAVA JRE >=8.0"
83
85
}
84
86
85
87
# ------------------------------------------------------------------------------
86
- # Function helper massive download
88
+ # Helper function for downloading packages.
87
89
# Usage: download "url_dir_package" ${package_array[@]}
88
90
function download() {
89
91
echo " $COLOR_BLUE "
@@ -92,6 +94,10 @@ function download() {
92
94
for PKG in " ${@: 2} " ; do
93
95
PKGS+=(" -A" " $PKG " )
94
96
done
97
+
98
+ # Skip downloading if no packages are specified
99
+ [[ ${# PKGS[@]} -eq 0 ]] && return
100
+
95
101
wget -r -nd --no-parent -e robots=off --progress=dot:mega " ${PKGS[@]} " " $1 "
96
102
97
103
# Check if the files have been downloaded
@@ -106,7 +112,7 @@ function download() {
106
112
}
107
113
108
114
# ------------------------------------------------------------------------------
109
- # Function install all dependencies.
115
+ # Function for installing all dependencies.
110
116
function install_dependencies() {
111
117
if ! command -v apt-get & > /dev/null; then
112
118
show_dependencies
@@ -120,13 +126,22 @@ function install_dependencies() {
120
126
}
121
127
122
128
# ------------------------------------------------------------------------------
123
- # Function clean on EXIT
129
+ # Function for unpacking RPM packages.
130
+ function unrpm() {
131
+ for PKG in " ${@ } " ; do
132
+ echo " Extracting $PKG ..."
133
+ 7z x -so " $PKG " | cpio -idmv
134
+ done
135
+ }
136
+
137
+ # ------------------------------------------------------------------------------
138
+ # Function for cleaning up temporary files on exit.
124
139
function cleanup() {
125
140
rm -rf " ${TMP_DIR:? } "
126
141
}
127
142
128
143
# ------------------------------------------------------------------------------
129
- # Function install tizen sdk .
144
+ # Function for installing Tizen SDK .
130
145
function install_tizen_sdk() {
131
146
132
147
mkdir -p " $TIZEN_SDK_ROOT " || return
@@ -194,9 +209,17 @@ function install_tizen_sdk() {
194
209
' app-core-common-*.rpm'
195
210
' aul-0*.armv7l.rpm'
196
211
' aul-devel-*.armv7l.rpm'
212
+ ' bluetooth-frwk-0*.armv7l.rpm'
197
213
' bundle-0*.armv7l.rpm'
198
214
' bundle-devel-*.armv7l.rpm'
199
215
' buxton2-*.armv7l.rpm'
216
+ ' capi-network-bluetooth-0*.armv7l.rpm'
217
+ ' capi-network-bluetooth-devel-*.armv7l.rpm'
218
+ ' capi-network-nsd-*.armv7l.rpm'
219
+ ' capi-network-thread-*.armv7l.rpm'
220
+ ' capi-system-peripheral-io-*.armv7l.rpm'
221
+ ' capi-system-peripheral-io-devel-*.armv7l.rpm'
222
+ ' capi-system-resource-1*.armv7l.rpm'
200
223
' cynara-devel-*.armv7l.rpm'
201
224
' dbus-1*.armv7l.rpm'
202
225
' dbus-devel-*.armv7l.rpm'
@@ -209,12 +232,14 @@ function install_tizen_sdk() {
209
232
' libcynara-commons-*.armv7l.rpm'
210
233
' libdns_sd-*.armv7l.rpm'
211
234
' libjson-glib-*.armv7l.rpm'
235
+ ' libnsd-dns-sd-*.armv7l.rpm'
212
236
' libsessiond-0*.armv7l.rpm'
213
237
' libsystemd-*.armv7l.rpm'
214
238
' libtzplatform-config-*.armv7l.rpm'
215
239
' parcel-0*.armv7l.rpm'
216
240
' parcel-devel-*.armv7l.rpm'
217
241
' pkgmgr-info-*.armv7l.rpm'
242
+ ' sensord-*.armv7l.rpm'
218
243
' sensord-devel-*.armv7l.rpm'
219
244
' sensord-dummy-*.armv7l.rpm'
220
245
' vconf-compat-*.armv7l.rpm'
@@ -223,22 +248,13 @@ function install_tizen_sdk() {
223
248
224
249
# Unified packages (snapshots)
225
250
URL=" http://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Unified/latest/repos/standard/packages/armv7l/"
226
- PKG_ARR=(
227
- ' bluetooth-frwk-0*.armv7l.rpm'
228
- ' capi-network-bluetooth-0*.armv7l.rpm'
229
- ' capi-network-bluetooth-devel-*.armv7l.rpm'
230
- ' capi-network-nsd-*.armv7l.rpm'
231
- ' capi-network-thread-*.armv7l.rpm'
232
- ' capi-system-peripheral-io-*.armv7l.rpm'
233
- ' capi-system-peripheral-io-devel-*.armv7l.rpm'
234
- ' capi-system-resource-1*.armv7l.rpm'
235
- ' libnsd-dns-sd-*.armv7l.rpm'
236
- ' sensord-*.armv7l.rpm' )
251
+ PKG_ARR=()
237
252
download " $URL " " ${PKG_ARR[@]} "
238
253
239
254
# Tizen Developer Platform Certificate
240
255
URL=" http://download.tizen.org/sdk/extensions/Tizen_IoT_Headless/binary/"
241
- # Tizen site do not has this package available in version 8.0. Certificates are the same for 7.0 and 8.0.
256
+ # Tizen site does not have this package available in version 8.0.
257
+ # Certificates are the same for 7.0 and 8.0, though.
242
258
PKG_ARR=(
243
259
" 7.0-iot-things-add-ons_*_ubuntu-64.zip" )
244
260
download " $URL " " ${PKG_ARR[@]} "
@@ -255,8 +271,7 @@ function install_tizen_sdk() {
255
271
# Install secret tool or not
256
272
if (" $SECRET_TOOL " ); then
257
273
info " Overriding secret tool..."
258
- cp " $SCRIPT_DIR /secret-tool.py" " $TIZEN_SDK_ROOT /tools/certificate-encryptor/secret-tool"
259
- chmod 0755 " $TIZEN_SDK_ROOT /tools/certificate-encryptor/secret-tool"
274
+ install " $SCRIPT_DIR /secret-tool.py" " $TIZEN_SDK_ROOT /tools/certificate-encryptor/secret-tool"
260
275
fi
261
276
262
277
# Configure Tizen CLI
@@ -331,16 +346,16 @@ info "Created tmp directory $TMP_DIR"
331
346
# Checks if the user need install dependencies
332
347
if [ " $INSTALL_DEPENDENCIES " = true ]; then
333
348
if ! install_dependencies; then
334
- error " Cannot install dependencies, please use this script as sudo user or root. Use --help "
349
+ error " Cannot install dependencies, please use this script as sudo user or root."
335
350
show_dependencies
336
351
exit 1
337
352
fi
338
353
fi
339
354
340
355
# ------------------------------------------------------------------------------
341
356
# Checking dependencies needed to install Tizen platform
342
- info " Checking required tools: cpio, java, unrpm , unzip, wget"
343
- for PKG in ' cpio ' ' java ' ' unrpm ' ' unzip' ' wget' ; do
357
+ info " Checking required tools: 7z, cpio, java , unzip, wget"
358
+ for PKG in ' 7z ' ' cpio ' ' java ' ' unzip' ' wget' ; do
344
359
if ! command -v " $PKG " & > /dev/null; then
345
360
error " Required tool not found: $PKG "
346
361
dep_lost=1
0 commit comments