Commit e81136ad authored by Mike Hibler's avatar Mike Hibler

Support for FreeBSD 10.x boss/ops.

The biggest changes were related to 10.0's replacing gcc with clang
and the switch to a new package system. The former required various
fixes to Makefiles that hardwired "gcc" and also missing prototypes
in source files that clang is particularly obnoxious about.

There was also accomodating the normal evolution of the ports tree.
New variables were needed in many of the Makefiles for this. Hopefully,
all the changes I made are backward compatible, but I don't actually
care that much since I hope to never, ever have to remake those older
packages! A new emulab version of the m2crypto port was needed to
reflect that m2crypto is no longer installed as an .egg file.

Casualties:

  * Emulab assign. As of this commit, assign does not build with
    clang. It will build, but immediately core dumps if built with
    a gcc port (gcc46 below). THIS NEEDS TO BE FIXED!

  * Emulab nsverify. This requires building a pure ns-2.34, which
    is old and does not compile with clang. You will need to set
    NSVERIFY=0 in your defs file. I did this in defs-elabinelab
    (iff FBSD==10) but no where else right now.

  * Bind in the base distro. Bind is no longer part of FreeBSD
    (it has been replaced with something called "unbound"). So we
    install bind99 from a port and we make the /etc/namedb symlink
    to /usr/local/etc/namedb which is where it now lives.

  * Perl 5.12. It has been totally removed from the ports tree.
    We now install 5.14, the next-most obsolete version of Perl!

  * pkg_{add,delete,info}. As mentioned, the packages tools have
    changed. For the most part "pkg <cmd>" is the same as "pkg_<cmd>"
    but not always. This required considerable violence in the
    install/phases code. But it is actually cleaner now.

  * GCC in the base distro. I added installation of the gcc46 port
    to the boss and ops meta packages, just for old-times sake
    (we might wind up needing it, if still more stuff doesn't work
    with clang).
