Statistics
| Branch: | Tag: | Revision:

one / install.sh @ ae53d437

History | View | Annotate | Download (38.9 KB)

1
#!/bin/bash
2

    
3
# -------------------------------------------------------------------------- #
4
# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org)             #
5
#                                                                            #
6
# Licensed under the Apache License, Version 2.0 (the "License"); you may    #
7
# not use this file except in compliance with the License. You may obtain    #
8
# a copy of the License at                                                   #
9
#                                                                            #
10
# http://www.apache.org/licenses/LICENSE-2.0                                 #
11
#                                                                            #
12
# Unless required by applicable law or agreed to in writing, software        #
13
# distributed under the License is distributed on an "AS IS" BASIS,          #
14
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
15
# See the License for the specific language governing permissions and        #
16
# limitations under the License.                                             #
17
#--------------------------------------------------------------------------- #
18

    
19
#-------------------------------------------------------------------------------
20
# Install program for OpenNebula. It will install it relative to
21
# $ONE_LOCATION if defined with the -d option, otherwise it'll be installed
22
# under /. In this case you may specified the oneadmin user/group, so you do
23
# not need run the OpenNebula daemon with root priviledges
24
#-------------------------------------------------------------------------------
25

    
26
#-------------------------------------------------------------------------------
27
# COMMAND LINE PARSING
28
#-------------------------------------------------------------------------------
29
usage() {
30
 echo
31
 echo "Usage: install.sh [-u install_user] [-g install_group] [-k keep conf]"
32
 echo "                  [-d ONE_LOCATION] [-c occi|ec2] [-r] [-h]"
33
 echo
34
 echo "-u: user that will run opennebula, defults to user executing install.sh"
35
 echo "-g: group of the user that will run opennebula, defults to user"
36
 echo "    executing install.sh"
37
 echo "-k: keep configuration files of existing OpenNebula installation, useful"
38
 echo "    when upgrading. This flag should not be set when installing"
39
 echo "    OpenNebula for the first time"
40
 echo "-d: target installation directory, if not defined it'd be root. Must be"
41
 echo "    an absolute path."
42
 echo "-c: install client utilities: OpenNebula cli, occi and ec2 client files"
43
 echo "-s: install OpenNebula Sunstone"
44
 echo "-r: remove Opennebula, only useful if -d was not specified, otherwise"
45
 echo "    rm -rf \$ONE_LOCATION would do the job"
46
 echo "-l: creates symlinks instead of copying files, useful for development"
47
 echo "-h: prints this help"
48
}
49
#-------------------------------------------------------------------------------
50

    
51
TEMP_OPT=`getopt -o hkrlcsu:g:d: -n 'install.sh' -- "$@"`
52

    
53
if [ $? != 0 ] ; then
54
    usage
55
    exit 1
56
fi
57

    
58
eval set -- "$TEMP_OPT"
59

    
60
INSTALL_ETC="yes"
61
UNINSTALL="no"
62
LINK="no"
63
CLIENT="no"
64
SUNSTONE="no"
65
ONEADMIN_USER=`id -u`
66
ONEADMIN_GROUP=`id -g`
67
SRC_DIR=$PWD
68

    
69
while true ; do
70
    case "$1" in
71
        -h) usage; exit 0;;
72
        -k) INSTALL_ETC="no"   ; shift ;;
73
        -r) UNINSTALL="yes"   ; shift ;;
74
        -l) LINK="yes" ; shift ;;
75
        -c) CLIENT="yes"; INSTALL_ETC="no" ; shift ;;
76
        -s) SUNSTONE="yes"; INSTALL_ETC="no" ; shift ;;
77
        -u) ONEADMIN_USER="$2" ; shift 2;;
78
        -g) ONEADMIN_GROUP="$2"; shift 2;;
79
        -d) ROOT="$2" ; shift 2 ;;
80
        --) shift ; break ;;
81
        *)  usage; exit 1 ;;
82
    esac
83
done
84

    
85
#-------------------------------------------------------------------------------
86
# Definition of locations
87
#-------------------------------------------------------------------------------
88

    
89
if [ -z "$ROOT" ] ; then
90
    BIN_LOCATION="/usr/bin"
91
    LIB_LOCATION="/usr/lib/one"
92
    ETC_LOCATION="/etc/one"
93
    LOG_LOCATION="/var/log/one"
94
    VAR_LOCATION="/var/lib/one"
95
    SUNSTONE_LOCATION="$LIB_LOCATION/sunstone"
96
    IMAGES_LOCATION="$VAR_LOCATION/images"
97
    RUN_LOCATION="/var/run/one"
98
    LOCK_LOCATION="/var/lock/one"
99
    INCLUDE_LOCATION="/usr/include"
100
    SHARE_LOCATION="/usr/share/one"
101
    MAN_LOCATION="/usr/share/man/man8"
102

    
103
    if [ "$CLIENT" = "yes" ]; then
104
        MAKE_DIRS="$BIN_LOCATION $LIB_LOCATION"
105

    
106
        DELETE_DIRS=""
107

    
108
        CHOWN_DIRS=""
109
    elif [ "$SUNSTONE" = "yes" ]; then
110
        MAKE_DIRS="$BIN_LOCATION $LIB_LOCATION $VAR_LOCATION $SUNSTONE_LOCATION"
111

    
112
        DELETE_DIRS="$MAKE_DIRS"
113

    
114
        CHOWN_DIRS=""
115
    else
116
        MAKE_DIRS="$BIN_LOCATION $LIB_LOCATION $ETC_LOCATION $VAR_LOCATION \
117
                   $INCLUDE_LOCATION $SHARE_LOCATION \
118
                   $LOG_LOCATION $RUN_LOCATION $LOCK_LOCATION \
119
                   $IMAGES_LOCATION $MAN_LOCATION"
120

    
121
        DELETE_DIRS="$LIB_LOCATION $ETC_LOCATION $LOG_LOCATION $VAR_LOCATION \
122
                     $RUN_LOCATION $SHARE_DIRS"
123

    
124
        CHOWN_DIRS="$LOG_LOCATION $VAR_LOCATION $RUN_LOCATION $LOCK_LOCATION"
125
    fi
126

    
127
else
128
    BIN_LOCATION="$ROOT/bin"
129
    LIB_LOCATION="$ROOT/lib"
130
    ETC_LOCATION="$ROOT/etc"
131
    VAR_LOCATION="$ROOT/var"
132
    SUNSTONE_LOCATION="$LIB_LOCATION/sunstone"
133
    IMAGES_LOCATION="$VAR_LOCATION/images"
134
    INCLUDE_LOCATION="$ROOT/include"
135
    SHARE_LOCATION="$ROOT/share"
136
    MAN_LOCATION="$ROOT/share/man/man8"
