Commit ba075a37 authored by Mike Hibler's avatar Mike Hibler
Browse files

Download/unpack/patch rude source in obj tree instead of source.

parent 9acb47e3
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -11,6 +11,7 @@ SUBDIR = event/linktest/rude
# be sure to change version in rude-fetch.sh too
VERSION = 0.70
TARBALL = rude-0.70.tar.gz
include $(OBJDIR)/Makeconf
......@@ -54,14 +55,17 @@ client-install: $(ITARGETS)
# Note: GNU make wants to pass options in MAKEFLAGS (w) that are incompatible
# with BSD make. So we just force configure to assume/use gmake for BSD.
config.status:
MAKE=$(MAKE) $(SRCDIR)/rude-$(VERSION)/configure $(CONFIG_ARGS)
MAKE=$(MAKE) rude-$(VERSION)/configure $(CONFIG_ARGS)
rude-$(VERSION):
$(SRCDIR)/rude-fetch.sh $(SRCDIR)
$(SRCDIR)/rude-fetch.sh $(SRCDIR) $(TARBALL)
clean:
@if [ -r Makefile ]; then $(MAKE) -f Makefile clean; fi
reallyclean:
rm -rf rude-$(VERSION) $(TARBALL)
Makefile: config.status
force: ;
#!/bin/sh
version=0.70
srcurl="http://sourceforge.net/projects/rude/files/rude/rude-$version"
tarball="rude-$version.tar.gz"
if [ -x /usr/bin/fetch ]; then
fetch=/usr/bin/fetch
......@@ -11,28 +13,37 @@ else
exit 1
fi
if [ ! -d rude-$version/src ]; then
cd $1
if [ ! -f rude-$version.tar.gz ]; then
echo "Downloading rude source from www.emulab.net to $1 ..."
$fetch http://www.emulab.net/downloads/rude-$version.tar.gz
if [ -n "$1" ]; then srcdir=$1; else srcdir=$PWD ; fi
if [ -n "$2" ]; then tarball=$2; fi
if [ -n "$3" ]; then host=$3; else host=www.emulab.net ; fi
dir=$PWD
if [ ! -d $dir/rude-$version/src ]; then
if [ ! -f "$tarball" ]; then
cd $dir
echo "Downloading rude source from $host to $dir ..."
$fetch http://$host/$tarball
if [ $? -ne 0 ]; then
echo "Failed..."
exit 1
echo "Downloading rude source from $srcurl to $dir ..."
$fetch $srcurl/$tarball || {
echo "ERROR: rude-fetch: $fetch failed"
exit 1
}
fi
fi
echo "Unpacking/patching $rude-version source ..."
tar xzof rude-$version.tar.gz || {
tar xzof $tarball || {
echo "ERROR: rude-fetch.sh: tar failed"
exit 1
}
if [ -d rude -a ! -d rude-$version ]; then
mv rude rude-$version
fi
cd rude-$version && patch -p0 < ../rude-patch || {
cd rude-$version && patch -p0 < $srcdir/rude-patch || {
echo "ERROR: rude-fetch.sh: patch failed"
exit 1
}
rm -f ../rude-$version.tar.gz */*.orig
rm -f */*.orig
fi
exit 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment