]> git.saurik.com Git - wxWidgets.git/blame - wxPython/distrib/all/build-rpm
reduce the number of objects for a quicker startup time
[wxWidgets.git] / wxPython / distrib / all / build-rpm
CommitLineData
e4bb5998
RD
1#!/bin/bash
2#----------------------------------------------------------------------
3
4set -o errexit
5
e4bb5998 6
d3c518f9
KO
7coHost=$1
8host=$2
9reltag=$3
f5ed42f8 10pyver=$4
e4bb5998 11
f5ed42f8
RD
12if [ $buildansi = yes ]; then
13 CHARTYPE=both
14else
15 CHARTYPE=unicode
dc5bee0a
RD
16fi
17
e4bb5998
RD
18
19function TestOnline {
20 local host=$1
21 local message=$2
22
23 if ping -q -c1 -w1 $host > /dev/null; then
24 return 0
25 else
26 return 1
27 fi
28}
29
30
31if [ $skiplinux != yes ]; then
32
33 startedCoHost=no
34 hostAvailable=no
35
36 # test if the target machine is online
37 if TestOnline $host; then
38 hostAvailable=yes
39 else
40 # Attempt to start the host via it's coLinux host, if there is one
2bf6b425 41 if [ $coHost != none -a $startcohost == yes ]; then
e4bb5998
RD
42 if TestOnline $coHost; then
43 echo "Attempting to start $host via coLinux on $coHost..."
44 ssh $coHost "/c/coLinux/VMs/$host.bat -d > /dev/null 2>&1 &"
45
46 # Give it time to boot and be ready for conenctions,
47 # and then test with ssh, limiting retries.
2bf6b425 48 for x in `seq 36`; do
e4bb5998
RD
49 sleep 5
50 echo "checking..."
51 if ssh root@$host "true" >/dev/null 2>&1; then
52 # success! the host is ready so we can break out of the loop
53 break;
54 fi
55 done
56
57 # test if the host is ready
58 if TestOnline $host; then
59 echo "coLinux start of $host on $coHost successful."
60 startedCoHost=yes
61 hostAvailable=yes
62 fi
63 else
64 echo "The $coHost machine is offline, unable to start coLinux for $host"
65 fi
66 fi
67 fi
68
69 if [ $hostAvailable = yes ]; then
70 echo "The $host machine is online, build continuing..."
71 else
72 echo "The $host machine is **OFFLINE**, skipping the binary RPM build."
73 exit 0
74 fi
75
76
77 echo "Copying source files and build script..."
78 ssh root@$host "mkdir -p $LINUX_BUILD && rm -rf $LINUX_BUILD/*"
79 scp $STAGING_DIR/wxPython-src* $STAGING_DIR/wxPython.spec\
80 distrib/all/do-build-rpm \
81 root@$host:$LINUX_BUILD
82
83 echo "Running build script on $host..."
84 cmd=./do-build-rpm
f5ed42f8 85 ssh root@$host "cd $LINUX_BUILD && $cmd $reltag $skipclean $VERSION $pyver $CHARTYPE"
e4bb5998
RD
86
87 echo "Fetching the results..."
88 scp "root@$host:$LINUX_BUILD/wxPython*.i[0-9]86.rpm" $STAGING_DIR
89 ssh root@$host "rm $LINUX_BUILD/wxPython*.i[0-9]86.rpm"
90
91
92 if [ $startedCoHost = yes ]; then
93 echo "Halting $host on $coHost..."
94 ssh root@$host "/sbin/halt"
95 sleep 10
96 fi
a432a02b
RD
97 sleep 30
98
99 echo "Done!"
e4bb5998 100fi
74d05225 101