137

    
138
    if [ "$CLIENT" = "yes" ]; then
139
        MAKE_DIRS="$BIN_LOCATION $LIB_LOCATION"
140

    
141
        DELETE_DIRS="$MAKE_DIRS"
142
    elif [ "$SUNSTONE" = "yes" ]; then
143
        MAKE_DIRS="$BIN_LOCATION $LIB_LOCATION $VAR_LOCATION $SUNSTONE_LOCATION"
144

    
145
        DELETE_DIRS="$MAKE_DIRS"
146
    else
147
        MAKE_DIRS="$BIN_LOCATION $LIB_LOCATION $ETC_LOCATION $VAR_LOCATION \
148
                   $INCLUDE_LOCATION $SHARE_LOCATION $IMAGES_LOCATION \
149
                   $MAN_LOCATION"
150

    
151
        DELETE_DIRS="$MAKE_DIRS"
152

    
153
        CHOWN_DIRS="$ROOT"
154
    fi
155

    
156
    CHOWN_DIRS="$ROOT"
157
fi
158

    
159
SHARE_DIRS="$SHARE_LOCATION/examples \
160
            $SHARE_LOCATION/examples/tm \
161
            $SHARE_LOCATION/hooks"
162

    
163
ETC_DIRS="$ETC_LOCATION/im_kvm \
164
          $ETC_LOCATION/im_xen \
165
          $ETC_LOCATION/im_ec2 \
166
          $ETC_LOCATION/vmm_ec2 \
167
          $ETC_LOCATION/vmm_ssh \
168
          $ETC_LOCATION/vmm_sh \
169
          $ETC_LOCATION/tm_nfs \
170
          $ETC_LOCATION/tm_ssh \
171
          $ETC_LOCATION/tm_dummy \
172
          $ETC_LOCATION/tm_lvm \
173
          $ETC_LOCATION/hm \
174
          $ETC_LOCATION/auth \
175
          $ETC_LOCATION/ec2query_templates \
176
          $ETC_LOCATION/occi_templates"
177

    
178
LIB_DIRS="$LIB_LOCATION/ruby \
179
          $LIB_LOCATION/ruby/OpenNebula \
180
          $LIB_LOCATION/ruby/cloud/ \
181
          $LIB_LOCATION/ruby/cloud/econe \
182
          $LIB_LOCATION/ruby/cloud/econe/views \
183
          $LIB_LOCATION/ruby/cloud/occi \
184
          $LIB_LOCATION/tm_commands \
185
          $LIB_LOCATION/tm_commands/nfs \
186
          $LIB_LOCATION/tm_commands/ssh \
187
          $LIB_LOCATION/tm_commands/dummy \
188
          $LIB_LOCATION/tm_commands/lvm \
189
          $LIB_LOCATION/mads \
190
          $LIB_LOCATION/remotes \
191
          $LIB_LOCATION/remotes/im \
192
          $LIB_LOCATION/remotes/im/kvm.d \
193
          $LIB_LOCATION/remotes/im/xen.d \
194
          $LIB_LOCATION/remotes/im/ganglia.d \
195
          $LIB_LOCATION/remotes/vmm/xen \
196
          $LIB_LOCATION/remotes/vmm/kvm \
197
          $LIB_LOCATION/remotes/image \
198
          $LIB_LOCATION/remotes/image/fs \
199
          $LIB_LOCATION/sh"
200

    
201
VAR_DIRS="$VAR_LOCATION/remotes \
202
          $VAR_LOCATION/remotes/im \
203
          $VAR_LOCATION/remotes/im/kvm.d \
204
          $VAR_LOCATION/remotes/im/xen.d \
205
          $VAR_LOCATION/remotes/im/ganglia.d \
206
          $VAR_LOCATION/remotes/vmm/xen \
207
          $VAR_LOCATION/remotes/vmm/kvm \
208
          $VAR_LOCATION/remotes/image \
209
          $VAR_LOCATION/remotes/image/fs"
210

    
211
SUNSTONE_DIRS="$SUNSTONE_LOCATION/models \
212
               $SUNSTONE_LOCATION/models/OpenNebulaJSON \
213
               $SUNSTONE_LOCATION/public \
214
               $SUNSTONE_LOCATION/public/js \
215
               $SUNSTONE_LOCATION/public/js/plugins \
216
               $SUNSTONE_LOCATION/public/css \
217
               $SUNSTONE_LOCATION/public/vendor \
218
               $SUNSTONE_LOCATION/public/vendor/jQueryLayout \
219
               $SUNSTONE_LOCATION/public/vendor/dataTables \
220
               $SUNSTONE_LOCATION/public/vendor/jQueryUI \
221
               $SUNSTONE_LOCATION/public/vendor/jQuery \
222
               $SUNSTONE_LOCATION/public/vendor/jGrowl \
223
               $SUNSTONE_LOCATION/public/images \
224
               $SUNSTONE_LOCATION/templates"
225

    
226
LIB_ECO_CLIENT_DIRS="$LIB_LOCATION/ruby \
227
                 $LIB_LOCATION/ruby/OpenNebula \
228
                 $LIB_LOCATION/ruby/cloud/ \
229
                 $LIB_LOCATION/ruby/cloud/econe"
230

    
231
LIB_OCCI_CLIENT_DIRS="$LIB_LOCATION/ruby \
232
                 $LIB_LOCATION/ruby/OpenNebula \
233
                 $LIB_LOCATION/ruby/cloud/occi"
234

    
235
LIB_OCA_CLIENT_DIRS="$LIB_LOCATION/ruby \
236
                 $LIB_LOCATION/ruby/OpenNebula"
237

    
238
LIB_CLI_DIRS="$LIB_LOCATION/ruby \
239
              $LIB_LOCATION/ruby/OpenNebula"
240

    
241
if [ "$CLIENT" = "yes" ]; then
242
    MAKE_DIRS="$MAKE_DIRS $LIB_ECO_CLIENT_DIRS $LIB_OCCI_CLIENT_DIRS \
243
               $LIB_CLI_DIRS"
244
elif [ "$SUNSTONE" = "yes" ]; then
245
    MAKE_DIRS="$MAKE_DIRS $SUNSTONE_DIRS $LIB_OCA_CLIENT_DIRS"
246
else
247
    MAKE_DIRS="$MAKE_DIRS $SHARE_DIRS $ETC_DIRS $LIB_DIRS $VAR_DIRS $SUNSTONE_DIRS"
