Commit 1f83c9c6 authored by Mike Hibler's avatar Mike Hibler

First cut at FreeBSD 9.0 support.

Upgrade to perl 5.12 means no more "suidperl" (setuid perl scripts).
So we now have yet another little wrapper (security/runsuid.c) which
runs suid and whose sole function is to exec the perl script of the
same name in the /usr/testbed/suidbin directory. So a formerly setuid
perl script install now goes like:
  create /usr/testbed/sbin/mkproj as a symlink to /usr/testbed/libexec/runsuid
  install real mkproj perl script in /usr/testbed/suidbin/mkproj
When the setuid-wrapper is invoked under the name "mkproj" it execs
/usr/testbed/suidbin/mkproj. We could almost use sudo for this purpose
instead (see security/sudoers.in) but sudo loses one of the groups in
the group list.

/usr/include/utmp.h is gone in FreeBSD 9.0. In most places we nevered
needed it, but in the one case that did (tg source), it just used a
couple of the constants exposed (UT_*) and not the struct, so I just
hardwired values for the constants.

The usual tweakage to the install stuff to reflect yet another set of
packages!
parent 896cd407
...@@ -156,6 +156,7 @@ install-mkdirs: ...@@ -156,6 +156,7 @@ install-mkdirs:
-mkdir -p $(INSTALL_TOPDIR)/log/mysql -mkdir -p $(INSTALL_TOPDIR)/log/mysql
-mkdir -p $(INSTALL_TOPDIR)/etc -mkdir -p $(INSTALL_TOPDIR)/etc
-mkdir -p $(INSTALL_TOPDIR)/www -mkdir -p $(INSTALL_TOPDIR)/www
-mkdir -p $(INSTALL_TOPDIR)/suidbin
-mkdir -p $(INSTALL_TOPDIR)/ssl -mkdir -p $(INSTALL_TOPDIR)/ssl
-chmod 770 $(INSTALL_TOPDIR)/ssl -chmod 770 $(INSTALL_TOPDIR)/ssl
ifeq ($(STANDALONE_CLEARINGHOUSE),0) ifeq ($(STANDALONE_CLEARINGHOUSE),0)
......
# #
# 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.
# Get rid of a bunch of nasty built-in implicit rules, # Get rid of a bunch of nasty built-in implicit rules,
...@@ -36,21 +36,43 @@ $(INSTALL_ETCDIR)/%: % ...@@ -36,21 +36,43 @@ $(INSTALL_ETCDIR)/%: %
-mkdir -p $(INSTALL_ETCDIR) -mkdir -p $(INSTALL_ETCDIR)
$(INSTALL_DATA) $< $@ $(INSTALL_DATA) $< $@
$(addprefix $(INSTALL_SBINDIR)/, $(SETUID_SBIN_SCRIPTS)): $(INSTALL_SBINDIR)/%: % $(addprefix $(INSTALL_SBINDIR)/, $(SETUID_SBIN_PROGS)): $(INSTALL_SBINDIR)/%: %
echo "Installing (setuid) $<" echo "Installing (setuid) $<"
-mkdir -p $(INSTALL_SBINDIR) -mkdir -p $(INSTALL_SBINDIR)
$(SUDO) $(INSTALL) -o root -m 4755 $< $@ $(SUDO) $(INSTALL) -o root -m 4755 $< $@
$(addprefix $(INSTALL_BINDIR)/, $(SETUID_BIN_SCRIPTS)): $(INSTALL_BINDIR)/%: % $(addprefix $(INSTALL_BINDIR)/, $(SETUID_BIN_PROGS)): $(INSTALL_BINDIR)/%: %
echo "Installing (setuid) $<" echo "Installing (setuid) $<"
-mkdir -p $(INSTALL_BINDIR) -mkdir -p $(INSTALL_BINDIR)
$(SUDO) $(INSTALL) -o root -m 4755 $< $@ $(SUDO) $(INSTALL) -o root -m 4755 $< $@
$(addprefix $(INSTALL_LIBEXECDIR)/, $(SETUID_LIBX_SCRIPTS)): $(INSTALL_LIBEXECDIR)/%: % $(addprefix $(INSTALL_LIBEXECDIR)/, $(SETUID_LIBX_PROGS)): $(INSTALL_LIBEXECDIR)/%: %
echo "Installing (setuid) $<" echo "Installing (setuid) $<"
-mkdir -p $(INSTALL_LIBEXECDIR) -mkdir -p $(INSTALL_LIBEXECDIR)
$(SUDO) $(INSTALL) -o root -m 4755 $< $@ $(SUDO) $(INSTALL) -o root -m 4755 $< $@
$(addprefix $(INSTALL_SBINDIR)/, $(SETUID_SBIN_SCRIPTS)): $(INSTALL_SBINDIR)/%: % $(INSTALL_SUIDDIR)/%
echo "Installing (link to wrapper) $<"
-mkdir -p $(INSTALL_SBINDIR)
-rm -f $@
ln -s $(INSTALL_LIBEXECDIR)/runsuid $@
$(addprefix $(INSTALL_BINDIR)/, $(SETUID_BIN_SCRIPTS)): $(INSTALL_BINDIR)/%: % $(INSTALL_SUIDDIR)/%
echo "Installing (link to wrapper) $<"
-mkdir -p $(INSTALL_BINDIR)
-rm -f $@
ln -s $(INSTALL_LIBEXECDIR)/runsuid $@
$(addprefix $(INSTALL_LIBEXECDIR)/, $(SETUID_LIBX_SCRIPTS)): $(INSTALL_LIBEXECDIR)/%: % $(INSTALL_SUIDDIR)/%
echo "Installing (link to wrapper) $<"
-mkdir -p $(INSTALL_LIBEXECDIR)
-rm -f $@
ln -s $(INSTALL_LIBEXECDIR)/runsuid $@
$(INSTALL_SUIDDIR)/%: %
echo "Installing (real script) $<"
-mkdir -p $(INSTALL_SUIDDIR)
$(INSTALL_PROGRAM) $< $@
CFLAGS += $(LOCALCFLAGS) CFLAGS += $(LOCALCFLAGS)
......
...@@ -62,6 +62,7 @@ INSTALL_LIBEXECDIR = @libexecdir@ ...@@ -62,6 +62,7 @@ INSTALL_LIBEXECDIR = @libexecdir@
INSTALL_ETCDIR = @sysconfdir@ INSTALL_ETCDIR = @sysconfdir@
INSTALL_INCDIR = @includedir@ INSTALL_INCDIR = @includedir@
INSTALL_WWWDIR = @exec_prefix@/www INSTALL_WWWDIR = @exec_prefix@/www
INSTALL_SUIDDIR = @exec_prefix@/suidbin
INSTALL_RCDIR = @INSTALL_RCDIR@ INSTALL_RCDIR = @INSTALL_RCDIR@
INSTALL_APACHE_CONFIG = @INSTALL_APACHE_CONFIG@ INSTALL_APACHE_CONFIG = @INSTALL_APACHE_CONFIG@
......
diff -ru dist/tg2.0/src/tg/config.h tg2.0/src/tg/config.h diff -ru dist/tg2.0/src/tg/config.h tg2.0/src/tg/config.h
--- dist/tg2.0/src/tg/config.h Thu Jan 24 16:30:09 2002 --- dist/tg2.0/src/tg/config.h 2002-01-24 16:30:09.000000000 -0700
+++ tg2.0/src/tg/config.h Wed Aug 25 14:37:32 2004 +++ tg2.0/src/tg/config.h 2012-03-21 16:54:20.000000000 -0600
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
/* Maximum packet buffer size. */ /* Maximum packet buffer size. */
...@@ -11,9 +11,28 @@ diff -ru dist/tg2.0/src/tg/config.h tg2.0/src/tg/config.h ...@@ -11,9 +11,28 @@ diff -ru dist/tg2.0/src/tg/config.h tg2.0/src/tg/config.h
/* Maximum value from random-number generator. */ /* Maximum value from random-number generator. */
diff -ru dist/tg2.0/src/tg/log.c tg2.0/src/tg/log.c diff -ru dist/tg2.0/src/tg/log.c tg2.0/src/tg/log.c
--- dist/tg2.0/src/tg/log.c Thu Jan 24 16:30:09 2002 --- dist/tg2.0/src/tg/log.c 2002-01-24 16:30:09.000000000 -0700
+++ tg2.0/src/tg/log.c Wed Aug 25 14:37:32 2004 +++ tg2.0/src/tg/log.c 2012-03-21 16:58:39.000000000 -0600
@@ -268,6 +268,11 @@ @@ -23,7 +23,6 @@
#include <sys/utsname.h>
#include <sys/param.h>
#include <errno.h>
-#include <utmp.h>
#include "config.h"
#include "distribution.h"
@@ -31,6 +30,10 @@
#include "decode.h"
#include "log.h"
+/* XXX utmp.h is defunct */
+#define UT_NAMESIZE 32
+#define UT_HOSTSIZE 256
+
/* Type definitions local to this file. */
#define FPRINTF (void) fprintf
@@ -268,6 +271,11 @@
char *cp = buf; char *cp = buf;
char ctl; char ctl;
...@@ -25,7 +44,7 @@ diff -ru dist/tg2.0/src/tg/log.c tg2.0/src/tg/log.c ...@@ -25,7 +44,7 @@ diff -ru dist/tg2.0/src/tg/log.c tg2.0/src/tg/log.c
/* Encode record type. */ /* Encode record type. */
*cp++ = LOGTYPE_ACCEPT; *cp++ = LOGTYPE_ACCEPT;
@@ -326,6 +331,11 @@ @@ -326,6 +334,11 @@
char *cp = buf; char *cp = buf;
char ctl; char ctl;
...@@ -37,7 +56,7 @@ diff -ru dist/tg2.0/src/tg/log.c tg2.0/src/tg/log.c ...@@ -37,7 +56,7 @@ diff -ru dist/tg2.0/src/tg/log.c tg2.0/src/tg/log.c
/* Encode record type. */ /* Encode record type. */
*cp++ = LOGTYPE_ERROR; *cp++ = LOGTYPE_ERROR;
@@ -391,6 +401,11 @@ @@ -391,6 +404,11 @@
char *cp = buf; char *cp = buf;
char ctl; char ctl;
...@@ -49,7 +68,7 @@ diff -ru dist/tg2.0/src/tg/log.c tg2.0/src/tg/log.c ...@@ -49,7 +68,7 @@ diff -ru dist/tg2.0/src/tg/log.c tg2.0/src/tg/log.c
/* Encode record type. */ /* Encode record type. */
*cp++ = LOGTYPE_RX; *cp++ = LOGTYPE_RX;
@@ -459,6 +474,11 @@ @@ -459,6 +477,11 @@
char *cp = buf; char *cp = buf;
char ctl; char ctl;
...@@ -61,7 +80,7 @@ diff -ru dist/tg2.0/src/tg/log.c tg2.0/src/tg/log.c ...@@ -61,7 +80,7 @@ diff -ru dist/tg2.0/src/tg/log.c tg2.0/src/tg/log.c
/* Encode record type. */ /* Encode record type. */
*cp++ = LOGTYPE_SETUP; *cp++ = LOGTYPE_SETUP;
@@ -510,6 +530,11 @@ @@ -510,6 +533,11 @@
char *cp = buf; char *cp = buf;
char ctl; char ctl;
...@@ -73,7 +92,7 @@ diff -ru dist/tg2.0/src/tg/log.c tg2.0/src/tg/log.c ...@@ -73,7 +92,7 @@ diff -ru dist/tg2.0/src/tg/log.c tg2.0/src/tg/log.c
/* Encode record type. */ /* Encode record type. */
*cp++ = LOGTYPE_TEARDOWN; *cp++ = LOGTYPE_TEARDOWN;
@@ -568,6 +593,11 @@ @@ -568,6 +596,11 @@
char *cp = buf; char *cp = buf;
char ctl; char ctl;
...@@ -85,7 +104,7 @@ diff -ru dist/tg2.0/src/tg/log.c tg2.0/src/tg/log.c ...@@ -85,7 +104,7 @@ diff -ru dist/tg2.0/src/tg/log.c tg2.0/src/tg/log.c
/* Encode record type. */ /* Encode record type. */
*cp++ = LOGTYPE_TX; *cp++ = LOGTYPE_TX;
@@ -717,6 +747,10 @@ @@ -717,6 +750,10 @@
extern FILE *log_fp; extern FILE *log_fp;
...@@ -97,8 +116,8 @@ diff -ru dist/tg2.0/src/tg/log.c tg2.0/src/tg/log.c ...@@ -97,8 +116,8 @@ diff -ru dist/tg2.0/src/tg/log.c tg2.0/src/tg/log.c
(void) fclose (log_fp); (void) fclose (log_fp);
diff -ru dist/tg2.0/src/tg/prot_dgram.c tg2.0/src/tg/prot_dgram.c diff -ru dist/tg2.0/src/tg/prot_dgram.c tg2.0/src/tg/prot_dgram.c
--- dist/tg2.0/src/tg/prot_dgram.c Thu Jan 24 16:30:10 2002 --- dist/tg2.0/src/tg/prot_dgram.c 2002-01-24 16:30:10.000000000 -0700
+++ tg2.0/src/tg/prot_dgram.c Wed Aug 25 14:37:32 2004 +++ tg2.0/src/tg/prot_dgram.c 2012-03-21 16:54:20.000000000 -0600
@@ -198,6 +198,22 @@ @@ -198,6 +198,22 @@
for (;;) for (;;)
{ {
...@@ -167,8 +186,8 @@ diff -ru dist/tg2.0/src/tg/prot_dgram.c tg2.0/src/tg/prot_dgram.c ...@@ -167,8 +186,8 @@ diff -ru dist/tg2.0/src/tg/prot_dgram.c tg2.0/src/tg/prot_dgram.c
} }
diff -ru dist/tg2.0/src/tg/prot_stream.c tg2.0/src/tg/prot_stream.c diff -ru dist/tg2.0/src/tg/prot_stream.c tg2.0/src/tg/prot_stream.c
--- dist/tg2.0/src/tg/prot_stream.c Thu Jan 24 16:30:10 2002 --- dist/tg2.0/src/tg/prot_stream.c 2002-01-24 16:30:10.000000000 -0700
+++ tg2.0/src/tg/prot_stream.c Wed Aug 25 14:37:32 2004 +++ tg2.0/src/tg/prot_stream.c 2012-03-21 16:54:20.000000000 -0600
@@ -147,6 +147,22 @@ @@ -147,6 +147,22 @@
for (;;) for (;;)
{ {
...@@ -241,8 +260,8 @@ diff -ru dist/tg2.0/src/tg/prot_stream.c tg2.0/src/tg/prot_stream.c ...@@ -241,8 +260,8 @@ diff -ru dist/tg2.0/src/tg/prot_stream.c tg2.0/src/tg/prot_stream.c
return (result); return (result);
} }
diff -ru dist/tg2.0/src/tg/prot_tcp.c tg2.0/src/tg/prot_tcp.c diff -ru dist/tg2.0/src/tg/prot_tcp.c tg2.0/src/tg/prot_tcp.c
--- dist/tg2.0/src/tg/prot_tcp.c Thu Jan 24 16:30:10 2002 --- dist/tg2.0/src/tg/prot_tcp.c 2002-01-24 16:30:10.000000000 -0700
+++ tg2.0/src/tg/prot_tcp.c Wed Aug 25 14:37:32 2004 +++ tg2.0/src/tg/prot_tcp.c 2012-03-21 16:54:20.000000000 -0600
@@ -93,6 +93,12 @@ @@ -93,6 +93,12 @@
#endif /* QOSDEBUG */ #endif /* QOSDEBUG */
...@@ -312,8 +331,8 @@ diff -ru dist/tg2.0/src/tg/prot_tcp.c tg2.0/src/tg/prot_tcp.c ...@@ -312,8 +331,8 @@ diff -ru dist/tg2.0/src/tg/prot_tcp.c tg2.0/src/tg/prot_tcp.c
{ {
(void)close(sfd); (void)close(sfd);
diff -ru dist/tg2.0/src/tg/prot_test.c tg2.0/src/tg/prot_test.c diff -ru dist/tg2.0/src/tg/prot_test.c tg2.0/src/tg/prot_test.c
--- dist/tg2.0/src/tg/prot_test.c Thu Jan 24 16:30:10 2002 --- dist/tg2.0/src/tg/prot_test.c 2002-01-24 16:30:10.000000000 -0700
+++ tg2.0/src/tg/prot_test.c Wed Aug 25 14:37:32 2004 +++ tg2.0/src/tg/prot_test.c 2012-03-21 16:54:20.000000000 -0600
@@ -447,6 +447,7 @@ @@ -447,6 +447,7 @@
if (!test_get_packets(prtab, fd, endtout)) if (!test_get_packets(prtab, fd, endtout))
...@@ -323,8 +342,8 @@ diff -ru dist/tg2.0/src/tg/prot_test.c tg2.0/src/tg/prot_test.c ...@@ -323,8 +342,8 @@ diff -ru dist/tg2.0/src/tg/prot_test.c tg2.0/src/tg/prot_test.c
} }
else else
diff -ru dist/tg2.0/src/tg/prot_udp.c tg2.0/src/tg/prot_udp.c diff -ru dist/tg2.0/src/tg/prot_udp.c tg2.0/src/tg/prot_udp.c
--- dist/tg2.0/src/tg/prot_udp.c Thu Jan 24 16:30:10 2002 --- dist/tg2.0/src/tg/prot_udp.c 2002-01-24 16:30:10.000000000 -0700
+++ tg2.0/src/tg/prot_udp.c Wed Aug 25 14:37:32 2004 +++ tg2.0/src/tg/prot_udp.c 2012-03-21 16:54:20.000000000 -0600
@@ -47,7 +47,7 @@ @@ -47,7 +47,7 @@
/* Apply QOS parameters to an existing fd. */ /* Apply QOS parameters to an existing fd. */
...@@ -380,8 +399,8 @@ diff -ru dist/tg2.0/src/tg/prot_udp.c tg2.0/src/tg/prot_udp.c ...@@ -380,8 +399,8 @@ diff -ru dist/tg2.0/src/tg/prot_udp.c tg2.0/src/tg/prot_udp.c
{ {
(void)close(sfd); (void)close(sfd);
diff -ru dist/tg2.0/src/tg/tg.y tg2.0/src/tg/tg.y diff -ru dist/tg2.0/src/tg/tg.y tg2.0/src/tg/tg.y
--- dist/tg2.0/src/tg/tg.y Thu Jan 24 16:30:10 2002 --- dist/tg2.0/src/tg/tg.y 2002-01-24 16:30:10.000000000 -0700
+++ tg2.0/src/tg/tg.y Tue Oct 5 16:53:50 2004 +++ tg2.0/src/tg/tg.y 2012-03-21 16:54:20.000000000 -0600
@@ -133,7 +133,11 @@ @@ -133,7 +133,11 @@
char *version = "2.0"; /* TG program version. */ char *version = "2.0"; /* TG program version. */
char *ofile = NULL; char *ofile = NULL;
......
...@@ -528,7 +528,7 @@ sub doboot() ...@@ -528,7 +528,7 @@ sub doboot()
$emulabconfig{OPS_PKG} = "emulab-ops-3.1"; $emulabconfig{OPS_PKG} = "emulab-ops-3.1";
$emulabconfig{BOSS_PKG} = "emulab-boss-3.1"; $emulabconfig{BOSS_PKG} = "emulab-boss-3.1";
} }
elsif ($FBSD_VERSION >= 8.2) { elsif ($FBSD_VERSION >= 8.2 && $FBSD_VERSION < 9.0) {
$emulabconfig{FS_PKG_DIR} = "/share/freebsd/8.2/packages"; $emulabconfig{FS_PKG_DIR} = "/share/freebsd/8.2/packages";
$emulabconfig{FS_PKG_DIR} .= ".elvincompat" $emulabconfig{FS_PKG_DIR} .= ".elvincompat"
if ($emulabconfig{"CONFIG_ELVIN"}); if ($emulabconfig{"CONFIG_ELVIN"});
...@@ -540,6 +540,18 @@ sub doboot() ...@@ -540,6 +540,18 @@ sub doboot()
$emulabconfig{PACKAGE_TARBALL} = "FreeBSD-8.2-packages.tar.gz"; $emulabconfig{PACKAGE_TARBALL} = "FreeBSD-8.2-packages.tar.gz";
$emulabconfig{PGENI_PKG} = "emulab-protogeni-2.0"; $emulabconfig{PGENI_PKG} = "emulab-protogeni-2.0";
} }
elsif ($FBSD_VERSION >= 9.0) {
$emulabconfig{FS_PKG_DIR} = "/share/freebsd/9.0/packages";
$emulabconfig{FS_PKG_DIR} .= ".elvincompat"
if ($emulabconfig{"CONFIG_ELVIN"});
$emulabconfig{OPS_PKG_DIR} = $emulabconfig{FS_PKG_DIR};
$emulabconfig{BOSS_PKG_DIR} = $emulabconfig{FS_PKG_DIR};
$emulabconfig{FS_PKG} = "emulab-fs-5.0";
$emulabconfig{OPS_PKG} = "emulab-ops-5.0";
$emulabconfig{BOSS_PKG} = "emulab-boss-5.0";
$emulabconfig{PACKAGE_TARBALL} = "FreeBSD-9.0-packages.tar.gz";
$emulabconfig{PGENI_PKG} = "emulab-protogeni-2.0";
}
if (exists($emulabconfig{"PACKAGE_TARBALL"})) { if (exists($emulabconfig{"PACKAGE_TARBALL"})) {
$emulabconfig{FS_PKG_DIR} = "$TBDIR/packages"; $emulabconfig{FS_PKG_DIR} = "$TBDIR/packages";
$emulabconfig{OPS_PKG_DIR} = $emulabconfig{FS_PKG_DIR}; $emulabconfig{OPS_PKG_DIR} = $emulabconfig{FS_PKG_DIR};
......
...@@ -40,7 +40,11 @@ $BOSS_PORT = "emulab-boss-1.8"; ...@@ -40,7 +40,11 @@ $BOSS_PORT = "emulab-boss-1.8";
$OPS_PORT = "emulab-ops-1.4"; $OPS_PORT = "emulab-ops-1.4";
$FS_PORT = "emulab-fs-1.4"; $FS_PORT = "emulab-fs-1.4";
if ($FBSD_MAJOR > 4) { if ($FBSD_MAJOR > 4) {
if ($FBSD_MAJOR > 7) { if ($FBSD_MAJOR > 8) {
$BOSS_PORT = "emulab-boss-5.0";
$OPS_PORT = "emulab-ops-5.0";
$FS_PORT = "emulab-fs-5.0";
} elsif ($FBSD_MAJOR > 7) {
$BOSS_PORT = "emulab-boss-4.0"; $BOSS_PORT = "emulab-boss-4.0";
$OPS_PORT = "emulab-ops-4.0"; $OPS_PORT = "emulab-ops-4.0";
$FS_PORT = "emulab-fs-4.0"; $FS_PORT = "emulab-fs-4.0";
...@@ -68,10 +72,11 @@ $PHP_VERSION = 4; ...@@ -68,10 +72,11 @@ $PHP_VERSION = 4;
$PHP_PORT = "php4-extensions-1.0"; $PHP_PORT = "php4-extensions-1.0";
if ($FBSD_MAJOR > 7 || ($FBSD_MAJOR == 7 && $FBSD_MINOR > 2)) { if ($FBSD_MAJOR > 7 || ($FBSD_MAJOR == 7 && $FBSD_MINOR > 2)) {
$PHP_VERSION = 5; $PHP_VERSION = 5;
if ($FBSD_MAJOR > 7) { if ($FBSD_MAJOR > 8) {
$PHP_PORT = "php5-extensions-1.6";
} elsif ($FBSD_MAJOR > 7) {
$PHP_PORT = "php5-extensions-1.4"; $PHP_PORT = "php5-extensions-1.4";
} } else {
else {
$PHP_PORT = "php5-extensions-1.3"; $PHP_PORT = "php5-extensions-1.3";
} }
} }
...@@ -94,7 +99,10 @@ $SELFLOAD_PATCH = "$main::TOP_SRCDIR/patches/SelfLoader.patch"; ...@@ -94,7 +99,10 @@ $SELFLOAD_PATCH = "$main::TOP_SRCDIR/patches/SelfLoader.patch";
# #
$PYM2_PKG = "py25-m2crypto-0.19.1"; $PYM2_PKG = "py25-m2crypto-0.19.1";
$PY_VER = "python2.5"; $PY_VER = "python2.5";
if ($FBSD_MAJOR > 7 || ($FBSD_MAJOR == 7 && $FBSD_MINOR > 2)) { if ($FBSD_MAJOR > 8) {
$PYM2_PKG = "py27-m2crypto-0.21.1";
$PY_VER = "python2.7";
} elsif ($FBSD_MAJOR > 7 || ($FBSD_MAJOR == 7 && $FBSD_MINOR > 2)) {
$PYM2_PKG = "py26-m2crypto-0.20"; $PYM2_PKG = "py26-m2crypto-0.20";
$PY_VER = "python2.6"; $PY_VER = "python2.6";
} }
......
...@@ -5,6 +5,7 @@ use strict; ...@@ -5,6 +5,7 @@ use strict;
use libinstall; use libinstall;
use installvars; use installvars;
my $PERL = "/usr/bin/perl";
my $SUIDPERL = "/usr/bin/suidperl"; my $SUIDPERL = "/usr/bin/suidperl";
sub Install($$$) sub Install($$$)
...@@ -16,6 +17,17 @@ sub Install($$$) ...@@ -16,6 +17,17 @@ sub Install($$$)
if ($isupdate); if ($isupdate);
Phase "perl", "Checking for setuid perl", sub { Phase "perl", "Checking for setuid perl", sub {
#
# See if suidperl is supported. Perl 5.12 and beyond don't have it.
#
if (-x $PERL) {
my $vstr = `$PERL -v | grep version`;
if ($vstr =~ /This is perl 5, version (\d+),/) {
if (int($1) >= 12) {
PhaseSkip("Not used");
}
}
}
Phase "sperl", "Checking for sperl", sub { Phase "sperl", "Checking for sperl", sub {
if (ExecQuiet("$PKG_INFO -L -x perl-5 | fgrep -q -s sperl") == 0) { if (ExecQuiet("$PKG_INFO -L -x perl-5 | fgrep -q -s sperl") == 0) {
PhaseSkip("Perl is okay"); PhaseSkip("Perl is okay");
......
...@@ -24,7 +24,9 @@ MAINTAINER= testbed-ops@flux.utah.edu ...@@ -24,7 +24,9 @@ MAINTAINER= testbed-ops@flux.utah.edu
# We must make sure PERL is built with this. # We must make sure PERL is built with this.
# #
.MAKEFLAGS+= ENABLE_SUIDPERL=yes .MAKEFLAGS+= ENABLE_SUIDPERL=yes
.if (${PORTVERSION} == "3.1" || ${PORTVERSION} == "4.0") .if ${PORTVERSION} == "5.0"
.MAKEFLAGS+= PERL_VERSION=5.12.4 PERL_VER=5.12.4 PERL_ARCH=mach
.elif (${PORTVERSION} == "3.1" || ${PORTVERSION} == "4.0")
.MAKEFLAGS+= PERL_VERSION=5.10.1 PERL_VER=5.10.1 PERL_ARCH=mach .MAKEFLAGS+= PERL_VERSION=5.10.1 PERL_VER=5.10.1 PERL_ARCH=mach
.elif ${PORTVERSION} == "3.0" .elif ${PORTVERSION} == "3.0"
.MAKEFLAGS+= PERL_VERSION=5.10.0 PERL_VER=5.10.0 PERL_ARCH=mach .MAKEFLAGS+= PERL_VERSION=5.10.0 PERL_VER=5.10.0 PERL_ARCH=mach
...@@ -48,7 +50,7 @@ MAINTAINER= testbed-ops@flux.utah.edu ...@@ -48,7 +50,7 @@ MAINTAINER= testbed-ops@flux.utah.edu
# agrees with what is in the emulab-ops and emulab-php* metaports. # agrees with what is in the emulab-ops and emulab-php* metaports.
# #
.MAKEFLAGS+= -DWITH_APACHE .MAKEFLAGS+= -DWITH_APACHE
.if ${PORTVERSION} == "4.0" .if (${PORTVERSION} == "4.0" || ${PORTVERSION} == "5.0")
.MAKEFLAGS+= APACHE_PORT=www/apache22 .MAKEFLAGS+= APACHE_PORT=www/apache22
.MAKEFLAGS+= WITH_SUEXEC=yes .MAKEFLAGS+= WITH_SUEXEC=yes
.else .else
...@@ -73,7 +75,7 @@ MAINTAINER= testbed-ops@flux.utah.edu ...@@ -73,7 +75,7 @@ MAINTAINER= testbed-ops@flux.utah.edu
.if (${PORTVERSION} == "1.7" || ${PORTVERSION} == "2.0") .if (${PORTVERSION} == "1.7" || ${PORTVERSION} == "2.0")
BUILD_DEPENDS= \ BUILD_DEPENDS= \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/Mysql.pm:${PORTSDIR}/databases/p5-DBD-mysql50 ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/Mysql.pm:${PORTSDIR}/databases/p5-DBD-mysql50
.elif (${PORTVERSION} == "4.0") .elif (${PORTVERSION} == "4.0" || ${PORTVERSION} == "5.0")
# back to a standard p5-DBD-mysql50 install # back to a standard p5-DBD-mysql50 install
BUILD_DEPENDS= \ BUILD_DEPENDS= \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/DBD/mysql.pm:${PORTSDIR}/databases/p5-DBD-mysql50 \ ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/DBD/mysql.pm:${PORTSDIR}/databases/p5-DBD-mysql50 \
...@@ -97,7 +99,7 @@ LIB_DEPENDS+= lthread.[236]:${PORTSDIR}/devel/linuxthreads ...@@ -97,7 +99,7 @@ LIB_DEPENDS+= lthread.[236]:${PORTSDIR}/devel/linuxthreads
LIB_DEPENDS+= xerces-c.27:${PORTSDIR}/textproc/xerces-c2 LIB_DEPENDS+= xerces-c.27:${PORTSDIR}/textproc/xerces-c2
.endif .endif
.if ${OSMAJOR} >= 7 .if ${OSMAJOR} >= 7
LIB_DEPENDS+= xmlrpc.9:${PORTSDIR}/net/xmlrpc-c LIB_DEPENDS+= xmlrpc:${PORTSDIR}/net/xmlrpc-c
.endif .endif
# #
...@@ -148,7 +150,7 @@ RUN_DEPENDS+= \ ...@@ -148,7 +150,7 @@ RUN_DEPENDS+= \
mysqlhotcopy:${PORTSDIR}/databases/mysql50-scripts mysqlhotcopy:${PORTSDIR}/databases/mysql50-scripts
# apache related ports # apache related ports
.if ${PORTVERSION} == "4.0" .if (${PORTVERSION} == "4.0" || ${PORTVERSION} == "5.0")
RUN_DEPENDS+= \ RUN_DEPENDS+= \
${LOCALBASE}/libexec/apache22/mod_ssl.so:${PORTSDIR}/${APACHE_PORT} \ ${LOCALBASE}/libexec/apache22/mod_ssl.so:${PORTSDIR}/${APACHE_PORT} \
${LOCALBASE}/libexec/apache22/mod_fastcgi.so:${PORTSDIR}/www/mod_fastcgi ${LOCALBASE}/libexec/apache22/mod_fastcgi.so:${PORTSDIR}/www/mod_fastcgi
...@@ -159,7 +161,8 @@ RUN_DEPENDS+= \ ...@@ -159,7 +161,8 @@ RUN_DEPENDS+= \
.endif .endif
# m2crypto port # m2crypto port
.if (${PORTVERSION} == "3.0" || ${PORTVERSION} == "3.1" || ${PORTVERSION} == "4.0") .if (${PORTVERSION} == "3.0" || ${PORTVERSION} == "3.1" || \
${PORTVERSION} == "4.0" || ${PORTVERSION} == "5.0")
# must handle patching of m2crypto when the port is built # must handle patching of m2crypto when the port is built
RUN_DEPENDS+= \ RUN_DEPENDS+= \
${PYTHON_PKGNAMEPREFIX}m2crypto>0:${PORTSDIR}/misc/emulab-py-m2crypto ${PYTHON_PKGNAMEPREFIX}m2crypto>0:${PORTSDIR}/misc/emulab-py-m2crypto
...@@ -170,7 +173,7 @@ RUN_DEPENDS+= \ ...@@ -170,7 +173,7 @@ RUN_DEPENDS+= \
.endif .endif
# dhcpd port # dhcpd port
.if ${PORTVERSION} == "4.0" .if (${PORTVERSION} == "4.0" || ${PORTVERSION} == "5.0")
RUN_DEPENDS+= \ RUN_DEPENDS+= \
dhcpd:${PORTSDIR}/net/isc-dhcp42-server dhcpd:${PORTSDIR}/net/isc-dhcp42-server
.elif (${PORTVERSION} == "3.1" || ${PORTVERSION} == "3.0") .elif (${PORTVERSION} == "3.1" || ${PORTVERSION} == "3.0")
...@@ -182,7 +185,7 @@ RUN_DEPENDS+= \ ...@@ -182,7 +185,7 @@ RUN_DEPENDS+= \
.endif .endif
# misc. old vs. new port stuff # misc. old vs. new port stuff
.if ${PORTVERSION} == "4.0" .if (${PORTVERSION} == "4.0" || ${PORTVERSION} == "5.0")
RUN_DEPENDS+= \ RUN_DEPENDS+= \
autoconf:${PORTSDIR}/devel/autoconf \ autoconf:${PORTSDIR}/devel/autoconf \
libtool:${PORTSDIR}/devel/libtool libtool:${PORTSDIR}/devel/libtool
......
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
OSMAJOR!= /usr/bin/uname -r | /usr/bin/sed -e 's/\..*//' OSMAJOR!= /usr/bin/uname -r | /usr/bin/sed -e 's/\..*//'
OSMINOR!= /usr/bin/uname -r | /usr/bin/sed -e 's/[0-9][0-9]*\.\([0-9][0-9]*\).*/\1/' OSMINOR!= /usr/bin/uname -r | /usr/bin/sed -e 's/[0-9][0-9]*\.\([0-9][0-9]*\).*/\1/'
.if ${OSMAJOR} > 8
EMULAB_PORTVERSION= 5.0
.else
.if ${OSMAJOR} > 7 .if ${OSMAJOR} > 7
EMULAB_PORTVERSION= 4.0 EMULAB_PORTVERSION= 4.0
.else .else
...@@ -28,12 +31,20 @@ EMULAB_PORTVERSION= 1.7 ...@@ -28,12 +31,20 @@ EMULAB_PORTVERSION= 1.7
. endif . endif
. endif . endif
.endif .endif
.endif
# #
# Select PHP and Apache versions # Select PHP and Apache versions
# Fix up some port diffs # Fix up some port diffs
# #
.if ${EMULAB_PORTVERSION} == "4.0" .if ${EMULAB_PORTVERSION} == "5.0"
PHP_VER= 5
PERL_VER= 5.12.4
PYTHON_DEFAULT_VERSION=python2.7
APACHE_PORT= www/apache22
BOOST_PORT= devel/boost-all
P5SNMP_PORT= misc/p5-SNMP
.elif ${EMULAB_PORTVERSION} == "4.0"
PHP_VER= 5 PHP_VER= 5
PERL_VER= 5.10.1 PERL_VER= 5.10.1
APACHE_PORT= www/apache22 APACHE_PORT= www/apache22
......
...@@ -18,21 +18,13 @@ COMMENT= "Meta-port for an Emulab fs node" ...@@ -18,21 +18,13 @@ COMMENT= "Meta-port for an Emulab fs node"
MAINTAINER= testbed-ops@flux.utah.edu MAINTAINER= testbed-ops@flux.utah.edu
#
# Select PHP and Apache versions
# Fix up some port diffs
#
.if ${PORTVERSION} == "3.1"
PHP_VER= 5
.else
PHP_VER= 4
.endif
# #
# We must make sure PERL is built with this. # We must make sure PERL is built with this.
# #
.MAKEFLAGS+= ENABLE_SUIDPERL=yes .MAKEFLAGS+= ENABLE_SUIDPERL=yes
.if (${PORTVERSION} == "3.1" || ${PORTVERSION} == "4.0") .if ${PORTVERSION} == "5.0"
.MAKEFLAGS+= PERL_VERSION=5.12.4 PERL_VER=5.12.4 PERL_ARCH=mach
.elif (${PORTVERSION} == "3.1" || ${PORTVERSION} == "4.0")
.MAKEFLAGS+= PERL_VERSION=5.10.1 PERL_VER=5.10.1 PERL_ARCH=mach .MAKEFLAGS+= PERL_VERSION=5.10.1 PERL_VER=5.10.1 PERL_ARCH=mach
.elif ${PORTVERSION} == "3.0" .elif ${PORTVERSION} == "3.0"
.MAKEFLAGS+= PERL_VERSION=5.10.0 PERL_VER=5.10.0 PERL_ARCH=mach .MAKEFLAGS+= PERL_VERSION=5.10.0 PERL_VER=5.10.0 PERL_ARCH=mach
...@@ -56,7 +48,7 @@ RUN_DEPENDS= gmake:${PORTSDIR}/devel/gmake \ ...@@ -56,7 +48,7 @@ RUN_DEPENDS= gmake:${PORTSDIR}/devel/gmake \
sudo:${PORTSDIR}/security/sudo \ sudo:${PORTSDIR}/security/sudo \
rsync:${PORTSDIR}/net/rsync \ rsync:${PORTSDIR}/net/rsync \
.if ${PORTVERSION} == "4.0" .if (${PORTVERSION} == "4.0" || ${PORTVERSION} == "5.0")
RUN_DEPENDS+= \ RUN_DEPENDS+= \
smbd:${PORTSDIR}/net/samba36 smbd:${PORTSDIR}/net/samba36
.else .else
......
...@@ -28,7 +28,9 @@ MAINTAINER= testbed-ops@flux.utah.edu ...@@ -28,7 +28,9 @@ MAINTAINER= testbed-ops@flux.utah.edu
# We must make sure PERL is built with this. # We must make sure PERL is built with this.
# #
.MAKEFLAGS+= ENABLE_SUIDPERL=yes .MAKEFLAGS+= ENABLE_SUIDPERL=yes
.if (${PORTVERSION} == "3.1" || ${PORTVERSION} == "4.0") .if ${PORTVERSION} == "5.0"
.MAKEFLAGS+= PERL_VERSION=5.12.4 PERL_VER=5.12.4 PERL_ARCH=mach
.elif (${PORTVERSION} == "3.1" || ${PORTVERSION} == "4.0")
.MAKEFLAGS+= PERL_VERSION=5.10.1 PERL_VER=5.10.1 PERL_ARCH=mach .MAKEFLAGS+= PERL_VERSION=5.10.1 PERL_VER=5.10.1 PERL_ARCH=mach
.elif ${PORTVERSION} == "3.0" .elif ${PORTVERSION} == "3.0"
.MAKEFLAGS+= PERL_VERSION=5.10.0 PERL_VER=5.10.0 PERL_ARCH=mach .MAKEFLAGS+= PERL_VERSION=5.10.0 PERL_VER=5.10.0 PERL_ARCH=mach
...@@ -52,7 +54,7 @@ MAINTAINER= testbed-ops@flux.utah.edu ...@@ -52,7 +54,7 @@ MAINTAINER= testbed-ops@flux.utah.edu
# agrees with what is in the emulab-ops and emulab-php* metaports. # agrees with what is in the emulab-ops and emulab-php* metaports.
# #
.MAKEFLAGS+= -DWITH_APACHE .MAKEFLAGS+= -DWITH_APACHE
.if ${PORTVERSION} == "4.0" .if (${PORTVERSION} == "4.0" || ${PORTVERSION} == "5.0")
.MAKEFLAGS+= APACHE_PORT=www/apache22 .MAKEFLAGS+= APACHE_PORT=www/apache22
.MAKEFLAGS+= WITH_SUEXEC=yes .MAKEFLAGS+= WITH_SUEXEC=yes
.else .else
...@@ -77,7 +79,7 @@ MAINTAINER= testbed-ops@flux.utah.edu ...@@ -77,7 +79,7 @@ MAINTAINER= testbed-ops@flux.utah.edu
.if (${PORTVERSION} == "1.4" || ${PORTVERSION} == "2.0") .if (${PORTVERSION} == "1.4" || ${PORTVERSION} == "2.0")
BUILD_DEPENDS= \ BUILD_DEPENDS= \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/Mysql.pm:${PORTSDIR}/databases/p5-DBD-mysql50 ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/Mysql.pm:${PORTSDIR}/databases/p5-DBD-mysql50
.elif (${PORTVERSION} == "4.0") .elif (${PORTVERSION} == "4.0" || ${PORTVERSION} == "5.0")
# back to a standard p5-DBD-mysql50 install # back to a standard p5-DBD-mysql50 install
BUILD_DEPENDS= \ BUILD_DEPENDS= \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/DBD/mysql.pm:${PORTSDIR}/databases/p5-DBD-mysql50 \ ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/DBD/mysql.pm:${PORTSDIR}/databases/p5-DBD-mysql50 \
...@@ -98,7 +100,7 @@ LIB_DEPENDS+= mhash.2:${PORTSDIR}/security/mhash \ ...@@ -98,7 +100,7 @@ LIB_DEPENDS+= mhash.2:${PORTSDIR}/security/mhash \
mysqlclient.15:${PORTSDIR}/databases/mysql50-client mysqlclient.15:${PORTSDIR}/databases/mysql50-client
.endif .endif
.if ${OSMAJOR} >= 7 .if ${OSMAJOR} >= 7
LIB_DEPENDS+= xmlrpc.9:${PORTSDIR}/net/xmlrpc-c LIB_DEPENDS+= xmlrpc:${PORTSDIR}/net/xmlrpc-c
.endif .endif
.if defined(ELVIN_COMPAT) .if defined(ELVIN_COMPAT)
...@@ -126,7 +128,7 @@ RUN_DEPENDS+= ${LOCALBASE}/libexec/elvind:${PORTSDIR}/misc/elvind ...@@ -126,7 +128,7 @@ RUN_DEPENDS+= ${LOCALBASE}/libexec/elvind:${PORTSDIR}/misc/elvind
.endif .endif
# apache related ports # apache related ports
.if ${PORTVERSION} == "4.0" .if (${PORTVERSION} == "4.0" || ${PORTVERSION} == "5.0")
RUN_DEPENDS+= \ RUN_DEPENDS+= \
${LOCALBASE}/libexec/apache22/mod_ssl.so:${PORTSDIR}/${APACHE_PORT} \ ${LOCALBASE}/libexec/apache22/mod_ssl.so:${PORTSDIR}/${APACHE_PORT} \
${LOCALBASE}/libexec/apache22/mod_fastcgi.so:${PORTSDIR}/www/mod_fastcgi ${LOCALBASE}/libexec/apache22/mod_fastcgi.so:${PORTSDIR}/www/mod_fastcgi
...@@ -137,7 +139,8 @@ RUN_DEPENDS+= \ ...@@ -137,7 +139,8 @@ RUN_DEPENDS+= \
.endif .endif
# m2crypto port # m2crypto port
.if (${PORTVERSION} == "3.0" || ${PORTVERSION} == "3.1" || ${PORTVERSION} == "4.0") .if (${PORTVERSION} == "3.0" || ${PORTVERSION} == "3.1" || \
${PORTVERSION} == "4.0" || ${PORTVERSION} == "5.0")
# must handle patching of m2crypto when the port is built # must handle patching of m2crypto when the port is built
# also needs swig to install! # also needs swig to install!
RUN_DEPENDS+= \ RUN_DEPENDS+= \
...@@ -150,7 +153,7 @@ RUN_DEPENDS+= \ ...@@ -150,7 +153,7 @@ RUN_DEPENDS+= \
.endif .endif
# misc. old vs. new port stuff # misc. old vs. new port stuff
.if ${PORTVERSION} == "4.0" .if (${PORTVERSION} == "4.0" || ${PORTVERSION} == "5.0")
RUN_DEPENDS+= \ RUN_DEPENDS+= \
autoconf:${PORTSDIR}/devel/autoconf \ autoconf:${PORTSDIR}/devel/autoconf \
libtool:${PORTSDIR}/devel/libtool libtool:${PORTSDIR}/devel/libtool
......
...@@ -2,38 +2,27 @@ ...@@ -2,38 +2,27 @@
# Date created: 21 July 2009 # Date created: 21 July 2009
# Whom: stoller@flux.utah.edu # Whom: stoller@flux.utah.edu
# Need the major version number to figure out to do. .include "../emulab-boss/Makefile.emulab"