parent 454d9991
...@@ -278,7 +278,7 @@ diff -c -r1.1.1.1 -r1.4 ...@@ -278,7 +278,7 @@ diff -c -r1.1.1.1 -r1.4
/* /*
! * wait_for_xmit(): Wait for certain period of time in busy-loop ! * wait_for_xmit(): Wait for certain period of time in busy-loop
*/ */
__inline__ void wait_for_xmit(struct timeval *target, struct timeval *now) ! __inline__ void wait_for_xmit(struct timeval *target, struct timeval *now)
{ {
while(1){ while(1){
- gettimeofday(now,NULL); - gettimeofday(now,NULL);
...@@ -322,7 +322,7 @@ diff -c -r1.1.1.1 -r1.4 ...@@ -322,7 +322,7 @@ diff -c -r1.1.1.1 -r1.4
! /* ! /*
! * wait_for_xmit(): Wait for certain period of time ! * wait_for_xmit(): Wait for certain period of time
*/ */
__inline__ void wait_for_xmit(struct timeval *target, struct timeval *now) ! static __inline__ void wait_for_xmit(struct timeval *target, struct timeval *now)
{ {
+ gettimeofday(now,NULL); + gettimeofday(now,NULL);
+ if (usecpertick) { + if (usecpertick) {
......
# #
# Copyright (c) 2000-2011 University of Utah and the Flux Group. # Copyright (c) 2000-2014 University of Utah and the Flux Group.
# #
# {{{EMULAB-LICENSE # {{{EMULAB-LICENSE
# #
...@@ -36,7 +36,7 @@ include $(TESTBED_SRCDIR)/GNUmakerules ...@@ -36,7 +36,7 @@ include $(TESTBED_SRCDIR)/GNUmakerules
LIBTBDIR = $(TESTBED_LIBOBJDIR)/libtb LIBTBDIR = $(TESTBED_LIBOBJDIR)/libtb
LIBEVENTDIR = $(TESTBED_LIBOBJDIR)/event LIBEVENTDIR = $(TESTBED_LIBOBJDIR)/event
CPPC = g++ CPPC = $(CXX)
# Rules to make sure that some libraries we need from other directories get # Rules to make sure that some libraries we need from other directories get
# built first # built first
......
This diff is collapsed.
# $FreeBSD: head/etc/group 241823 2012-10-22 01:18:41Z marcel $ # $FreeBSD: releng/10.0/etc/group 256366 2013-10-12 06:08:18Z rpaulo $
# #
wheel:*:0:root,toor wheel:*:0:root,toor
daemon:*:1: daemon:*:1:
kmem:*:2:root,toor kmem:*:2:root
sys:*:3:root,toor sys:*:3:root
tty:*:4:root,toor tty:*:4:root
operator:*:5:root,toor operator:*:5:root
mail:*:6: mail:*:6:
bin:*:7: bin:*:7:
news:*:8: news:*:8:
man:*:9: man:*:9:
games:*:13: games:*:13:
ftp:*:14: ftp:*:14:
staff:*:20:root,toor staff:*:20:
sshd:*:22: sshd:*:22:
smmsp:*:25: smmsp:*:25:
mailnull:*:26: mailnull:*:26:
_atf:*:27: guest:*:31:
guest:*:31:root,toor
bind:*:53: bind:*:53:
unbound:*:59:
proxy:*:62: proxy:*:62:
authpf:*:63: authpf:*:63:
_pflogd:*:64: _pflogd:*:64:
...@@ -35,3 +35,4 @@ sfs:*:171: ...@@ -35,3 +35,4 @@ sfs:*:171:
messagebus:*:556: messagebus:*:556:
polkit:*:562: polkit:*:562:
haldaemon:*:560: haldaemon:*:560:
git_daemon:*:964:
# $FreeBSD: src/etc/hosts,v 1.16 2003/01/28 21:29:23 dbaker Exp $ # $FreeBSD: releng/10.0/etc/hosts 109997 2003-01-28 21:29:23Z dbaker $
# #
# Host Database # Host Database
# #
...@@ -11,5 +11,5 @@ ...@@ -11,5 +11,5 @@
# #
# #
#::1 localhost localhost.my.domain #::1 localhost localhost.my.domain
127.0.0.1 localhost loghost 127.0.0.1 localhost loghost
# $FreeBSD: head/etc/master.passwd 243752 2012-12-01 15:11:46Z rwatson $ # $FreeBSD: releng/10.0/etc/master.passwd 256366 2013-10-12 06:08:18Z rpaulo $
# #
root:$1$0DKicYf8$PsfF3uhmTrtuaJKH/rxtQ/:0:0::0:0:Charlie &:/root:/bin/csh root:$1$0DKicYf8$PsfF3uhmTrtuaJKH/rxtQ/:0:0::0:0:Charlie &:/root:/bin/csh
toor:$1$0DKicYf8$PsfF3uhmTrtuaJKH/rxtQ/:0:0::0:0:Chaplin &:/root:/bin/csh toor:$1$0DKicYf8$PsfF3uhmTrtuaJKH/rxtQ/:0:0::0:0:Chaplin &:/root:/bin/csh
...@@ -13,9 +13,8 @@ man:*:9:9::0:0:Mister Man Pages:/usr/share/man:/usr/sbin/nologin ...@@ -13,9 +13,8 @@ man:*:9:9::0:0:Mister Man Pages:/usr/share/man:/usr/sbin/nologin
sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/usr/sbin/nologin sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/usr/sbin/nologin
smmsp:*:25:25::0:0:Sendmail Submission User:/var/spool/clientmqueue:/usr/sbin/nologin smmsp:*:25:25::0:0:Sendmail Submission User:/var/spool/clientmqueue:/usr/sbin/nologin
mailnull:*:26:26::0:0:Sendmail Default User:/var/spool/mqueue:/usr/sbin/nologin mailnull:*:26:26::0:0:Sendmail Default User:/var/spool/mqueue:/usr/sbin/nologin
# Emulab: _atf changed to 28, 27 is mike and he ain't budgin'
_atf:*:28:27::0:0:& pseudo-user:/nonexistent:/usr/sbin/nologin
bind:*:53:53::0:0:Bind Sandbox:/:/usr/sbin/nologin bind:*:53:53::0:0:Bind Sandbox:/:/usr/sbin/nologin
unbound:*:59:59::0:0:Unbound DNS Resolver:/var/unbound:/usr/sbin/nologin
proxy:*:62:62::0:0:Packet Filter pseudo-user:/nonexistent:/usr/sbin/nologin proxy:*:62:62::0:0:Packet Filter pseudo-user:/nonexistent:/usr/sbin/nologin
_pflogd:*:64:64::0:0:pflogd privsep user:/var/empty:/usr/sbin/nologin _pflogd:*:64:64::0:0:pflogd privsep user:/var/empty:/usr/sbin/nologin
_dhcp:*:65:65::0:0:dhcp programs:/var/empty:/usr/sbin/nologin _dhcp:*:65:65::0:0:dhcp programs:/var/empty:/usr/sbin/nologin
...@@ -29,3 +28,4 @@ sfs:*:171:171::0:0:SFS pseudo-user:/:/usr/sbin/nologin ...@@ -29,3 +28,4 @@ sfs:*:171:171::0:0:SFS pseudo-user:/:/usr/sbin/nologin
messagebus:*:556:556::0:0:D-BUS Daemon User:/nonexistent:/usr/sbin/nologin messagebus:*:556:556::0:0:D-BUS Daemon User:/nonexistent:/usr/sbin/nologin
polkit:*:562:562::0:0:PolicyKit Daemon User:/nonexistent:/usr/sbin/nologin polkit:*:562:562::0:0:PolicyKit Daemon User:/nonexistent:/usr/sbin/nologin
haldaemon:*:560:560::0:0:HAL Daemon User:/nonexistent:/usr/sbin/nologin haldaemon:*:560:560::0:0:HAL Daemon User:/nonexistent:/usr/sbin/nologin
git_daemon:*:964:964::0:0:git daemon:/nonexistent:/usr/sbin/nologin
named_enable="NO"
sendmail_enable="NO" sendmail_enable="NO"
sshd_enable="YES" sshd_enable="YES"
nfs_client_enable="YES" nfs_client_enable="YES"
......
/* /*
* Copyright (c) 2004, 2005 University of Utah and the Flux Group. * Copyright (c) 2004-2014 University of Utah and the Flux Group.
* *
* {{{EMULAB-LICENSE * {{{EMULAB-LICENSE
* *
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "config.h" #include "config.h"
#include <unistd.h>
#include <sys/param.h> #include <sys/param.h>
#include <math.h> #include <math.h>
......
/* /*
* Copyright (c) 2004-2011 University of Utah and the Flux Group. * Copyright (c) 2004-2014 University of Utah and the Flux Group.
* *
* {{{EMULAB-LICENSE * {{{EMULAB-LICENSE
* *
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "config.h" #include "config.h"
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
......
#!/usr/bin/perl -w #!/usr/bin/perl -w
# #
# Copyright (c) 2009 University of Utah and the Flux Group. # Copyright (c) 2009-2014 University of Utah and the Flux Group.
# #
# {{{EMULAB-LICENSE # {{{EMULAB-LICENSE
# #
...@@ -48,9 +48,6 @@ my $PWD = "/bin/pwd"; ...@@ -48,9 +48,6 @@ my $PWD = "/bin/pwd";
my $PW = "/usr/sbin/pw"; my $PW = "/usr/sbin/pw";
my $PATCH = "/usr/bin/patch"; my $PATCH = "/usr/bin/patch";
my $SSH_KEYGEN = "/usr/bin/ssh-keygen"; my $SSH_KEYGEN = "/usr/bin/ssh-keygen";
my $PKG_INFO = "/usr/sbin/pkg_info";
my $PKG_ADD = "/usr/sbin/pkg_add";
my $PKG_DEL = "/usr/sbin/pkg_delete";
my $TOUCH = "/usr/bin/touch"; my $TOUCH = "/usr/bin/touch";
my $SSH_INIT = "/usr/bin/ssh -1"; my $SSH_INIT = "/usr/bin/ssh -1";
my $SCP_INIT = "/usr/bin/scp -1"; my $SCP_INIT = "/usr/bin/scp -1";
...@@ -287,9 +284,7 @@ Phase "dirs", "Setting directory permissions", sub { ...@@ -287,9 +284,7 @@ Phase "dirs", "Setting directory permissions", sub {
}; };
Phase "ports", "Installing ports", sub { Phase "ports", "Installing ports", sub {
if (!ExecQuiet("$PKG_INFO -e $PORTNAME")) { DoneIfPackageInstalled($PORTNAME);
PhaseSkip("Package already installed");
}
Phase "pcopy", "Copying ports into place", sub { Phase "pcopy", "Copying ports into place", sub {
DoneIfExists("$PORTSMISCDIR/emulab-clrhouse"); DoneIfExists("$PORTSMISCDIR/emulab-clrhouse");
ExecQuietFatal("$SH $SRCDIR/ports/ports-install"); ExecQuietFatal("$SH $SRCDIR/ports/ports-install");
...@@ -302,20 +297,16 @@ Phase "ports", "Installing ports", sub { ...@@ -302,20 +297,16 @@ Phase "ports", "Installing ports", sub {
Phase "portfixup", "Fixing up packages", sub { Phase "portfixup", "Fixing up packages", sub {
Phase "rsync", "Looking for rsync", sub { Phase "rsync", "Looking for rsync", sub {
if (!ExecQuiet("$PKG_INFO -x rsync")) { DoneIfPackageInstalled("rsync");
PhaseSkip("rsync already installed");
}
my $pname = GetPackage("rsync", $packagedir); my $pname = GetPackage("rsync", $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname"); AddPackage($pname, $packagedir);
}; };
if ($FBSD_MAJOR == 6) { if ($FBSD_MAJOR == 6) {
# Temporary for template stuff # Temporary for template stuff
Phase "Simple", "Looking for Simple XML Parser", sub { Phase "Simple", "Looking for Simple XML Parser", sub {
if (!ExecQuiet("$PKG_INFO -x p5-XML-Simple")) { DoneIfPackageInstalled("p5-XML-Simple");
PhaseSkip("p5-XML-Simple already installed");
}
my $pname = GetPackage("p5-XML-Simple", $packagedir); my $pname = GetPackage("p5-XML-Simple", $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname"); AddPackage($pname, $packagedir);
}; };
} }
}; };
...@@ -324,10 +315,11 @@ Phase "patches", "Applying patches", sub { ...@@ -324,10 +315,11 @@ Phase "patches", "Applying patches", sub {
Phase "m2cryptopatch", "Patching m2crypto", sub { Phase "m2cryptopatch", "Patching m2crypto", sub {
my $patchfile = $M2CRYPTO_PATCH; my $patchfile = $M2CRYPTO_PATCH;
if (ExecQuiet("$PKG_INFO -I -x m2crypto | fgrep -q -s '0.17'") == 0) { my $pkg = InstalledPackage("m2crypto", 0);
if ($pkg && $pkg =~ /0\.17/) {
$patchfile = "${patchfile}-0.17"; $patchfile = "${patchfile}-0.17";
} }
elsif (ExecQuiet("$PKG_INFO -I -x m2crypto | fgrep -q -s '0.13'") == 0) { elsif ($pkg && $pkg =~ /0\.13/) {
$patchfile = "${patchfile}-0.13"; $patchfile = "${patchfile}-0.13";
} }
if (!ExecQuiet("$PATCH -C -f -l -R -p0 -i $patchfile")) { if (!ExecQuiet("$PATCH -C -f -l -R -p0 -i $patchfile")) {
......
...@@ -64,7 +64,11 @@ $BOSS_PORT = "emulab-boss-1.8"; ...@@ -64,7 +64,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 > 9 || ($FBSD_MAJOR == 9 && $FBSD_MINOR > 1)) { if ($FBSD_MAJOR > 9) {
$BOSS_PORT = "emulab-boss-6.0";
$OPS_PORT = "emulab-ops-6.0";
$FS_PORT = "emulab-fs-6.0";
} elsif ($FBSD_MAJOR == 9 && $FBSD_MINOR > 1) {
$BOSS_PORT = "emulab-boss-5.1"; $BOSS_PORT = "emulab-boss-5.1";
$OPS_PORT = "emulab-ops-5.1"; $OPS_PORT = "emulab-ops-5.1";
$FS_PORT = "emulab-fs-5.1"; $FS_PORT = "emulab-fs-5.1";
...@@ -129,7 +133,10 @@ $SELFLOAD_PATCH = "$main::TOP_SRCDIR/patches/SelfLoader.patch"; ...@@ -129,7 +133,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 > 8 || ($FBSD_MAJOR == 8 && $FBSD_MINOR > 2)) { if ($FBSD_MAJOR > 9) {
$PYM2_PKG = "py27-m2crypto-0.21.1_1";
$PY_VER = "python2.7";
} elsif ($FBSD_MAJOR > 8 || ($FBSD_MAJOR == 8 && $FBSD_MINOR > 2)) {
$PYM2_PKG = "py27-m2crypto-0.21.1"; $PYM2_PKG = "py27-m2crypto-0.21.1";
$PY_VER = "python2.7"; $PY_VER = "python2.7";
} elsif ($FBSD_MAJOR > 7 || ($FBSD_MAJOR == 7 && $FBSD_MINOR > 2)) { } elsif ($FBSD_MAJOR > 7 || ($FBSD_MAJOR == 7 && $FBSD_MINOR > 2)) {
...@@ -211,9 +218,6 @@ $PATCH = "/usr/bin/patch"; ...@@ -211,9 +218,6 @@ $PATCH = "/usr/bin/patch";
$CAT = "/bin/cat"; $CAT = "/bin/cat";
$NEWALIASES = "/usr/bin/newaliases"; $NEWALIASES = "/usr/bin/newaliases";
$SH = "/bin/sh"; $SH = "/bin/sh";
$PKG_ADD = "/usr/sbin/pkg_add";
$PKG_DEL = "/usr/sbin/pkg_delete";
$PKG_INFO = "/usr/sbin/pkg_info";
$PWD = "/bin/pwd"; $PWD = "/bin/pwd";
$CP = "/bin/cp"; $CP = "/bin/cp";
$MV = "/bin/mv"; $MV = "/bin/mv";
...@@ -266,7 +270,6 @@ $RCLOCAL = "/etc/rc.local"; ...@@ -266,7 +270,6 @@ $RCLOCAL = "/etc/rc.local";
$PHP_INI = "/usr/local/etc/php.ini"; $PHP_INI = "/usr/local/etc/php.ini";
$SENDMAIL_CF = "/etc/mail/sendmail.cf"; $SENDMAIL_CF = "/etc/mail/sendmail.cf";
$INETD_CONF = "/etc/inetd.conf"; $INETD_CONF = "/etc/inetd.conf";
$NAMED_PIDFILE = "$VARRUN/named.pid";
$ETCSSH = "/etc/ssh"; $ETCSSH = "/etc/ssh";
$SSH_CONFIG = "$ETCSSH/ssh_config"; $SSH_CONFIG = "$ETCSSH/ssh_config";
$LOADER_CONF = "/boot/loader.conf"; $LOADER_CONF = "/boot/loader.conf";
......
#!/usr/bin/perl -w #!/usr/bin/perl -w
# #
# Copyright (c) 2003-2012 University of Utah and the Flux Group. # Copyright (c) 2003-2014 University of Utah and the Flux Group.
# #
# {{{EMULAB-LICENSE # {{{EMULAB-LICENSE
# #
...@@ -436,10 +436,12 @@ sub DoneIfIdentical($$) { ...@@ -436,10 +436,12 @@ sub DoneIfIdentical($$) {
# #
# Done if package installed. # Done if package installed.
# #
sub DoneIfPackageInstalled($) { sub DoneIfPackageInstalled($;$) {
my ($pname) = @_; my ($pname,$exact) = @_;
my $foo = `$PKG_INFO -x $pname 2>&1`;
if (! $?) { $exact = 0
if (!defined($exact));
if (InstalledPackage($pname, $exact)) {
PhaseSkip("already installed"); PhaseSkip("already installed");
} }
} }
...@@ -781,7 +783,7 @@ sub FetchFileFatal($$) { ...@@ -781,7 +783,7 @@ sub FetchFileFatal($$) {
# Locate the proper version of a package to install by looking # Locate the proper version of a package to install by looking
# at the available package tarballs. # at the available package tarballs.
# #
# Must be called "in phase" since we will PhashFail on errors. # Must be called "in phase" since we will PhaseFail on errors.
# #
sub GetPackage($$) { sub GetPackage($$) {
my ($prefix, $packagedir) = @_; my ($prefix, $packagedir) = @_;
...@@ -789,17 +791,89 @@ sub GetPackage($$) { ...@@ -789,17 +791,89 @@ sub GetPackage($$) {
PhaseFail("Must provide -p (packagedir) argument!") PhaseFail("Must provide -p (packagedir) argument!")
if (!$packagedir); if (!$packagedir);
my $pname = `ls $packagedir/$prefix-*.tbz 2>/dev/null`; my $pname = `ls $packagedir/$prefix-*.txz 2>/dev/null`;
if ($?) { if ($?) {
$pname = `ls $packagedir/$prefix-*.tgz 2>/dev/null`; $pname = `ls $packagedir/$prefix-*.tbz 2>/dev/null`;
PhaseFail("Cannot find $prefix package in $packagedir!") if ($?) {
if ($?); $pname = `ls $packagedir/$prefix-*.tgz 2>/dev/null`;
PhaseFail("Cannot find $prefix package in $packagedir!")
if ($?);
}
} }
chomp($pname); chomp($pname);
return $pname; return $pname;
} }
#
# Return the name of any installed package matching the given regex or exact
# name (if $exact != 0). If there are multiple matches, we warn and return
# the first. Return undef if no match.
#
sub InstalledPackage($$) {
my ($pname, $exact) = @_;
my (@foo, $args);
if (-x "/usr/sbin/pkg_info") {
# note: use extended REs to match new pkg tool
$args = $exact ? "-I" : "-I -X";
@foo = `pkg_info $args $pname 2>/dev/null`;
} elsif (-x "/usr/sbin/pkg") {
$args = $exact ? "" : "-x";
@foo = `pkg info $args $pname 2>/dev/null`;
} else {
PhaseFail("No package tools found!?");
}
if ($? == 0 && @foo > 0) {
if (@foo > 1) {
print STDERR "WARNING: '$pname' matches multiple packages, returning first\n";
}
if ($foo[0] =~ /^(\S+)/) {
return $1;
}
}
return undef;
}
sub AddPackage($$) {
my ($pname, $packagedir) = @_;
if (-x "/usr/sbin/pkg_add") {
ExecQuietFatal("env PKG_PATH=$packagedir pkg_add $pname");
} elsif (-x "/usr/sbin/pkg") {
ExecQuietFatal("pkg add $packagedir/$pname.txz");
} else {
PhaseFail("No package tools found!?");
}
}
sub DelPackage($$$) {
my ($pname, $recursive, $fatal) = @_;
my ($cmd, $args);
$args = "-f";
if (-x "/usr/sbin/pkg_delete") {
$cmd = "pkg_delete";
$args .= " -r"
if ($recursive);
} elsif (-x "/usr/sbin/pkg") {
$cmd = "pkg delete";
$args .= " -y";
$args .= " -R"
if ($recursive);
} else {
PhaseFail("No package tools found!?");
}
$args .= "-x $pname";
if ($fatal) {
ExecQuietFatal("$cmd $args");
} else {
ExecQuiet("$cmd $args");
}
}
# #
# Print out the phase stack that got us here # Print out the phase stack that got us here
# #
......
...@@ -31,8 +31,16 @@ sub Install($$$) ...@@ -31,8 +31,16 @@ sub Install($$$)
if (!$isupdate) { if (!$isupdate) {
# Starting at 6.0 we use the default version of bind, not the port. # Starting at 6.0 we use the default version of bind, not the port.
my $named_control = ($FBSD_MAJOR < 6 ? # Starting at 10.0 we are back to a port!
"$RCDIR/1.named.sh" : "/etc/rc.d/named"); my $named_control = "/etc/rc.d/named";
if ($FBSD_MAJOR < 6 && -e "$RCDIR/1.named.sh") {
$named_control = "$RCDIR/1.named.sh";
} elsif ($FBSD_MAJOR >= 10 && -e "/usr/local/etc/rc.d/named") {
$named_control = "/usr/local/etc/rc.d/named";
if (-e "/etc/rc.d/named") {
rename("/etc/rc.d/named", "/etc/rc.d/.named.NOPE");
}
}
Phase "stopping", "Stopping named", sub { Phase "stopping", "Stopping named", sub {
if (ExecQuiet("killall -s named")) { if (ExecQuiet("killall -s named")) {
...@@ -53,11 +61,15 @@ sub Install($$$) ...@@ -53,11 +61,15 @@ sub Install($$$)
# script. # script.
# #
if ($FBSD_MAJOR >= 6) { if ($FBSD_MAJOR >= 6) {
unlink($NAMED_PIDFILE) my $pf1 = "$VARRUN/named.pid";
if ( -e "$NAMED_PIDFILE"); my $pf2 = "$VARRUN/named/named.pid";
if (ExecQuiet("$named_control start") && unlink($pf1, $pf2);
! -e "$NAMED_PIDFILE") { if (ExecQuiet("$named_control start")) {
PhaseFail("Unable to start named: "); PhaseFail("Unable to start named");
}
sleep 1;
if (! -e $pf1 && ! -e $pf2) {
PhaseFail("Unable to start named");
} }
} else { } else {
ExecQuietFatal("$named_control start"); ExecQuietFatal("$named_control start");
......
...@@ -25,11 +25,12 @@ sub Install($$$) ...@@ -25,11 +25,12 @@ sub Install($$$)
if ($FBSD_MAJOR < 7) { if ($FBSD_MAJOR < 7) {
Phase "m2cryptopatch", "Patching m2crypto", sub { Phase "m2cryptopatch", "Patching m2crypto", sub {
my $patchfile = $M2CRYPTO_PATCH; my $patchfile = $M2CRYPTO_PATCH;
if (ExecQuiet("$PKG_INFO -I -x m2crypto | fgrep -q -s '0.17'") == 0) { my $pkg = InstalledPackage("m2crypto", 0);
if ($pkg && $pkg =~ /0\.17/) {
$patchfile = "${patchfile}-0.17"; $patchfile = "${patchfile}-0.17";
} }
elsif (ExecQuiet("$PKG_INFO -I -x m2crypto | fgrep -q -s '0.13'") == 0) { elsif ($pkg && $pkg =~ /0\.13/) {
$patchfile = "${patchfile}-0.13"; $patchfile = "${patchfile}-0.13";
} }
if (!ExecQuiet("$PATCH -C -f -l -R -p0 -i $patchfile")) { if (!ExecQuiet("$PATCH -C -f -l -R -p0 -i $patchfile")) {
......
...@@ -15,44 +15,38 @@ sub Install($$$) ...@@ -15,44 +15,38 @@ sub Install($$$)
Phase "portfixup", "Fixing up packages", sub { Phase "portfixup", "Fixing up packages", sub {
Phase "rsync", "Looking for rsync", sub { Phase "rsync", "Looking for rsync", sub {
if (!ExecQuiet("$PKG_INFO -x rsync")) { DoneIfPackageInstalled("rsync");
PhaseSkip("rsync already installed");
}
my $pname = GetPackage("rsync", $packagedir); my $pname = GetPackage("rsync", $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname"); AddPackage($pname, $packagedir);
}; };
if ($FBSD_MAJOR >= 6) { if ($FBSD_MAJOR >= 6) {
# Temporary for template stuff # Temporary for template stuff
Phase "Simple", "Looking for Simple XML Parser", sub { Phase "Simple", "Looking for Simple XML Parser", sub {
if (!ExecQuiet("$PKG_INFO -x p5-XML-Simple")) { DoneIfPackageInstalled("p5-XML-Simple");
PhaseSkip("p5-XML-Simple already installed");
}
my $pname = GetPackage("p5-XML-Simple", $packagedir); my $pname = GetPackage("p5-XML-Simple", $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname"); AddPackage($pname, $packagedir);
}; };
if ($ARCHSUPPORT) { if ($ARCHSUPPORT) {
Phase "Subversion", "Looking for Subversion", sub { Phase "Subversion", "Looking for Subversion", sub {
if (!ExecQuiet("$PKG_INFO -x subversion")) { DoneIfPackageInstalled("subversion");
PhaseSkip("subversion already installed");
}
my $pname; my $pname;
if ($FBSD_MAJOR > 6) { if ($FBSD_MAJOR > 6) {
$pname = GetPackage("py-subversion", $packagedir); $pname = GetPackage("py-subversion", $packagedir);
} else { } else {
$pname = GetPackage("subversion-python", $packagedir); $pname = GetPackage("subversion-python", $packagedir);
} }
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname"); AddPackage($pname, $packagedir);
}; };
} }
} }
if ($WINSUPPORT) { if ($WINSUPPORT) {
Phase "gcc30", "Looking for GCC 3.0 and installing", sub { Phase "gcc30", "Looking for GCC 3.0 and installing", sub {
if ($FBSD_MAJOR > 4 || if ($FBSD_MAJOR > 4) {
!ExecQuiet("$PKG_INFO -x gcc30")) { PhaseSkip("not needed");
PhaseSkip("GCC 3.0 or greater already installed");
} }
DoneIfPackageInstalled("gcc30");
my $pname = GetPackage("gcc30", $packagedir); my $pname = GetPackage("gcc30", $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname"); AddPackage($pname, $packagedir);
}; };
} }
if ($FBSD_MAJOR > 6) { if ($FBSD_MAJOR > 6) {
...@@ -78,20 +72,20 @@ sub Install($$$) ...@@ -78,20 +72,20 @@ sub Install($$$)
my $pydir = "/usr/local/lib/$PY_VER/site-packages"; my $pydir = "/usr/local/lib/$PY_VER/site-packages";
my $egg = `ls -d $pydir/M2Crypto-*-py*-*.egg 2>/dev/null | tail -1`; my $egg = `ls -d $pydir/M2Crypto-*-py*-*.egg 2>/dev/null | tail -1`;
chomp($egg); chomp($egg);
if (! -x $EASYINSTALL) {
PhaseSkip("python easy_install missing");
}
if ($egg eq "") { if ($egg eq "") {
PhaseSkip("egg not found"); PhaseSkip("egg not found");
} }
if (-d "$egg") { if (-d "$egg") {
PhaseSkip("egg already unpacked"); PhaseSkip("egg already unpacked");
} }
if (! -x $EASYINSTALL) {
PhaseSkip("python easy_install missing");
}
# XXX swig must be installed for easyinstall to exit correctly # XXX swig must be installed for easyinstall to exit correctly
Phase "swig", "Installing swig", sub { Phase "swig", "Installing swig", sub {
DoneIfPackageInstalled("swig");