248
fi
249

    
250
#-------------------------------------------------------------------------------
251
#-------------------------------------------------------------------------------
252
# FILE DEFINITION, WHAT IS GOING TO BE INSTALLED AND WHERE
253
#-------------------------------------------------------------------------------
254
#-------------------------------------------------------------------------------
255
INSTALL_FILES=(
256
    BIN_FILES:$BIN_LOCATION
257
    INCLUDE_FILES:$INCLUDE_LOCATION
258
    LIB_FILES:$LIB_LOCATION
259
    RUBY_LIB_FILES:$LIB_LOCATION/ruby
260
    RUBY_OPENNEBULA_LIB_FILES:$LIB_LOCATION/ruby/OpenNebula
261
    MAD_SH_LIB_FILES:$LIB_LOCATION/sh
262
    MAD_SH_LIB_FILES:$LIB_LOCATION/remotes
263
    MAD_SH_LIB_FILES:$VAR_LOCATION/remotes
264
    MADS_LIB_FILES:$LIB_LOCATION/mads
265
    IM_PROBES_FILES:$VAR_LOCATION/remotes/im
266
    IM_PROBES_KVM_FILES:$VAR_LOCATION/remotes/im/kvm.d
267
    IM_PROBES_XEN_FILES:$VAR_LOCATION/remotes/im/xen.d
268
    IM_PROBES_GANGLIA_FILES:$VAR_LOCATION/remotes/im/ganglia.d
269
    VMM_SSH_KVM_SCRIPTS:$VAR_LOCATION/remotes/vmm/kvm
270
    VMM_SSH_XEN_SCRIPTS:$VAR_LOCATION/remotes/vmm/xen
271
    VMM_SSH_XEN_KVM_POLL:$VAR_LOCATION/remotes/vmm/kvm/poll
272
    VMM_SSH_XEN_KVM_POLL:$VAR_LOCATION/remotes/vmm/xen/poll
273
    VMM_SSH_GANGLIA_POLL:$VAR_LOCATION/remotes/vmm/kvm/poll_local
274
    VMM_SSH_GANGLIA_POLL:$VAR_LOCATION/remotes/vmm/xen/poll_local
275
    IM_PROBES_FILES:$LIB_LOCATION/remotes/im
276
    IM_PROBES_KVM_FILES:$LIB_LOCATION/remotes/im/kvm.d
277
    IM_PROBES_XEN_FILES:$LIB_LOCATION/remotes/im/xen.d
278
    IM_PROBES_GANGLIA_FILES:$LIB_LOCATION/remotes/im/ganglia.d
279
    VMM_SSH_KVM_SCRIPTS:$LIB_LOCATION/remotes/vmm/kvm
280
    VMM_SSH_XEN_SCRIPTS:$LIB_LOCATION/remotes/vmm/xen
281
    VMM_SSH_XEN_KVM_POLL:$LIB_LOCATION/remotes/vmm/kvm/poll
282
    VMM_SSH_XEN_KVM_POLL:$LIB_LOCATION/remotes/vmm/xen/poll
283
    VMM_SSH_GANGLIA_POLL:$LIB_LOCATION/remotes/vmm/kvm/poll_local
284
    VMM_SSH_GANGLIA_POLL:$LIB_LOCATION/remotes/vmm/xen/poll_local
285
    NFS_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/nfs
286
    SSH_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/ssh
287
    DUMMY_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/dummy
288
    LVM_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/lvm
289
    IMAGE_DRIVER_FS_SCRIPTS:$LIB_LOCATION/remotes/image/fs
290
    IMAGE_DRIVER_FS_SCRIPTS:$VAR_LOCATION/remotes/image/fs
291
    EXAMPLE_SHARE_FILES:$SHARE_LOCATION/examples
292
    TM_EXAMPLE_SHARE_FILES:$SHARE_LOCATION/examples/tm
293
    HOOK_SHARE_FILES:$SHARE_LOCATION/hooks
294
    COMMON_CLOUD_LIB_FILES:$LIB_LOCATION/ruby/cloud
295
    ECO_LIB_FILES:$LIB_LOCATION/ruby/cloud/econe
296
    ECO_LIB_VIEW_FILES:$LIB_LOCATION/ruby/cloud/econe/views
297
    ECO_BIN_FILES:$BIN_LOCATION
298
    OCCI_LIB_FILES:$LIB_LOCATION/ruby/cloud/occi
299
    OCCI_BIN_FILES:$BIN_LOCATION
300
    MAN_FILES:$MAN_LOCATION
301
)
302

    
303
INSTALL_CLIENT_FILES=(
304
    COMMON_CLOUD_CLIENT_LIB_FILES:$LIB_LOCATION/ruby/cloud
305
    ECO_LIB_CLIENT_FILES:$LIB_LOCATION/ruby/cloud/econe
306
    ECO_BIN_CLIENT_FILES:$BIN_LOCATION
307
    COMMON_CLOUD_CLIENT_LIB_FILES:$LIB_LOCATION/ruby/cloud
308
    OCCI_LIB_CLIENT_FILES:$LIB_LOCATION/ruby/cloud/occi
309
    OCCI_BIN_CLIENT_FILES:$BIN_LOCATION
310
    CLI_BIN_FILES:$BIN_LOCATION
311
    CLI_LIB_FILES:$LIB_LOCATION/ruby
312
    RUBY_OPENNEBULA_LIB_FILES:$LIB_LOCATION/ruby/OpenNebula
313
)
314

    
315
INSTALL_SUNSTONE_RUBY_FILES=(
316
    SUNSTONE_RUBY_LIB_FILES:$LIB_LOCATION/ruby
317
    RUBY_OPENNEBULA_LIB_FILES:$LIB_LOCATION/ruby/OpenNebula
318
)
319

    
320
INSTALL_SUNSTONE_FILES=(
321
    SUNSTONE_FILES:$SUNSTONE_LOCATION
322
    SUNSTONE_BIN_FILES:$BIN_LOCATION
323
    SUNSTONE_MODELS_FILES:$SUNSTONE_LOCATION/models
324
    SUNSTONE_MODELS_JSON_FILES:$SUNSTONE_LOCATION/models/OpenNebulaJSON
325
    SUNSTONE_TEMPLATE_FILES:$SUNSTONE_LOCATION/templates
326
    SUNSTONE_PUBLIC_JS_FILES:$SUNSTONE_LOCATION/public/js
327
    SUNSTONE_PUBLIC_JS_PLUGINS_FILES:$SUNSTONE_LOCATION/public/js/plugins
328
    SUNSTONE_PUBLIC_CSS_FILES:$SUNSTONE_LOCATION/public/css
329
    SUNSTONE_PUBLIC_VENDOR_DATATABLES:$SUNSTONE_LOCATION/public/vendor/dataTables
330
    SUNSTONE_PUBLIC_VENDOR_JGROWL:$SUNSTONE_LOCATION/public/vendor/jGrowl
331
    SUNSTONE_PUBLIC_VENDOR_JQUERY:$SUNSTONE_LOCATION/public/vendor/jQuery
332
    SUNSTONE_PUBLIC_VENDOR_JQUERYUI:$SUNSTONE_LOCATION/public/vendor/jQueryUI
333
    SUNSTONE_PUBLIC_VENDOR_JQUERYLAYOUT:$SUNSTONE_LOCATION/public/vendor/jQueryLayout
334
    SUNSTONE_PUBLIC_IMAGES_FILES:$SUNSTONE_LOCATION/public/images
335
)
336

    
337
INSTALL_ETC_FILES=(
338
    ETC_FILES:$ETC_LOCATION
339
    VMM_EC2_ETC_FILES:$ETC_LOCATION/vmm_ec2
340
    VMM_SSH_ETC_FILES:$ETC_LOCATION/vmm_ssh
341
    VMM_SH_ETC_FILES:$ETC_LOCATION/vmm_sh
342
    IM_EC2_ETC_FILES:$ETC_LOCATION/im_ec2
343
    TM_NFS_ETC_FILES:$ETC_LOCATION/tm_nfs
344
    TM_SSH_ETC_FILES:$ETC_LOCATION/tm_ssh
345
    TM_DUMMY_ETC_FILES:$ETC_LOCATION/tm_dummy
346
    TM_LVM_ETC_FILES:$ETC_LOCATION/tm_lvm
347
    HM_ETC_FILES:$ETC_LOCATION/hm
348
    AUTH_ETC_FILES:$ETC_LOCATION/auth
349
    ECO_ETC_FILES:$ETC_LOCATION
350
    ECO_ETC_TEMPLATE_FILES:$ETC_LOCATION/ec2query_templates
351
    OCCI_ETC_FILES:$ETC_LOCATION
352
    OCCI_ETC_TEMPLATE_FILES:$ETC_LOCATION/occi_templates
353
)
354

    
355
#-------------------------------------------------------------------------------
356
# Binary files, to be installed under $BIN_LOCATION
357
#-------------------------------------------------------------------------------
358

    
359
BIN_FILES="src/nebula/oned \
360
           src/scheduler/src/sched/mm_sched \
