~nchohan/+junk/mytools

« back to all changes in this revision

Viewing changes to debian/appscale_install_functions.sh

  • Committer: root
  • Date: 2010-11-03 07:43:57 UTC
  • Revision ID: root@appscale-image0-20101103074357-xea7ja3sor3x93oc
init

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# Common functions for build and installer
 
3
#
 
4
# This should work in bourne shell (/bin/sh)
 
5
# The function name should not include non alphabet charactor.
 
6
#
 
7
# Written by Yoshi <nomura@pobox.com>
 
8
 
 
9
if [ -z "$APPSCALE_HOME_RUNTIME" ]; then
 
10
    export APPSCALE_HOME_RUNTIME=/root/appscale
 
11
fi
 
12
 
 
13
# only for the jaunty
 
14
installeuca2ools()
 
15
{
 
16
# EC2
 
17
    mkdir -p ${APPSCALE_HOME}/downloads
 
18
    cd ${APPSCALE_HOME}/downloads
 
19
    wget http://appscale.cs.ucsb.edu/appscale_files/ec2-api-tools-1.3-30349.zip || exit 1
 
20
    wget http://appscale.cs.ucsb.edu/appscale_files/ec2-ami-tools-1.3-26357.zip || exit 1
 
21
 
 
22
    unzip ec2-api-tools-1.3-30349.zip || exit 1
 
23
    unzip ec2-ami-tools-1.3-26357.zip || exit 1
 
24
    rm ec2-api-tools-1.3-30349.zip
 
25
    rm ec2-ami-tools-1.3-26357.zip
 
26
 
 
27
    mv ec2-api-tools-1.3-30349 ec2-api-tools
 
28
    mv ec2-ami-tools-1.3-26357/* ec2-api-tools/ # should say directory not empty for bin and lib, that's fine
 
29
    mv ec2-ami-tools-1.3-26357/bin/* ec2-api-tools/bin/
 
30
    mv ec2-ami-tools-1.3-26357/lib/* ec2-api-tools/lib/
 
31
    mkdir -p ${DESTDIR}/usr/local
 
32
    mv ec2-api-tools ${DESTDIR}/usr/local/
 
33
    rm -r ec2-ami-tools-1.3-26357
 
34
 
 
35
# Eucalyptus
 
36
#    cd ${APPSCALE_HOME}/downloads
 
37
#    wget http://kings.cs.ucsb.edu/appscale_files/euca2ools-1.0-src-deps.tar.gz
 
38
#    tar zvxf euca2ools-1.0-src-deps.tar.gz
 
39
#    rm euca2ools-1.0-src-deps.tar.gz
 
40
#    cd euca2ools-1.0-src-deps
 
41
#    tar zxvf boto-1.8d.tar.gz
 
42
#    cd boto-1.8d
 
43
#    python setup.py bdist_egg
 
44
#    python setup.py install --prefix=${DESTDIR}/usr
 
45
#    rm -r euca2ools-1.0-src-deps
 
46
    easy_install -U boto || exit 1
 
47
 
 
48
    cd ${APPSCALE_HOME}/downloads
 
49
    wget http://kings.cs.ucsb.edu/appscale_files/euca2ools-1.0.tar.gz || exit 1
 
50
    tar zxvf euca2ools-1.0.tar.gz || exit 1
 
51
    rm euca2ools-1.0.tar.gz
 
52
    cd euca2ools-1.0
 
53
    make PREFIX=${DESTDIR}/usr/local
 
54
    if [ -n "$DESTDIR" ]; then
 
55
        # copy egg
 
56
        mkdir -p ${DESTDIR}/usr/local/lib/python2.6/dist-packages/
 
57
        cp -v euca2ools/dist/euca2ools-*.egg ${DESTDIR}/usr/local/lib/python2.6/dist-packages/ || exit 1
 
58
        cp -rv /usr/local/lib/python2.6/dist-packages/boto-*.egg ${DESTDIR}/usr/local/lib/python2.6/dist-packages/ || exit 1
 
59
    fi
 
60
    cd ${APPSCALE_HOME}/downloads
 
61
    rm -r euca2ools-1.0
 
62
 
 
63
    mkdir -p ${DESTDIR}/etc/profile.d
 
64
    cat > ${DESTDIR}/etc/profile.d/ec2.sh <<EOF
 
65
export PATH=/usr/local/ec2-api-tools/bin:\$PATH
 
66
export EC2_HOME=/usr/local/ec2-api-tools
 
67
EOF
 
68
}
 
69
 
 
70
postinstalleuca2ools()
 
71
{
 
72
#    cd ${APPSCALE_HOME}/euca2ools-1.0-src-deps/boto-1.8d
 
73
#    python setup.py install
 
74
#    cd ${APPSCALE_HOME}/euca2ools-1.0
 
75
#    make
 
76
# just enable eggs
 
77
    easy_install boto
 
78
    easy_install euca2ools
 
79
}
 
80
 
 
81
installappscaletools()
 
82
{
 
83
#    mkdir -p ${DESTDIR}/usr/local
 
84
#    cd ${DESTDIR}/usr/local
 
85
# tar ball is old right now.
 
86
#    wget http://kings.cs.ucsb.edu/appscale_files/appscale-tools-1.3.tar.gz || exit 1
 
87
#    rm appscale-tools-1.3.tar.gz
 
88
# tools is copied by debian/rule file now.
 
89
#    bzr branch lp:appscale/trunk-tools appscale-tools || exit 1
 
90
#    rm -r appscale-tools/.bzr || exit 1
 
91
 
 
92
    # add to path
 
93
    mkdir -p ${DESTDIR}/etc/profile.d
 
94
    cat > ${DESTDIR}/etc/profile.d/appscale-tools.sh <<EOF
 
95
export TOOLS_PATH=/usr/local/appscale-tools
 
96
export PATH=\${PATH}:\${TOOLS_PATH}/bin
 
97
EOF
 
98
}
 
99
 
 
100
postinstallappscaletools()
 
101
{
 
102
    :;
 
103
}
 
104
 
 
105
keygen()
 
106
{
 
107
    # create ssh private key if it is not exists.
 
108
    test -e /root/.ssh/id_rsa || ssh-keygen -q -t rsa -f /root/.ssh/id_rsa -N ""
 
109
}