Commit 62821c75 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Merge branch 'master' of git-public.flux.utah.edu:/flux/git/emulab-devel

parents 2b83a374 920d44c5
......@@ -44,11 +44,24 @@ $(INSTALL_APACHE_CONFIG)/%: %
# This could (should?) be done with configure, but apache port might
# not be installed when we configure our software.
#
# XXX ugh, do the same thing to detect php5...
#
httpd.conf.fixed: httpd.conf
-@cp httpd.conf httpd.conf.fixed
@if [ -x /usr/local/libexec/apache/mod_auth_mysql.so ]; then \
sed -i "" -e '/^LoadModule auth_mysql/s/libauth/mod_auth/' httpd.conf.fixed; \
echo "Updated httpd.conf"; \
echo "Updated httpd.conf for auth_mysql"; \
fi
@if [ -x /usr/local/libexec/apache/libphp5.so ]; then \
sed -i "" -e 's/php4/php5/g' httpd.conf.fixed; \
echo "Updated httpd.conf for php5"; \
fi
httpd.conf-ops.fixed: httpd.conf-ops
-@cp httpd.conf-ops httpd.conf-ops.fixed
@if [ true -o -x /usr/local/libexec/apache/libphp5.so ]; then \
sed -i "" -e 's/php4/php5/g' httpd.conf-ops.fixed; \
echo "Updated httpd.conf-ops for php5"; \
fi
install-dirs:
......@@ -82,8 +95,8 @@ endif
install: install-dirs install-scripts httpd.conf.fixed
$(INSTALL_DATA) httpd.conf.fixed $(INSTALL_APACHE_CONFIG)/httpd.conf
control-install: install-dirs install-scripts httpd.conf-ops
$(INSTALL_DATA) httpd.conf-ops $(INSTALL_APACHE_CONFIG)/httpd.conf
control-install: install-dirs install-scripts httpd.conf-ops.fixed
$(INSTALL_DATA) httpd.conf-ops.fixed $(INSTALL_APACHE_CONFIG)/httpd.conf
else
install-scripts install control-install:
@echo "Cannot install Apache config in dev tree"
......
......@@ -428,18 +428,7 @@ DocumentRoot "@prefix@/www"
<Directory @prefix@>
Order allow,deny
deny from all
allow from 155.99.212.
allow from 155.98.60.
allow from 69.59.212.104
allow from 18.31.0.114
allow from 18.31.0.144
allow from 24.254.69.120
# Jay's machines.
allow from 207.173.21.122
allow from 207.173.21.123
allow from 207.173.21.126
# Tim Stack
allow from 66.219.220.49
</Directory>
<Directory @prefix@/webglimpse>
......
......@@ -6145,6 +6145,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
tmcd/linux9/GNUmakefile tmcd/linux9/supfile \
tmcd/fedora/GNUmakefile tmcd/fedora/supfile \
tmcd/linux-sg/GNUmakefile tmcd/ubuntu7/GNUmakefile \
tmcd/ubuntu10/GNUmakefile \
tmcd/freebsd5/GNUmakefile tmcd/freebsd5/supfile \
tmcd/freebsd6/GNUmakefile tmcd/freebsd6/supfile tmcd/freebsd6/netif-emulab \
tmcd/freebsd7/GNUmakefile tmcd/freebsd7/supfile tmcd/freebsd7/netif-emulab \
......
......@@ -935,6 +935,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
tmcd/linux9/GNUmakefile tmcd/linux9/supfile \
tmcd/fedora/GNUmakefile tmcd/fedora/supfile \
tmcd/linux-sg/GNUmakefile tmcd/ubuntu7/GNUmakefile \
tmcd/ubuntu10/GNUmakefile \
tmcd/freebsd5/GNUmakefile tmcd/freebsd5/supfile \
tmcd/freebsd6/GNUmakefile tmcd/freebsd6/supfile tmcd/freebsd6/netif-emulab \
tmcd/freebsd7/GNUmakefile tmcd/freebsd7/supfile tmcd/freebsd7/netif-emulab \
......
......@@ -4230,6 +4230,20 @@ sub SetPortRange($$)
DBQueryWarn("unlock tables");
return ($newlow, $newhigh);
}
sub GetPortRange($)
{
my ($self) = @_;
my $idx = $self->idx();
my $query_result =
DBQueryWarn("select low,high from ipport_ranges where exptidx=$idx");
return undef
if (!defined($query_result) || !$query_result->numrows);
my ($low,$high) = $query_result->fetchrow_array();
return ($low, $high);
}
#
# Reserve all of the shared BW we need. The vinterfaces table has
......
......@@ -37,6 +37,14 @@ if [ ! -d $dir/iperf-$version/src ]; then
echo "ERROR: iperf-fetch.sh: tar failed"
exit 1
}
# XXX hack to deal with relative paths...argh!
case $srcdir in
/*)
;;
*)
srcdir="../$srcdir"
;;
esac
cd iperf-$version && patch -p0 < $srcdir/iperf-patch || {
echo "ERROR: iperf-fetch.sh: patch failed"
exit 1
......
......@@ -40,6 +40,15 @@ if [ ! -d $dir/rude-$version/src ]; then
if [ -d rude -a ! -d rude-$version ]; then
mv rude rude-$version
fi
# XXX hack to deal with relative paths...argh!
case $srcdir in
/*)
;;
*)
srcdir="../$srcdir"
;;
esac
cd rude-$version && patch -p0 < $srcdir/rude-patch || {
echo "ERROR: rude-fetch.sh: patch failed"
exit 1
......
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2008 University of Utah and the Flux Group.
* Copyright (c) 2000-2010 University of Utah and the Flux Group.
* All rights reserved.
*/
......@@ -1767,7 +1767,7 @@ parse_configfile(char *filename)
while (fgets(buf, sizeof(buf), fp)) {
int cc = strlen(buf);
if (buf[cc-1] == '\n')
buf[cc-1] = (char) NULL;
buf[cc-1] = '\0';
if (!strncmp(buf, "UID=", 4)) {
if (user) {
......@@ -1896,7 +1896,7 @@ parse_configfile_env(char *filename)
FILE *file;
if (buf[cc-1] == '\n')
buf[cc-1] = (char) NULL;
buf[cc-1] = '\0';
if (isops)
bp = buf;
......
......@@ -42,16 +42,16 @@ PFLAGS = -pthread
PFLAGS += -DDEBUG
PFLAGS += -O2 -g -Wall
PFLAGS += -I. -I${OBJDIR} -I$(SRCDIR)/../lib -I$(TESTBED_SRCDIR)/lib/libtb
PFLAGS += -L/usr/local/lib -lpubsub_r -lm
PFLAGS += -L/usr/local/lib -lpubsub_r -ltb -lm
PLDFLAGS += -L$(OBJDIR)/lib -L$(OBJDIR)/lib/libtb -L../lib
PLIBS = -levent_r -ltb -lcrypto
PLIBS += -L/usr/local/lib -lpubsub_r -lm
PLIBS += -L/usr/local/lib -lpubsub_r -ltb -lm
PLDFLAGS += $(LDSTATIC)
LDFLAGS += -L$(OBJDIR)/lib -L$(OBJDIR)/lib/libtb -L../lib
LIBS = -levent -ltb -lcrypto
LIBS += -L/usr/local/lib -lpubsub -lm
LIBS += -L/usr/local/lib -lpubsub -ltb -lm
LDFLAGS += $(LDSTATIC)
# Deal with the presence/absence of kerberos in the linux ssl library
......@@ -89,7 +89,7 @@ evproxyplab-debug: evproxyplab.o ../lib/libevent.a ../lib/event.h
version0_gateway: version0_gateway.c
$(CC) $(CFLAGS) $(PLDFLAGS) -pthread -o $@ $< -L/usr/local/lib \
-lpubsub_r -lm
-lpubsub_r -ltb -lm
eventping-debug: eventping.o
$(CC) $(LDFLAGS) -o $@ eventping.o -pthread $(LIBS)
......
......@@ -207,6 +207,7 @@ main(int argc, char **argv)
static char notify_debug_string[2*BUFSIZ];
#if 0
static int
pubsub_notify_traverse_debug(void *arg, char *name,
pubsub_type_t type, pubsub_value_t value,
......@@ -258,6 +259,7 @@ pubsub_notify_traverse_debug(void *arg, char *name,
return 1;
}
#endif
static void
pubsub_callback(pubsub_handle_t *handle,
......
/*
* 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.
*/
......@@ -209,7 +209,7 @@ main(int argc, char **argv)
if ((bp = strchr(temp, '/')) == NULL)
fatal("Malformed pid/eid: %s", myeid);
*bp++ = (char) NULL;
*bp++ = '\0';
sprintf(keyfilebuf, "/proj/%s/exp/%s/tbdata/eventkey",
temp, bp);
......@@ -292,7 +292,7 @@ main(int argc, char **argv)
* XXX For now, uppercase the strings, and remove trailing _.
*/
if (argc) {
buf[0] = (char) NULL;
buf[0] = '\0';
while (argc) {
if (strlen(*argv) + strlen(buf) >= sizeof(buf)-2)
fatal("Too many event argument strings!");
......@@ -309,8 +309,8 @@ main(int argc, char **argv)
bp++;
}
if (*(bp-1) == '_')
*(bp-1) = (char) NULL;
*bp++ = (char) NULL;
*(bp-1) = '\0';
*bp++ = '\0';
sprintf(&buf[strlen(buf)], "%s=%s ", *argv, bp);
}
......
......@@ -46,7 +46,6 @@ my $FRISADDR = '@FRISEBEEMCASTADDR@';
#
# Fixed paths for clients
#
my $PROJROOT = "@PROJROOT_DIR@";
my $GROUPROOT = "@GROUPSROOT_DIR@";
my $USERROOT = "@USERSROOT_DIR@";
my $SCRATCHROOT = "@SCRATCHROOT_DIR@";
......@@ -94,7 +93,6 @@ my $SYSLOG_CONF = "/etc/syslog.conf";
my $NEWSYSLOG_CONF = "/etc/newsyslog.conf";
my $INETD_CONF = "/etc/inetd.conf";
my $PROTOUSER = "elabman";
my $PROTOUSER_KEY = "$TOP_SRCDIR/install/elabman_dsa.pub";
my $ROOT_PRIVKEY = "/root/.ssh/id_rsa";
my $ROOT_PUBKEY = "$ROOT_PRIVKEY.pub";
......@@ -111,7 +109,6 @@ my $DHCPD_TEMPLATE = "/usr/local/etc/dhcpd.conf.template";
my $DHCPD_LEASES = "/var/db/dhcpd.leases";
my $DHCPD_MAKECONF = "$PREFIX/sbin/dhcpd_makeconf";
my $BATCHEXP = "$PREFIX/bin/batchexp";
my $WAP = "$PREFIX/sbin/withadminprivs";
my $NAMED_SETUP = "$PREFIX/sbin/named_setup";
my $ADDPUBKEY = "$PREFIX/sbin/addpubkey";
my $TBACCT = "$PREFIX/sbin/tbacct";
......@@ -153,10 +150,6 @@ my $TFTPD_PKG = "emulab-tftp-hpa-0.48";
# XXX temporary for perl DBD mysql access
my $P5DBD_PKG = "p5-DBD-mysql50-3.0002";
# XXX temporary until fix dependencies in emulab-boss package
my $PYM2_PKG = "py25-m2crypto-0.19.1";
# XXX temporary until someone extracts their head from the dark regions
my $EASYINSTALL = "/usr/local/bin/easy_install";
#
# Named pid file.
......@@ -255,7 +248,12 @@ else {
#
my $BOSS_PORT = "emulab-boss-1.8";
if ($FBSD_MAJOR > 4) {
if ($FBSD_MAJOR > 6) {
if ($FBSD_MAJOR > 7) {
# XXX someday...
$BOSS_PORT = "emulab-boss-4.0";
} elsif ($FBSD_MAJOR == 7 && $FBSD_MINOR > 2) {
$BOSS_PORT = "emulab-boss-3.1";
} elsif ($FBSD_MAJOR == 7) {
$BOSS_PORT = "emulab-boss-3.0";
} elsif ($FBSD_MAJOR == 6 && $FBSD_MINOR > 2) {
$BOSS_PORT = "emulab-boss-2.1";
......@@ -263,7 +261,26 @@ if ($FBSD_MAJOR > 4) {
$BOSS_PORT = "emulab-boss-2.0";
}
}
my $PHP4_PORT = "php4-extensions-1.0";
# PHP5 is the only alternative at the moment and only for newer OSes
my $PHP_VERSION = 4;
my $PHP_PORT = "php4-extensions-1.0";
if ($FBSD_MAJOR > 7 || ($FBSD_MAJOR == 7 && $FBSD_MINOR > 2)) {
$PHP_VERSION = 5;
$PHP_PORT = "php5-extensions-1.3";
}
#
# Version dependent python-fu
#
my $PYM2_PKG = "py25-m2crypto-0.19.1";
my $PY_VER = "python2.5";
if ($FBSD_MAJOR > 7 || ($FBSD_MAJOR == 7 && $FBSD_MINOR > 2)) {
$PYM2_PKG = "py26-m2crypto-0.20";
$PY_VER = "python2.6";
}
# XXX temporary until someone extracts their head from the dark regions
my $EASYINSTALL = "/usr/local/bin/easy_install";
#
# XXX keep 4.x ElabInElab install limping along...
......@@ -447,15 +464,19 @@ Phase "ports", "Installing ports", sub {
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $BOSS_PORT");
};
if ($FBSD_MAJOR > 4) {
Phase "php4", "Installing php4 package", sub {
if (!ExecQuiet("$PKG_INFO -e $PHP4_PORT")) {
PhaseSkip("Port already installed");
Phase "php", "Installing php${PHP_VERSION} package", sub {
if (!ExecQuiet("$PKG_INFO -e $PHP_PORT")) {
PhaseSkip("Package already installed");
}
if (!$packagedir) {
PhaseSkip("No package directory provided");
}
# XXX ugh, make sure an older version is not installed
if ($PHP_VERSION > 4) {
ExecQuiet("$PKG_DEL -f -x php4-");
}
ExecQuietFatal("$ENV PKG_PATH=$packagedir ".
" $PKG_ADD $PHP4_PORT");
" $PKG_ADD $PHP_PORT");
};
# XXX temporary: only needed til emulab-boss package updated
Phase "tftpd", "Updating tftpd installation", sub {
......@@ -497,10 +518,10 @@ Phase "ports", "Installing ports", sub {
};
if ($FBSD_MAJOR > 6) {
Phase "py-m2crypto", "Installing python m2crypto package", sub {
my $pname = `$PKG_INFO -E 'py25-m2crypto-*' 2>/dev/null`;
my $pname = `$PKG_INFO -E 'py*-m2crypto-*' 2>/dev/null`;
chomp($pname);
if ($pname eq $PYM2_PKG) {
PhaseSkip("py25-m2crypto already up to date");
PhaseSkip("py-m2crypto already up to date");
}
if (!$packagedir) {
PhaseSkip("No package directory provided");
......@@ -557,7 +578,7 @@ Phase "ports", "Installing ports", sub {
PhaseFail("Please install ports manually, since some\n of them are " .
"interactive. Run: \n" .
" cd $PORTSMISCDIR/emulab-boss && make install\n" .
" cd $PORTSMISCDIR/emulab-php4 && make install\n" .
" cd $PORTSMISCDIR/emulab-php${PHP_VERSION} && make install\n" .
($PGENISUPPORT ?
" cd $PORTSMISCDIR/emulab-protogeni && make install\n" : "") .
"then re-run this script.");
......@@ -625,17 +646,17 @@ Phase "portfixup", "Fixing up packages", sub {
# package that I know will fail otherwise.
#
Phase "m2crypto-egg", "Unpacking python m2crypto .egg", sub {
my $pydir = "/usr/local/lib/python2.5/site-packages";
my $egg = `ls -d $pydir/M2Crypto-0.19.1-py2.5-*.egg 2>/dev/null | tail -1`;
my $pydir = "/usr/local/lib/$PY_VER/site-packages";
my $egg = `ls -d $pydir/M2Crypto-*-py*-*.egg 2>/dev/null | tail -1`;
chomp($egg);
if (! -x $EASYINSTALL) {
PhaseSkip("python easy_install missing");
}
if ($egg eq "") {
PhaseSkip("py25-m2crypto egg not found");
PhaseSkip("egg not found");
}
if (-d "$egg") {
PhaseSkip("py25-m2crypto egg already unpacked");
PhaseSkip("egg already unpacked");
}
# XXX swig must be installed for easyinstall to exit correctly
Phase "swig", "Installing swig", sub {
......@@ -645,7 +666,7 @@ Phase "portfixup", "Fixing up packages", sub {
};
ExecQuietFatal("mv $egg /var/tmp/");
$egg =~ s/$pydir//;
ExecQuietFatal("$EASYINSTALL -Z /var/tmp$egg");
ExecQuietFatal("$EASYINSTALL -N -H None -Z /var/tmp$egg");
ExecQuietFatal("mv /var/tmp$egg $pydir/$egg.bak");
};
}
......@@ -897,8 +918,11 @@ Phase "database", "Setting up database", sub {
ExecQuietFatal("$RCDIR/1.mysql-client.sh start");
ExecQuietFatal("$RCDIR/2.mysql-server.sh start");
# Give mysqld some time to start, then make sure it did
sleep 5;
ExecQuietFatal("$MYSQLADMIN ping");
sleep 2;
if (ExecQuiet("$MYSQLADMIN ping")) {
sleep 5;
ExecQuietFatal("$MYSQLADMIN ping");
}
};
Phase "$DBNAME", "Creating $DBNAME", sub {
if (!ExecQuiet("$MYSQLSHOW $DBNAME")) {
......
......@@ -35,7 +35,6 @@ my $SCRATCHDIR = '@FSDIR_SCRATCH@';
#
# Fixed paths for clients
#
my $PROJROOT = "@PROJROOT_DIR@";
my $GROUPROOT = "@GROUPSROOT_DIR@";
my $USERROOT = "@USERSROOT_DIR@";
my $SCRATCHROOT = "@SCRATCHROOT_DIR@";
......@@ -83,7 +82,12 @@ else {
#
my $FS_PORT = "emulab-fs-1.4";
if ($FBSD_MAJOR > 4) {
if ($FBSD_MAJOR > 6) {
if ($FBSD_MAJOR > 7) {
# XXX someday...
$FS_PORT = "emulab-fs-4.0";
} elsif ($FBSD_MAJOR == 7 && $FBSD_MINOR > 2) {
$FS_PORT = "emulab-fs-3.1";
} elsif ($FBSD_MAJOR == 7) {
$FS_PORT = "emulab-fs-3.0";
} elsif ($FBSD_MAJOR == 6 && $FBSD_MINOR > 2) {
$FS_PORT = "emulab-fs-2.1";
......
......@@ -13,12 +13,14 @@ use Exporter;
use vars qw(@EXPORT $TOP_OBJDIR $TOP_SRCDIR
$TBROOT $LOGDIR $MAINSITE $PGENISUPPORT $GMAKE $PKG_INFO
$PORTSDIR $VARRUN $RCDIR $MYSQL $DBNAME
$PROJROOT $PROTOUSER $WAP
$SQL_UPDATE_MAJOR_REVISION $INSTALL_UPDATE_MAJOR_REVISION
$HAVE_XERCES);
@EXPORT = qw($TOP_OBJDIR $TOP_SRCDIR
$TBROOT $LOGDIR $MAINSITE $PGENISUPPORT $GMAKE $PKG_INFO
$PORTSDIR $VARRUN $RCDIR $MYSQL $DBNAME
$PROJROOT $PROTOUSER $WAP
$SQL_UPDATE_MAJOR_REVISION $INSTALL_UPDATE_MAJOR_REVISION
$HAVE_XERCES);
......@@ -31,9 +33,12 @@ $MAINSITE = @TBMAINSITE@;
$PGENISUPPORT = @PROTOGENI_SUPPORT@;
$GMAKE = "/usr/local/bin/gmake";
$PKG_INFO = "/usr/sbin/pkg_info";
$WAP = "$TBROOT/sbin/withadminprivs";
$PORTSDIR = "/usr/ports";
$VARRUN = "/var/run";
$RCDIR = "/usr/local/etc/rc.d";
$PROJROOT = "@PROJROOT_DIR@";
$PROTOUSER = "elabman";
$DBNAME = "@TBDBNAME@";
$MYSQL = "/usr/local/bin/mysql";
......@@ -83,6 +88,10 @@ $TOP_OBJDIR = `/usr/bin/dirname $0`;
chomp $TOP_OBJDIR;
$TOP_OBJDIR = "$TOP_OBJDIR/..";
# Real path to the source dir.
$TOP_SRCDIR = `realpath $TOP_SRCDIR`;
chomp $TOP_SRCDIR;
#
# Let's pretend perl's exception mechanism has a sane name for the function
# that raises an exception
......@@ -605,7 +614,8 @@ sub ExecQuiet(@) {
#
sub ExecQuietFatal(@) {
if (ExecQuiet(@_)) {
PhaseFail("Unable to execute: ");
my $msg = join(' ', @_);
PhaseFail("Unable to execute: '$msg'");
}
}
......
......@@ -52,7 +52,6 @@ if ($OUTER_BOSS eq '')
#
# Fixed paths for clients
#
my $PROJROOT = "@PROJROOT_DIR@";
my $GROUPROOT = "@GROUPSROOT_DIR@";
my $USERROOT = "@USERSROOT_DIR@";
my $SCRATCHROOT = "@SCRATCHROOT_DIR@";
......@@ -69,13 +68,8 @@ my $CONTROL_NETMASK = "@CONTROL_NETMASK@";
# Should be configure variable
my $TBADMINGID = 101;
#
# XXX temporary for perl DBD mysql access
my $P5DBD_PKG = "p5-DBD-mysql50-3.0002";
# XXX temporary until fix dependencies in emulab-ops package
my $PYM2_PKG = "py25-m2crypto-0.19.1";
# XXX temporary until someone extracts their head from the dark regions
my $EASYINSTALL = "/usr/local/bin/easy_install";
#
# Allow this to work if the library is left in the source directory
......@@ -114,7 +108,14 @@ else {
my $OPS_PORT = "emulab-ops-1.4";
my $FS_PORT = "emulab-fs-1.4";
if ($FBSD_MAJOR > 4) {
if ($FBSD_MAJOR > 6) {
if ($FBSD_MAJOR > 7) {
# XXX someday...
$OPS_PORT = "emulab-ops-4.0";
$FS_PORT = "emulab-fs-4.0";
} elsif ($FBSD_MAJOR == 7 && $FBSD_MINOR > 2) {
$OPS_PORT = "emulab-ops-3.1";
$FS_PORT = "emulab-fs-3.1";
} elsif ($FBSD_MAJOR == 7) {
$OPS_PORT = "emulab-ops-3.0";
$FS_PORT = "emulab-fs-3.0";
} elsif ($FBSD_MAJOR == 6 && $FBSD_MINOR > 2) {
......@@ -125,7 +126,26 @@ if ($FBSD_MAJOR > 4) {
$FS_PORT = "emulab-fs-2.0";
}
}
my $PHP4_PORT = "php4-extensions-1.0";
# PHP5 is the only alternative at the moment and only for newer OSes
my $PHP_VERSION = 4;
my $PHP_PORT = "php4-extensions-1.0";
if ($FBSD_MAJOR > 7 || ($FBSD_MAJOR == 7 && $FBSD_MINOR > 2)) {
$PHP_VERSION = 5;
$PHP_PORT = "php5-extensions-1.3";
}
#
# Version dependent python-fu
#
my $PYM2_PKG = "py25-m2crypto-0.19.1";
my $PY_VER = "python2.5";
if ($FBSD_MAJOR > 7 || ($FBSD_MAJOR == 7 && $FBSD_MINOR > 2)) {
$PYM2_PKG = "py26-m2crypto-0.20";
$PY_VER = "python2.6";
}
# XXX temporary until someone extracts their head from the dark regions
my $EASYINSTALL = "/usr/local/bin/easy_install";
my $packagedir = "";
my $batchmode = 0;
......@@ -356,15 +376,19 @@ Phase "ports", "Installing ports", sub {
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $OPS_PORT");
};
if ($FBSD_MAJOR > 4) {
Phase "php4", "Installing php4 package", sub {
if (!ExecQuiet("$PKG_INFO -e $PHP4_PORT")) {
Phase "php", "Installing php${PHP_VERSION} package", sub {
if (!ExecQuiet("$PKG_INFO -e $PHP_PORT")) {
PhaseSkip("Package already installed");
}
if (!$packagedir) {
PhaseSkip("No package directory provided");
}
# XXX ugh, make sure an older version is not installed
if ($PHP_VERSION > 4) {
ExecQuiet("$PKG_DEL -f -x php4-");
}
ExecQuietFatal("$ENV PKG_PATH=$packagedir ".
" $PKG_ADD $PHP4_PORT");
" $PKG_ADD $PHP_PORT");
};
}
# XXX Also temporary
......@@ -391,13 +415,13 @@ Phase "ports", "Installing ports", sub {
if ($pname);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $P5DBD_PKG");
};
# XXX cannot seem to get these dependencies into emulab-boss
# XXX cannot seem to get these dependencies into emulab-ops
if ($FBSD_MAJOR > 6) {
Phase "py-m2crypto", "Installing python m2crypto package", sub {
my $pname = `$PKG_INFO -E 'py25-m2crypto-*' 2>/dev/null`;
my $pname = `$PKG_INFO -E 'py*-m2crypto-*' 2>/dev/null`;
chomp($pname);
if ($pname eq $PYM2_PKG) {
PhaseSkip("py25-m2crypto already up to date");
PhaseSkip("py-m2crypto already up to date");
}
if (!$packagedir) {
PhaseSkip("No package directory provided");
......@@ -495,12 +519,16 @@ Phase "ports", "Installing ports", sub {
PhaseFail "Unable to change to $PORTSMISCDIR/emulab-fs: $!";
ExecQuietFatal("make -DBATCH install");
};
Phase "php4-pinstall", "Installing PHP4 ports (may take a while)", sub {
if (!ExecQuiet("$PKG_INFO -e $PHP4_PORT")) {
Phase "php-pinstall", "Installing PHP${PHP_VERSION} ports (may take a while)", sub {
if (!ExecQuiet("$PKG_INFO -e $PHP_PORT")) {
PhaseSkip("Ports already installed");
}
chdir "$PORTSMISCDIR/emulab-php4" or
PhaseFail "Unable to change to $PORTSMISCDIR/emulab-php4: $!";
# XXX ugh, make sure an older version is not installed
if ($PHP_VERSION > 4) {
ExecQuiet("$PKG_DEL -f -x php4-");
}
chdir "$PORTSMISCDIR/emulab-php${PHP_VERSION}" or
PhaseFail "Unable to change to $PORTSMISCDIR/emulab-php${PHP_VERSION}: $!";
ExecQuietFatal("make -DBATCH install");
};
if ($MAILMANSUPPORT) {
......@@ -566,17 +594,17 @@ Phase "portfixup", "Fixing up packages", sub {
# package that I know will fail otherwise.
#
Phase "m2crypto-egg", "Unpacking python m2crypto .egg", sub {
my $pydir = "/usr/local/lib/python2.5/site-packages";
my $egg = `ls -d $pydir/M2Crypto-0.19.1-py2.5-*.egg 2>/dev/null | tail -1`;
my $pydir = "/usr/local/lib/$PY_VER/site-packages";
my $egg = `ls -d $pydir/M2Crypto-*-py*-*.egg 2>/dev/null | tail -1`;
chomp($egg);
if (! -x $EASYINSTALL) {
PhaseSkip("python easy_install missing");
}
if ($egg eq "") {
PhaseSkip("py25-m2crypto egg not found");
PhaseSkip("egg not found");
}
if (-d "$egg") {
PhaseSkip("py25-m2crypto egg already unpacked");
PhaseSkip("egg already unpacked");
}
# XXX swig must be installed for easyinstall to exit correctly
Phase "swig", "Installing swig", sub {
......@@ -586,7 +614,7 @@ Phase "portfixup", "Fixing up packages", sub {
};
ExecQuietFatal("mv $egg /var/tmp/");
$egg =~ s/$pydir//;
ExecQuietFatal("$EASYINSTALL -Z /var/tmp$egg");
ExecQuietFatal("$EASYINSTALL -N -H None -Z /var/tmp$egg");
ExecQuietFatal("mv /var/tmp$egg $pydir/$egg.bak");
};
}
......@@ -1159,8 +1187,11 @@ Phase "database", "Setting up database", sub {
ExecQuietFatal("$RCDIR/1.mysql-server.sh start");