361
           src/cli/onevm \
362
           src/cli/onehost \
363
           src/cli/onevnet \
364
           src/cli/oneuser \
365
           src/cli/oneimage \
366
           src/cli/onecluster \
367
           src/cli/onetemplate \
368
           src/cli/onegroup \
369
           share/scripts/one \
370
           src/authm_mad/oneauth"
371

    
372
#-------------------------------------------------------------------------------
373
# C/C++ OpenNebula API Library & Development files
374
# Include files, to be installed under $INCLUDE_LOCATION
375
# Library files, to be installed under $LIB_LOCATION
376
#-------------------------------------------------------------------------------
377

    
378
INCLUDE_FILES=""
379
LIB_FILES=""
380

    
381
#-------------------------------------------------------------------------------
382
# Ruby library files, to be installed under $LIB_LOCATION/ruby
383
#-------------------------------------------------------------------------------
384

    
385
RUBY_LIB_FILES="src/mad/ruby/ActionManager.rb \
386
                src/mad/ruby/CommandManager.rb \
387
                src/mad/ruby/OpenNebulaDriver.rb \
388
                src/mad/ruby/VirtualMachineDriver.rb \
389
                src/mad/ruby/Ganglia.rb \
390
                src/cli/client_utilities.rb \
391
                src/cli/command_parse.rb \
392
                src/oca/ruby/OpenNebula.rb \
393
                src/tm_mad/TMScript.rb \
394
                src/authm_mad/one_usage.rb \
395
                src/authm_mad/quota.rb \
396
                src/authm_mad/simple_auth.rb \
397
                src/authm_mad/simple_permissions.rb \
398
                src/authm_mad/ssh_auth.rb"
399

    
400
RUBY_OPENNEBULA_LIB_FILES="src/oca/ruby/OpenNebula/Host.rb \
401
                           src/oca/ruby/OpenNebula/HostPool.rb \
402
                           src/oca/ruby/OpenNebula/Pool.rb \
403
                           src/oca/ruby/OpenNebula/User.rb \
404
                           src/oca/ruby/OpenNebula/UserPool.rb \
405
                           src/oca/ruby/OpenNebula/VirtualMachine.rb \
406
                           src/oca/ruby/OpenNebula/VirtualMachinePool.rb \
407
                           src/oca/ruby/OpenNebula/VirtualNetwork.rb \
408
                           src/oca/ruby/OpenNebula/VirtualNetworkPool.rb \
409
                           src/oca/ruby/OpenNebula/Image.rb \
410
                           src/oca/ruby/OpenNebula/ImagePool.rb \
411
                           src/oca/ruby/OpenNebula/Cluster.rb \
412
                           src/oca/ruby/OpenNebula/ClusterPool.rb \
413
                           src/oca/ruby/OpenNebula/Template.rb \
414
                           src/oca/ruby/OpenNebula/TemplatePool.rb \
415
                           src/oca/ruby/OpenNebula/Group.rb \
416
                           src/oca/ruby/OpenNebula/GroupPool.rb \
417
                           src/oca/ruby/OpenNebula/XMLUtils.rb"
418

    
419

    
420
#-----------------------------------------------------------------------------
421
# MAD ShellScript library files, to be installed under $LIB_LOCATION/sh
422
# and remotes directory
423
#-----------------------------------------------------------------------------
424

    
425
MAD_SH_LIB_FILES="src/mad/sh/scripts_common.sh"
426

    
427
#-------------------------------------------------------------------------------
428
# Driver executable files, to be installed under $LIB_LOCATION/mads
429
#-------------------------------------------------------------------------------
430

    
431
MADS_LIB_FILES="src/mad/sh/madcommon.sh \
432
              src/tm_mad/tm_common.sh \
433
              src/vmm_mad/ssh/one_vmm_ssh.rb \
434
              src/vmm_mad/ssh/one_vmm_ssh \
435
              src/vmm_mad/sh/one_vmm_sh.rb \
436
              src/vmm_mad/sh/one_vmm_sh \
437
              src/vmm_mad/ec2/one_vmm_ec2.rb \
438
              src/vmm_mad/ec2/one_vmm_ec2 \
439
              src/vmm_mad/dummy/one_vmm_dummy.rb \
440
              src/vmm_mad/dummy/one_vmm_dummy \
441
              src/im_mad/im_ssh/one_im_ssh.rb \
442
              src/im_mad/im_ssh/one_im_ssh \
443
              src/im_mad/im_sh/one_im_sh.rb \
444
              src/im_mad/im_sh/one_im_sh \
445
              src/im_mad/ec2/one_im_ec2.rb \
446
              src/im_mad/ec2/one_im_ec2 \
