All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

portfix 3.09 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#
# 
#
use strict;
use libinstall;
use installvars;

sub Install($$$)
{
    my ($server, $isupdate, $impotent) = @_;

    # Replace if this script does an update for ip/domain.
    return 0
	if ($isupdate);

    # XXX Temporary. HA HA HA!
    Phase "portfixup", "Fixing up packages", sub {
	Phase "rsync", "Looking for rsync and installing", sub {
19
	    DoneIfPackageInstalled("rsync");
20
	    my $pname = GetPackage("rsync", $packagedir);
21
	    AddPackage($pname, $packagedir);
22 23 24 25 26 27
	};
	if ($WINSUPPORT) {
	    Phase "samba", "Looking for Samba and installing", sub {
		if (!ISFS($server)) {
		    PhaseSkip("Not FS Node");
		}
28
		DoneIfPackageInstalled("samba");
29
		my $pname = GetPackage("samba", $packagedir);
30
		AddPackage($pname, $packagedir);
31 32
	    };
	    Phase "gcc30", "Looking for GCC 3.0 and installing", sub {
33 34
		if ($FBSD_MAJOR > 4) {
		    PhaseSkip("not needed");
35
		}
36
		DoneIfPackageInstalled("gcc30");
37
		my $pname = GetPackage("gcc30", $packagedir);
38
		AddPackage($pname, $packagedir);
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
	    };
	}
	if ($FBSD_MAJOR > 6) {
	    #
	    # What a crock!  First, that the FreeBSD ports system
	    # defaults to installing the zipped .egg files that have
	    # to be unzipped per-user before use.  Second, that it
	    # offers no easy way at package creation to override this.
	    # Third, that there is no easy way that I could find in
	    # the python eggs system to set a global cache directory
	    # into which to unpack all eggs; you have to set
	    # PYTHON_EGG_CACHE in the environment of every script.
	    # Fourth, that the per-user default value might be in an
	    # unwritable location.
	    #
	    # So, I am reduced to manually unpacking all .egg files
	    # into the corresponding .egg directories after the
	    # install!  Since this would totally screw any attempt
	    # to update those packages, I just do it to the one
	    # package that I know will fail otherwise.
	    #
	    Phase "m2crypto-egg", "Unpacking python m2crypto .egg", sub {
		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 ($egg eq "") {
		    PhaseSkip("egg not found");
		}
		if (-d "$egg") {
		    PhaseSkip("egg already unpacked");
		}
70 71 72
		if (! -x $EASYINSTALL) {
		    PhaseSkip("python easy_install missing");
		}
73 74 75 76
		# XXX swig must be installed for easyinstall to exit correctly
		Phase "swig", "Installing swig", sub {
		    DoneIfPackageInstalled("swig");
		    my $pname = GetPackage("swig", $packagedir);
77
		    AddPackage($pname, $packagedir);
78 79 80 81 82 83 84
		};
		ExecQuietFatal("mv $egg /var/tmp/");
		$egg =~ s/$pydir//;
		ExecQuietFatal("$EASYINSTALL -N -H None -Z /var/tmp$egg");
		ExecQuietFatal("mv /var/tmp$egg $pydir/$egg.bak");
	    };
	}
85 86 87 88 89 90 91 92 93 94 95
	if ($FBSD_MAJOR == 9) {
	    #
	    # Ports that were added after the 9.0 packages were made.
	    # As of 05/2014, the 9.0 stuff is still needed on geniracks.
	    #
	    Phase "p5-JSON", "Looking for p5-JSON and installing", sub {
		DoneIfPackageInstalled("p5-JSON");
		my $pname = GetPackage("p5-JSON", $packagedir);
		AddPackage($pname, $packagedir);
	    };
	}
96 97 98 99 100 101 102
    };
    return 0;
}

# Local Variables:
# mode:perl
# End: