7 1.26 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
#
# Note that all actions *MUST* be idempotent; if this script is run
# again, it should always do the right thing, not break if something
# was already done. See boss-install for lots of example of how to use
# libinstall to help with this.
#
use strict;
use libinstall;

my $APACHECONF = "/usr/local/etc/apache/httpd.conf";

sub InstallUpdate($$)
{
    my ($version, $phase) = @_;

    #
    # If something should run in the pre-install phase.
    #
    if ($phase eq "pre") {
    }
    
    #
    # If something should run in the post-install phase.
    #
    if ($phase eq "post") {
	if ($PGENISUPPORT) {
	    Phase "httpd.conf", "Updating apache config file", sub {
		#
		# This might be a rare case.
		#
		DoneIfIdentical("$TOP_OBJDIR/apache/httpd.conf", $APACHECONF);

		#
		# Check to see if SSLVerifyClient has been set to optional
		#
		PhaseSkip("Already updated")
		    if `grep ' protogeni-wrapper.pl\$' $APACHECONF`;

		BackUpFileFatal($APACHECONF);
		# For impotent mode. 
		DiffFiles("$TOP_OBJDIR/apache/httpd.conf", $APACHECONF);
		ExecQuietFatal("$GMAKE -C $TOP_OBJDIR/apache install");
	    };
	    Phase "httpd", "Restarting apache", sub {
		DoneIfDoesntExist("$VARRUN/httpd.pid");
		ExecQuietFatal("$RCDIR/apache.sh restart");
	    };
	}
    }
    
    return 0;
}
1;