447
              src/im_mad/dummy/one_im_dummy.rb \
448
              src/im_mad/dummy/one_im_dummy \
449
              src/tm_mad/one_tm \
450
              src/tm_mad/one_tm.rb \
451
              src/hm_mad/one_hm.rb \
452
              src/hm_mad/one_hm \
453
              src/authm_mad/one_auth_mad.rb \
454
              src/authm_mad/one_auth_mad \
455
              src/image_mad/one_image.rb \
456
              src/image_mad/one_image"
457

    
458
#-------------------------------------------------------------------------------
459
# VMM SH Driver KVM scripts, to be installed under $REMOTES_LOCATION/vmm/kvm
460
#-------------------------------------------------------------------------------
461

    
462
VMM_SSH_KVM_SCRIPTS="src/vmm_mad/remotes/kvm/cancel \
463
                    src/vmm_mad/remotes/kvm/deploy \
464
                    src/vmm_mad/remotes/kvm/kvmrc \
465
                    src/vmm_mad/remotes/kvm/migrate \
466
                    src/vmm_mad/remotes/kvm/restore \
467
                    src/vmm_mad/remotes/kvm/save \
468
                    src/vmm_mad/remotes/kvm/shutdown"
469

    
470
#-------------------------------------------------------------------------------
471
# VMM SH Driver Xen scripts, to be installed under $REMOTES_LOCATION/vmm/xen
472
#-------------------------------------------------------------------------------
473

    
474
VMM_SSH_XEN_SCRIPTS="src/vmm_mad/remotes/xen/cancel \
475
                    src/vmm_mad/remotes/xen/deploy \
476
                    src/vmm_mad/remotes/xen/xenrc \
477
                    src/vmm_mad/remotes/xen/migrate \
478
                    src/vmm_mad/remotes/xen/restore \
479
                    src/vmm_mad/remotes/xen/save \
480
                    src/vmm_mad/remotes/xen/shutdown"
481

    
482
#-----------------------------------------------------------------------------
483
# VMM SH Driver xen/kvm scripts, to be installed under $REMOTES_LOCATION/vmm/*
484
#-----------------------------------------------------------------------------
485

    
486
VMM_SSH_XEN_KVM_POLL="src/vmm_mad/remotes/poll_xen_kvm.rb"
487
VMM_SSH_GANGLIA_POLL="src/vmm_mad/remotes/poll_ganglia.rb"
488

    
489
#-------------------------------------------------------------------------------
490
# Information Manager Probes, to be installed under $LIB_LOCATION/remotes
491
#-------------------------------------------------------------------------------
492

    
493
IM_PROBES_FILES="src/im_mad/remotes/run_probes"
494

    
495
IM_PROBES_XEN_FILES="src/im_mad/remotes/xen.d/xen.rb \
496
                    src/im_mad/remotes/xen.d/architecture.sh \
497
                    src/im_mad/remotes/xen.d/cpu.sh \
498
                    src/im_mad/remotes/xen.d/name.sh"
499

    
500
IM_PROBES_KVM_FILES="src/im_mad/remotes/kvm.d/kvm.rb \
501
                    src/im_mad/remotes/kvm.d/architecture.sh \
502
                    src/im_mad/remotes/kvm.d/cpu.sh \
503
                    src/im_mad/remotes/kvm.d/name.sh"
504

    
505
IM_PROBES_GANGLIA_FILES="src/im_mad/remotes/ganglia.d/ganglia_probe"
506

    
507

    
508
#-------------------------------------------------------------------------------
509
# Transfer Manager commands, to be installed under $LIB_LOCATION/tm_commands
510
#   - NFS TM, $LIB_LOCATION/tm_commands/nfs
511
#   - SSH TM, $LIB_LOCATION/tm_commands/ssh
512
#   - dummy TM, $LIB_LOCATION/tm_commands/dummy
513
#   - LVM TM, $LIB_LOCATION/tm_commands/lvm
514
#-------------------------------------------------------------------------------
515

    
516
NFS_TM_COMMANDS_LIB_FILES="src/tm_mad/nfs/tm_clone.sh \
517
                           src/tm_mad/nfs/tm_delete.sh \
518
                           src/tm_mad/nfs/tm_ln.sh \
519
                           src/tm_mad/nfs/tm_mkswap.sh \
520
                           src/tm_mad/nfs/tm_mkimage.sh \
521
                           src/tm_mad/nfs/tm_mv.sh \
522
                           src/tm_mad/nfs/tm_context.sh"
523

    
524
SSH_TM_COMMANDS_LIB_FILES="src/tm_mad/ssh/tm_clone.sh \
525
                           src/tm_mad/ssh/tm_delete.sh \
526
                           src/tm_mad/ssh/tm_ln.sh \
527
                           src/tm_mad/ssh/tm_mkswap.sh \
528
                           src/tm_mad/ssh/tm_mkimage.sh \
529
                           src/tm_mad/ssh/tm_mv.sh \
530
                           src/tm_mad/ssh/tm_context.sh"
531

    
532
DUMMY_TM_COMMANDS_LIB_FILES="src/tm_mad/dummy/tm_dummy.sh"
533

    
534
LVM_TM_COMMANDS_LIB_FILES="src/tm_mad/lvm/tm_clone.sh \
535
                           src/tm_mad/lvm/tm_delete.sh \
536
                           src/tm_mad/lvm/tm_ln.sh \
537
                           src/tm_mad/lvm/tm_mkswap.sh \
538
                           src/tm_mad/lvm/tm_mkimage.sh \
539
                           src/tm_mad/lvm/tm_mv.sh \
540
                           src/tm_mad/lvm/tm_context.sh"
541

    
542
#-------------------------------------------------------------------------------
543
# Image Repository drivers, to be installed under $REMOTES_LOCTION/image
544
#   - FS based Image Repository, $REMOTES_LOCATION/image/fs
545
#-------------------------------------------------------------------------------
546
IMAGE_DRIVER_FS_SCRIPTS="src/image_mad/remotes/fs/cp \
547
                         src/image_mad/remotes/fs/mkfs \
548
                         src/image_mad/remotes/fs/mv \
549
                         src/image_mad/remotes/fs/fsrc \
550
                         src/image_mad/remotes/fs/rm"
551

    
552
#-------------------------------------------------------------------------------
553
# Configuration files for OpenNebula, to be installed under $ETC_LOCATION
554
#-------------------------------------------------------------------------------
555

    
556
ETC_FILES="share/etc/oned.conf \
557
           share/etc/defaultrc"
