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 # 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. # All rights reserved.
# #
SRCDIR = @srcdir@ SRCDIR = @srcdir@
...@@ -29,18 +29,12 @@ endif ...@@ -29,18 +29,12 @@ endif
endif endif
endif endif
all: trafgen-fetch all-subdirs all: all-subdirs
include $(TESTBED_SRCDIR)/GNUmakerules 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 boss-install: boss-install-subdirs
client: trafgen-fetch client-subdirs client: client-subdirs
client-install: client client-install-subdirs client-install: client client-install-subdirs
control-install: control-install-subdirs control-install: control-install-subdirs
subboss: subboss:
...@@ -59,4 +53,4 @@ frisbee-mfs-install: ...@@ -59,4 +53,4 @@ frisbee-mfs-install:
@$(MAKE) -C $(dir $@) $(basename $(notdir $@)) @$(MAKE) -C $(dir $@) $(basename $(notdir $@))
%-subdirs: $(addsuffix /%.MAKE,$(SUBDIRS)) ; %-subdirs: $(addsuffix /%.MAKE,$(SUBDIRS)) ;
.PHONY: $(SUBDIRS) trafgen-fetch .PHONY: $(SUBDIRS)
# #
# EMULAB-COPYRIGHT # 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. # All rights reserved.
# #
SRCDIR = @srcdir@ SRCDIR = @srcdir@
TESTBED_SRCDIR = @top_srcdir@ TESTBED_SRCDIR = @top_srcdir@
OBJDIR = @top_builddir@ OBJDIR = @top_builddir@
SUBDIR = $(subst $(TESTBED_SRCDIR)/,,$(SRCDIR)) SUBDIR = $(subst $(TESTBED_SRCDIR)/,,$(SRCDIR))
TGSRCDIR = $(SRCDIR)/tg2.0/src/tg TGSRCDIR = tg2.0/src/tg
PROGRAMS = trafgen PROGRAMS = trafgen
TARBALL = tg2.0.tar.gz
vpath %.c $(TGSRCDIR) vpath %.c $(TGSRCDIR)
vpath %.l $(TGSRCDIR) vpath %.l $(TGSRCDIR)
vpath %.y $(TGSRCDIR) vpath %.y $(TGSRCDIR)
...@@ -31,7 +33,10 @@ OBJS = \ ...@@ -31,7 +33,10 @@ OBJS = \
include $(OBJDIR)/Makeconf 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 include $(TESTBED_SRCDIR)/GNUmakerules
...@@ -114,7 +119,7 @@ install: ...@@ -114,7 +119,7 @@ install:
boss-install: boss-install:
control-install: control-install:
client: $(PROGRAMS) client: all
client-install: client client-install: client
$(INSTALL_PROGRAM) trafgen$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/trafgen$(EXE) $(INSTALL_PROGRAM) trafgen$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/trafgen$(EXE)
...@@ -122,7 +127,4 @@ clean: ...@@ -122,7 +127,4 @@ clean:
/bin/rm -f lex.yy.c y.* *.o $(PROGRAMS) *-debug /bin/rm -f lex.yy.c y.* *.o $(PROGRAMS) *-debug
tg2.0: tg2.0:
@echo "" $(SRCDIR)/tg-install $(SRCDIR)
@echo "WARNING! You must first install the tg2.0 distribution"
@echo "WARNING! See $(SRCDIR)/README"
@echo ""
#!/bin/sh #!/bin/sh
# #
# EMULAB-COPYRIGHT # 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. # 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 if [ -x /usr/bin/fetch ]; then
fetch=/usr/bin/fetch fetch=/usr/bin/fetch
...@@ -16,31 +18,42 @@ else ...@@ -16,31 +18,42 @@ else
exit 1 exit 1
fi 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 if [ ! -d $dir/tg${version}/src ]; then
cd $1 if [ ! -f "$tarball" ]; then
if [ ! -f tg2.0.tar.gz ]; then cd $dir
echo "Downloading tg2.0 source from $host to $1 ..." echo "Downloading tg source from $host to $dir ..."
$fetch http://$host/tg2.0.tar.gz $fetch http://$host/$tarball
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Failed..." echo "Failed..."
echo "Downloading tg2.0 source from www.postel.org to $1 ..." echo "Downloading tg source from \"$srcurl\" to $dir ..."
$fetch http://www.postel.org/tg/tg2.0.tar.gz || { $fetch "$srcurl/$tarball" || {
echo "ERROR: tg-install: $fetch failed" echo "ERROR: tg-install: $fetch failed"
exit 1 exit 1
} }
fi fi
fi fi
echo "Unpacking/patching tg2.0 source ..." echo "Unpacking/patching tg${version} source ..."
tar xzof tg2.0.tar.gz || { tar xzof $tarball || {
echo "ERROR: tg-install: tar failed" echo "ERROR: tg-install: tar failed"
exit 1 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" echo "ERROR: tg-install: patch failed"
exit 1 exit 1
} }
rm -f tg2.0.tar.gz tg2.0/*/*/*.orig rm -f tg${version}/*/*/*.orig
fi fi
exit 0 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