Commit 78228cf7 authored by Mike Hibler's avatar Mike Hibler

At long last, move the download/unpack of tg2.0 into the build tree.

parent a170a65c
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# All rights reserved.
#
SRCDIR = @srcdir@
......@@ -29,18 +29,12 @@ endif
endif
endif
all: trafgen-fetch all-subdirs
all: all-subdirs
include $(TESTBED_SRCDIR)/GNUmakerules
# XXX Yeah, this doesn't belong here but I can't make the trafgen
# makefile work if it unpacks the tarball itself
#
trafgen-fetch:
$(SRCDIR)/trafgen/tg-install $(SRCDIR)/trafgen
boss-install: boss-install-subdirs
client: trafgen-fetch client-subdirs
client: client-subdirs
client-install: client client-install-subdirs
control-install: control-install-subdirs
subboss:
......@@ -59,4 +53,4 @@ frisbee-mfs-install:
@$(MAKE) -C $(dir $@) $(basename $(notdir $@))
%-subdirs: $(addsuffix /%.MAKE,$(SUBDIRS)) ;
.PHONY: $(SUBDIRS) trafgen-fetch
.PHONY: $(SUBDIRS)
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# All rights reserved.
#
SRCDIR = @srcdir@
TESTBED_SRCDIR = @top_srcdir@
OBJDIR = @top_builddir@
SUBDIR = $(subst $(TESTBED_SRCDIR)/,,$(SRCDIR))
TGSRCDIR = $(SRCDIR)/tg2.0/src/tg
TGSRCDIR = tg2.0/src/tg
PROGRAMS = trafgen
TARBALL = tg2.0.tar.gz
vpath %.c $(TGSRCDIR)
vpath %.l $(TGSRCDIR)
vpath %.y $(TGSRCDIR)
......@@ -31,7 +33,10 @@ OBJS = \
include $(OBJDIR)/Makeconf
all: tg2.0 $(PROGRAMS)
# XXX if we have to fetch the source, then we need to reinvoke make so
# that vpath works correctly
all: tg2.0
$(MAKE) $(PROGRAMS)
include $(TESTBED_SRCDIR)/GNUmakerules
......@@ -114,7 +119,7 @@ install:
boss-install:
control-install:
client: $(PROGRAMS)
client: all
client-install: client
$(INSTALL_PROGRAM) trafgen$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/trafgen$(EXE)
......@@ -122,7 +127,4 @@ clean:
/bin/rm -f lex.yy.c y.* *.o $(PROGRAMS) *-debug
tg2.0:
@echo ""
@echo "WARNING! You must first install the tg2.0 distribution"
@echo "WARNING! See $(SRCDIR)/README"
@echo ""
$(SRCDIR)/tg-install $(SRCDIR)
#!/bin/sh
#
# EMULAB-COPYRIGHT
# Copyright (c) 2004, 2009 University of Utah and the Flux Group.
# Copyright (c) 2004-2012 University of Utah and the Flux Group.
# All rights reserved.
#
# cd from <builddir>/event/trafgen to testbed/event/trafgen
version=2.0
srcurl="http://www.postel.org/tg"
tarball="tg${version}.tar.gz"
if [ -x /usr/bin/fetch ]; then
fetch=/usr/bin/fetch
......@@ -16,31 +18,42 @@ else
exit 1
fi
if [ -n "$2" ]; then host=$2; else host=www.emulab.net ; fi
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 $1/tg2.0/src ]; then
cd $1
if [ ! -f tg2.0.tar.gz ]; then
echo "Downloading tg2.0 source from $host to $1 ..."
$fetch http://$host/tg2.0.tar.gz
if [ ! -d $dir/tg${version}/src ]; then
if [ ! -f "$tarball" ]; then
cd $dir
echo "Downloading tg source from $host to $dir ..."
$fetch http://$host/$tarball
if [ $? -ne 0 ]; then
echo "Failed..."
echo "Downloading tg2.0 source from www.postel.org to $1 ..."
$fetch http://www.postel.org/tg/tg2.0.tar.gz || {
echo "Downloading tg source from \"$srcurl\" to $dir ..."
$fetch "$srcurl/$tarball" || {
echo "ERROR: tg-install: $fetch failed"
exit 1
}
fi
fi
echo "Unpacking/patching tg2.0 source ..."
tar xzof tg2.0.tar.gz || {
echo "Unpacking/patching tg${version} source ..."
tar xzof $tarball || {
echo "ERROR: tg-install: tar failed"
exit 1
}
patch -p0 < tg.patch || {
# XXX hack to deal with relative paths...argh!
case $srcdir in
/*)
;;
*)
srcdir="../$srcdir"
;;
esac
patch -p0 < $srcdir/tg.patch || {
echo "ERROR: tg-install: patch failed"
exit 1
}
rm -f tg2.0.tar.gz tg2.0/*/*/*.orig
rm -f tg${version}/*/*/*.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