558

    
559
#-------------------------------------------------------------------------------
560
# Virtualization drivers config. files, to be installed under $ETC_LOCATION
561
#   - ec2, $ETC_LOCATION/vmm_ec2
562
#   - sh, $ETC_LOCATION/vmm_sh
563
#   - ssh, $ETC_LOCATION/vmm_ssh
564
#-------------------------------------------------------------------------------
565

    
566
VMM_EC2_ETC_FILES="src/vmm_mad/ec2/vmm_ec2rc \
567
                   src/vmm_mad/ec2/vmm_ec2.conf"
568

    
569
VMM_SSH_ETC_FILES="src/vmm_mad/ssh/vmm_sshrc \
570
                  src/vmm_mad/ssh/vmm_ssh_kvm.conf \
571
                  src/vmm_mad/ssh/vmm_ssh_xen.conf"
572

    
573
VMM_SH_ETC_FILES="src/vmm_mad/sh/vmm_shrc"
574

    
575
#-------------------------------------------------------------------------------
576
# Information drivers config. files, to be installed under $ETC_LOCATION
577
#   - ec2, $ETC_LOCATION/im_ec2
578
#-------------------------------------------------------------------------------
579

    
580
IM_EC2_ETC_FILES="src/im_mad/ec2/im_ec2rc \
581
                  src/im_mad/ec2/im_ec2.conf"
582

    
583
#-------------------------------------------------------------------------------
584
# Storage drivers config. files, to be installed under $ETC_LOCATION
585
#   - nfs, $ETC_LOCATION/tm_nfs
586
#   - ssh, $ETC_LOCATION/tm_ssh
587
#   - dummy, $ETC_LOCATION/tm_dummy
588
#   - lvm, $ETC_LOCATION/tm_lvm
589
#-------------------------------------------------------------------------------
590

    
591
TM_NFS_ETC_FILES="src/tm_mad/nfs/tm_nfs.conf \
592
                  src/tm_mad/nfs/tm_nfsrc"
593

    
594
TM_SSH_ETC_FILES="src/tm_mad/ssh/tm_ssh.conf \
595
                  src/tm_mad/ssh/tm_sshrc"
596

    
597
TM_DUMMY_ETC_FILES="src/tm_mad/dummy/tm_dummy.conf \
598
                    src/tm_mad/dummy/tm_dummyrc"
599

    
600
TM_LVM_ETC_FILES="src/tm_mad/lvm/tm_lvm.conf \
601
                  src/tm_mad/lvm/tm_lvmrc"
602

    
603
#-------------------------------------------------------------------------------
604
# Hook Manager driver config. files, to be installed under $ETC_LOCATION/hm
605
#-------------------------------------------------------------------------------
606

    
607
HM_ETC_FILES="src/hm_mad/hmrc"
608

    
609
#-------------------------------------------------------------------------------
610
# Hook Manager driver config. files, to be installed under $ETC_LOCATION/hm
611
#-------------------------------------------------------------------------------
612

    
613
AUTH_ETC_FILES="src/authm_mad/auth_mad \
614
                src/authm_mad/auth.conf"
615

    
616
#-------------------------------------------------------------------------------
617
# Sample files, to be installed under $SHARE_LOCATION/examples
618
#-------------------------------------------------------------------------------
619

    
620
EXAMPLE_SHARE_FILES="share/examples/vm.template \
621
                     share/examples/private.net \
622
                     share/examples/public.net"
623

    
624
#-------------------------------------------------------------------------------
625
# TM Sample files, to be installed under $SHARE_LOCATION/examples/tm
626
#-------------------------------------------------------------------------------
627

    
628
TM_EXAMPLE_SHARE_FILES="share/examples/tm/tm_clone.sh \
629
                        share/examples/tm/tm_delete.sh \
630
                        share/examples/tm/tm_ln.sh \
631
                        share/examples/tm/tm_mkimage.sh \
632
                        share/examples/tm/tm_mkswap.sh \
633
                        share/examples/tm/tm_mv.sh"
634

    
635
#-------------------------------------------------------------------------------
636
# HOOK scripts, to be installed under $SHARE_LOCATION/hooks
637
#-------------------------------------------------------------------------------
638

    
639
HOOK_SHARE_FILES="share/hooks/ebtables-xen \
640
                  share/hooks/ebtables-kvm \
641
                  share/hooks/ebtables-flush \
642
                  share/hooks/host_error.rb \
643
                  share/hooks/image.rb"
644

    
645
#-------------------------------------------------------------------------------
646
# Common Cloud Files
647
#-------------------------------------------------------------------------------
648

    
649
COMMON_CLOUD_LIB_FILES="src/cloud/common/CloudServer.rb \
650
                        src/cloud/common/CloudClient.rb \
651
                        src/cloud/common/Configuration.rb"
652

    
653
COMMON_CLOUD_CLIENT_LIB_FILES="src/cloud/common/CloudClient.rb"
654

    
655
#-------------------------------------------------------------------------------
656
# EC2 Query for OpenNebula
657
#-------------------------------------------------------------------------------
658

    
659
ECO_LIB_FILES="src/cloud/ec2/lib/EC2QueryClient.rb \
660
               src/cloud/ec2/lib/EC2QueryServer.rb \
661
               src/cloud/ec2/lib/ImageEC2.rb \
662
               src/cloud/ec2/lib/econe-server.rb"
663

    
664
ECO_LIB_CLIENT_FILES="src/cloud/ec2/lib/EC2QueryClient.rb"
665

    
666
ECO_LIB_VIEW_FILES="src/cloud/ec2/lib/views/describe_images.erb \
667
                    src/cloud/ec2/lib/views/describe_instances.erb \
668
                    src/cloud/ec2/lib/views/register_image.erb \
669
                    src/cloud/ec2/lib/views/run_instances.erb \
670
                    src/cloud/ec2/lib/views/terminate_instances.erb"
671

    
672
ECO_BIN_FILES="src/cloud/ec2/bin/econe-server \
673
               src/cloud/ec2/bin/econe-describe-images \
674
               src/cloud/ec2/bin/econe-describe-instances \
675
               src/cloud/ec2/bin/econe-register \
676
               src/cloud/ec2/bin/econe-run-instances \
677
               src/cloud/ec2/bin/econe-terminate-instances \
678
               src/cloud/ec2/bin/econe-upload"
679

    
680
ECO_BIN_CLIENT_FILES="src/cloud/ec2/bin/econe-describe-images \
681
               src/cloud/ec2/bin/econe-describe-instances \
682
               src/cloud/ec2/bin/econe-register \
683
               src/cloud/ec2/bin/econe-run-instances \
684
               src/cloud/ec2/bin/econe-terminate-instances \
685
               src/cloud/ec2/bin/econe-upload"
