-
Notifications
You must be signed in to change notification settings - Fork 1
/
create_packages.sh
executable file
·131 lines (100 loc) · 3.31 KB
/
create_packages.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
#!/bin/bash
type=$1
root=/tmp/saga
rm -rf $root/saga-{core,bindings,adaptors}*/
mkdir -p $root || exit -1
cd $root || exit -1
########################################################################
#
# create a single rpm
#
# arg 1: name of package
# arg 2: svn repos url
#
function create_rpm()
{
name=$1
url=$2
echo "svn co $name"
svn co $url $name
echo "package $name"
make -C $name rpm
ls -la $name/$name*.rpm
echo "install $name"
cp $name/$name*.{rpm,tgz} $root
sudo rpm -i $name/$name*.x86_64.rpm
}
########################################################################
#
# create a single deb
#
# arg 1: name of package
# arg 2: svn repos url
#
function create_deb()
{
name=$1
url=$2
echo svn co $name
svn co $url $name
echo package $name
make -C $name deb
ls -la $name/$name*.deb
echo install $name
sudo dpkg -i $name/$name*.deb
}
########################################################################
#
# create all rpm packages
#
function do_rpm()
{
sudo rpm -e `rpm -qa | grep saga`
sudo rpm -i $root/*.x86_64.rpm
echo "creating rpm packages"
create_rpm saga-core https://svn.cct.lsu.edu/repos/saga/core/branches/egi-release
export SAGA_LOCATION=/usr
create_rpm saga-bindings-python https://svn.cct.lsu.edu/repos/saga/bindings/python/branches/egi-release
create_rpm saga-adaptors-x509 https://svn.cct.lsu.edu/repos/saga-adaptors/x509/branches/egi-release
create_rpm saga-adaptors-globus https://svn.cct.lsu.edu/repos/saga-adaptors/globus/branches/egi-release
create_rpm saga-adaptors-ssh https://svn.cct.lsu.edu/repos/saga-adaptors/ssh/branches/egi-release
create_rpm saga-adaptors-bes https://svn.cct.lsu.edu/repos/saga-adaptors/bes/branches/egi-release
create_rpm saga-adaptors-glite https://svn.cct.lsu.edu/repos/saga-adaptors/glite/branches/egi-release
mv $root/*/*.rpm $root/
mv $root/*/*.tgz $root/
}
########################################################################
#
# create all deb packages
#
function do_deb ()
{
sudo dpkg --purge `dpkg -l | grep saga | cut -f 2,3 -d ' '`
echo "creating deb packages"
create_deb saga-core https://svn.cct.lsu.edu/repos/saga/core/branches/egi-release
export SAGA_LOCATION=/usr
create_deb saga-bindings-python https://svn.cct.lsu.edu/repos/saga/bindings/python/branches/egi-release
create_deb saga-adaptors-x509 https://svn.cct.lsu.edu/repos/saga-adaptors/x509/branches/egi-release
create_deb saga-adaptors-globus https://svn.cct.lsu.edu/repos/saga-adaptors/globus/branches/egi-release
create_deb saga-adaptors-ssh https://svn.cct.lsu.edu/repos/saga-adaptors/ssh/branches/egi-release
create_deb saga-adaptors-bes https://svn.cct.lsu.edu/repos/saga-adaptors/bes/branches/egi-release
create_deb saga-adaptors-glite https://svn.cct.lsu.edu/repos/saga-adaptors/glite/branches/egi-release
mv $root/*/*.deb $root/
mv $root/*/*.tgz $root/
}
########################################################################
#
# main routine:
#
# then we just check the requested type, and invoke the correct
# builder routine...
if test "$type" == "rpm"; then
do_rpm || exit -1
exit 0
fi
if test "$type" == "deb"; then
do_deb || exit -1
exit 0
fi
printf "\n\tUsage: $0 <rpm|deb>\n\n"
exit -1