summaryrefslogtreecommitdiff
path: root/getrpm
blob: 05dd1cc6e49b0760753d8491cc9c00ec1b5e270f (plain)
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
#!/bin/sh
#
# This script supports remote-building RPMS on any host machine where you can 
# do SVN checkouts.  It is intended for use by GPSD release engineers.
#
# You will require an account that you can ssh into on the remote
# machine(s), and that account must have an initialized SVN mirror of the
# gpsd sources set up in it.
#
# The magic for an svn checkout to a remote machine, which you will have
# to do at least once before using this script. is:
#	svn checkout http://svn.berlios.de/svnroot/repos/gpsd/trunk
#
# The remote machine must have zip(1) and the buildrpms(1) script from
# ESR's shipper distribution available on your search path.
# The local machine must have unzip(1) on its search path.
#
# Use the first arg to specify the architecture you want to build for;
# this will dispatch to a suitable host machine.  Use the second arg, 
# if necessary, to override the remote directory location where building
# will be done.

arch=$1
dir=${2:-\~/svn/gpsd/trunk/}

local=/tmp/rpm$$.zip

echo "RPMs will be built in $dir on the remote machine." 1>&2
case $1 in
    i386)
	# The outer ssh tunnels through the thyrsus.com NAT/firewall
	ssh thyrsus.com "ssh minx 'cd $dir; ./putrpm i386'" >$local
	;;
    x86_64)
	# The outer ssh tunnels through the thyrsus.com NAT/firewall
	ssh thyrsus.com "ssh snark 'cd $dir; ./putrpm x86_64'" >$local
	;;
    *)
	echo "$arch is not a known architecture."
esac
echo "Zipfile delivered to ${local}."
unzip $local
rm $local