686

    
687
ECO_ETC_FILES="src/cloud/ec2/etc/econe.conf"
688

    
689
ECO_ETC_TEMPLATE_FILES="src/cloud/ec2/etc/templates/m1.small.erb"
690

    
691
#-----------------------------------------------------------------------------
692
# OCCI files
693
#-----------------------------------------------------------------------------
694

    
695
OCCI_LIB_FILES="src/cloud/occi/lib/OCCIServer.rb \
696
                src/cloud/occi/lib/occi-server.rb \
697
                src/cloud/occi/lib/OCCIClient.rb \
698
                src/cloud/occi/lib/VirtualMachineOCCI.rb \
699
                src/cloud/occi/lib/VirtualMachinePoolOCCI.rb \
700
                src/cloud/occi/lib/VirtualNetworkOCCI.rb \
701
                src/cloud/occi/lib/VirtualNetworkPoolOCCI.rb \
702
                src/cloud/occi/lib/ImageOCCI.rb \
703
                src/cloud/occi/lib/ImagePoolOCCI.rb"
704

    
705
OCCI_LIB_CLIENT_FILES="src/cloud/occi/lib/OCCIClient.rb"
706

    
707
OCCI_BIN_FILES="src/cloud/occi/bin/occi-server \
708
               src/cloud/occi/bin/occi-compute \
709
               src/cloud/occi/bin/occi-network \
710
               src/cloud/occi/bin/occi-storage"
711

    
712
OCCI_BIN_CLIENT_FILES="src/cloud/occi/bin/occi-compute \
713
               src/cloud/occi/bin/occi-network \
714
               src/cloud/occi/bin/occi-storage"
715

    
716
OCCI_ETC_FILES="src/cloud/occi/etc/occi-server.conf"
717

    
718
OCCI_ETC_TEMPLATE_FILES="src/cloud/occi/etc/templates/common.erb \
719
                    src/cloud/occi/etc/templates/custom.erb \
720
                    src/cloud/occi/etc/templates/small.erb \
721
                    src/cloud/occi/etc/templates/medium.erb \
722
                    src/cloud/occi/etc/templates/large.erb"
723

    
724
#-----------------------------------------------------------------------------
725
# CLI files
726
#-----------------------------------------------------------------------------
727

    
728
CLI_LIB_FILES="src/mad/ruby/CommandManager.rb \
729
               src/cli/client_utilities.rb \
730
               src/cli/command_parse.rb \
731
               src/oca/ruby/OpenNebula.rb"
732

    
733
CLI_BIN_FILES="src/cli/onevm \
734
               src/cli/onehost \
735
               src/cli/onevnet \
736
               src/cli/oneuser \
737
               src/cli/oneimage \
738
               src/cli/onecluster \
739
               src/cli/onetemplate \
740
               src/cli/onegroup"
741

    
742
#-----------------------------------------------------------------------------
743
# Sunstone files
744
#-----------------------------------------------------------------------------
745

    
746
SUNSTONE_FILES="src/sunstone/config.ru \
747
                src/sunstone/sunstone-server.rb"
748

    
749
SUNSTONE_BIN_FILES="src/sunstone/bin/sunstone-server"
750

    
751
SUNSTONE_MODELS_FILES="src/sunstone/models/OpenNebulaJSON.rb \
752
                       src/sunstone/models/SunstoneServer.rb"
753

    
754
SUNSTONE_MODELS_JSON_FILES="src/sunstone/models/OpenNebulaJSON/ClusterJSON.rb \
755
                    src/sunstone/models/OpenNebulaJSON/HostJSON.rb \
756
                    src/sunstone/models/OpenNebulaJSON/ImageJSON.rb \
757
                    src/sunstone/models/OpenNebulaJSON/JSONUtils.rb \
758
                    src/sunstone/models/OpenNebulaJSON/PoolJSON.rb \
759
                    src/sunstone/models/OpenNebulaJSON/UserJSON.rb \
760
                    src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb \
761
                    src/sunstone/models/OpenNebulaJSON/VirtualNetworkJSON.rb"
762

    
763
SUNSTONE_TEMPLATE_FILES="src/sunstone/templates/index.html \
764
                         src/sunstone/templates/login.html"
765

    
766
SUNSTONE_PUBLIC_JS_FILES="src/sunstone/public/js/layout.js \
767
                        src/sunstone/public/js/login.js \
768
                        src/sunstone/public/js/sunstone.js \
769
                        src/sunstone/public/js/sunstone-util.js \
770
                        src/sunstone/public/js/opennebula.js"
771

    
772
SUNSTONE_PUBLIC_JS_PLUGINS_FILES="\
773
                            src/sunstone/public/js/plugins/dashboard-tab.js \
774
                            src/sunstone/public/js/plugins/hosts-tab.js \
775
                            src/sunstone/public/js/plugins/images-tab.js \
776
                            src/sunstone/public/js/plugins/users-tab.js \
777
                            src/sunstone/public/js/plugins/vms-tab.js \
778
                            src/sunstone/public/js/plugins/vnets-tab.js"
779

    
780
SUNSTONE_PUBLIC_CSS_FILES="src/sunstone/public/css/application.css \
781
                           src/sunstone/public/css/layout.css \
782
                           src/sunstone/public/css/login.css"
783

    
784
SUNSTONE_PUBLIC_VENDOR_DATATABLES="\
785
                src/sunstone/public/vendor/dataTables/jquery.dataTables.min.js \
786
                src/sunstone/public/vendor/dataTables/demo_table_jui.css \
787
                src/sunstone/public/vendor/dataTables/BSD-LICENSE.txt \
788
                src/sunstone/public/vendor/dataTables/NOTICE"
789

    
790
SUNSTONE_PUBLIC_VENDOR_JGROWL="\
791
                src/sunstone/public/vendor/jGrowl/jquery.jgrowl_minimized.js \
792
                src/sunstone/public/vendor/jGrowl/jquery.jgrowl.css \
793
                src/sunstone/public/vendor/jGrowl/NOTICE"
794

    
795
SUNSTONE_PUBLIC_VENDOR_JQUERY="\
796
                        src/sunstone/public/vendor/jQuery/jquery-1.4.4.min.js \
797
                        src/sunstone/public/vendor/jQuery/MIT-LICENSE.txt \
798
                        src/sunstone/public/vendor/jQuery/NOTICE"
799

    
800
SUNSTONE_PUBLIC_VENDOR_JQUERYUI="\
801
src/sunstone/public/vendor/jQueryUI/ui-bg_glass_75_dadada_1x400.png \
802
src/sunstone/public/vendor/jQueryUI/ui-icons_cd0a0a_256x240.png \
803
src/sunstone/public/vendor/jQueryUI/jquery-ui-1.8.7.custom.css \
804
src/sunstone/public/vendor/jQueryUI/ui-bg_flat_0_aaaaaa_40x100.png \
805
src/sunstone/public/vendor/jQueryUI/ui-bg_flat_0_8f9392_40x100.png \
806
src/sunstone/public/vendor/jQueryUI/MIT-LICENSE.txt \
807
src/sunstone/public/vendor/jQueryUI/jquery-ui-1.8.7.custom.min.js \
808
src/sunstone/public/vendor/jQueryUI/ui-bg_highlight-soft_75_cccccc_1x100.png \
809
src/sunstone/public/vendor/jQueryUI/ui-bg_glass_95_fef1ec_1x400.png \
810
src/sunstone/public/vendor/jQueryUI/ui-bg_glass_55_fbf9ee_1x400.png \
811
src/sunstone/public/vendor/jQueryUI/ui-icons_888888_256x240.png \
812
src/sunstone/public/vendor/jQueryUI/ui-bg_glass_75_e6e6e6_1x400.png \
813
src/sunstone/public/vendor/jQueryUI/ui-bg_flat_0_575c5b_40x100.png \
814
src/sunstone/public/vendor/jQueryUI/ui-bg_glass_65_ffffff_1x400.png \
815
src/sunstone/public/vendor/jQueryUI/ui-bg_flat_75_ffffff_40x100.png \
816
src/sunstone/public/vendor/jQueryUI/ui-icons_2e83ff_256x240.png \
817
src/sunstone/public/vendor/jQueryUI/ui-icons_454545_256x240.png \
818
src/sunstone/public/vendor/jQueryUI/NOTICE \
819
src/sunstone/public/vendor/jQueryUI/ui-icons_222222_256x240.png \
820
"
821
SUNSTONE_PUBLIC_VENDOR_JQUERYLAYOUT="\
822
            src/sunstone/public/vendor/jQueryLayout/layout-default-latest.css \
823
            src/sunstone/public/vendor/jQueryLayout/jquery.layout.min-1.2.0.js \
824
            src/sunstone/public/vendor/jQueryLayout/NOTICE"
825

    
826
SUNSTONE_PUBLIC_IMAGES_FILES="src/sunstone/public/images/ajax-loader.gif \
827
                        src/sunstone/public/images/login_over.png \
828
                        src/sunstone/public/images/login.png \
829
                        src/sunstone/public/images/opennebula-sunstone-big.png \
830
                        src/sunstone/public/images/opennebula-sunstone-small.png \
831
                        src/sunstone/public/images/panel.png \
832
                        src/sunstone/public/images/pbar.gif \
833
                        src/sunstone/public/images/Refresh-icon.png"
834

    
835
SUNSTONE_RUBY_LIB_FILES="src/mad/ruby/CommandManager.rb \
836
                         src/oca/ruby/OpenNebula.rb"
837

    
838
#-----------------------------------------------------------------------------
839
# MAN files
840
#-----------------------------------------------------------------------------
841

    
842
MAN_FILES="share/man/oneauth.8.gz \
843
        share/man/onecluster.8.gz \
844
        share/man/onehost.8.gz \
845
        share/man/oneimage.8.gz \
846
        share/man/oneuser.8.gz \
847
        share/man/onevm.8.gz \
848
        share/man/onevnet.8.gz \
849
        share/man/onetemplate.8.gz \
850
        share/man/onegroup.8.gz \
851
        share/man/econe-describe-images.8.gz \
852
        share/man/econe-describe-instances.8.gz \
853
        share/man/econe-register.8.gz \
854
        share/man/econe-run-instances.8.gz \
855
        share/man/econe-terminate-instances.8.gz \
856
        share/man/econe-upload.8.gz \
857
        share/man/occi-compute.8.gz \
858
        share/man/occi-network.8.gz \
859
        share/man/occi-storage.8.gz"
860

    
861
#-----------------------------------------------------------------------------
862
#-----------------------------------------------------------------------------
863
# INSTALL.SH SCRIPT
864
#-----------------------------------------------------------------------------
865
#-----------------------------------------------------------------------------
866

    
867
# --- Create OpenNebula directories ---
868

    
869
if [ "$UNINSTALL" = "no" ] ; then
870
    for d in $MAKE_DIRS; do
871
        mkdir -p $DESTDIR$d
872
    done
873
fi
874

    
875
# --- Install/Uninstall files ---
876

    
877
do_file() {
878
    if [ "$UNINSTALL" = "yes" ]; then
879
        rm $2/`basename $1`
880
    else
881
        if [ "$LINK" = "yes" ]; then
882
            ln -s $SRC_DIR/$1 $DESTDIR$2
883
        else
884
            cp $SRC_DIR/$1 $DESTDIR$2
885
        fi
886
    fi
887
}
888

    
889

    
890
if [ "$CLIENT" = "yes" ]; then
891
    INSTALL_SET=${INSTALL_CLIENT_FILES[@]}
892
elif [ "$SUNSTONE" = "yes" ]; then
893
    INSTALL_SET="${INSTALL_SUNSTONE_RUBY_FILES[@]} ${INSTALL_SUNSTONE_FILES[@]}"
894
else
895
    INSTALL_SET="${INSTALL_FILES[@]} ${INSTALL_SUNSTONE_FILES[@]}"
896
fi
897

    
898
for i in ${INSTALL_SET[@]}; do
899
    SRC=$`echo $i | cut -d: -f1`
900
    DST=`echo $i | cut -d: -f2`
901

    
902
    eval SRC_FILES=$SRC
903

    
904
    for f in $SRC_FILES; do
905
        do_file $f $DST
906
    done
907
done
908

    
909
if [ "$INSTALL_ETC" = "yes" ] ; then
910
    for i in ${INSTALL_ETC_FILES[@]}; do
911
        SRC=$`echo $i | cut -d: -f1`
912
        DST=`echo $i | cut -d: -f2`
913

    
914
        eval SRC_FILES=$SRC
915

    
916
        OLD_LINK=$LINK
917
        LINK="no"
918

    
919
        for f in $SRC_FILES; do
920
            do_file $f $DST
921
        done
922

    
923
        LINK=$OLD_LINK
924
   done
925
fi
926

    
927
# --- Set ownership or remove OpenNebula directories ---
928

    
929
if [ "$UNINSTALL" = "no" ] ; then
930
    for d in $CHOWN_DIRS; do
931
        chown -R $ONEADMIN_USER:$ONEADMIN_GROUP $DESTDIR$d
932
    done
933

    
934
    # --- Set correct permissions for Image Repository ---
935

    
936
    if [ -d "$DESTDIR$IMAGES_LOCATION" ]; then
937
        chmod 3770 $DESTDIR$IMAGES_LOCATION
938
    fi
939
else
940
    for d in `echo $DELETE_DIRS | awk '{for (i=NF;i>=1;i--) printf $i" "}'`; do
941
        rmdir $d
942
    done
943
fi