package Cpanel::Easy::OptLib::xsp;

# cpanel - Cpanel/Easy/OptLib/xsp.pm              Copyright(c) 2014 cPanel, Inc.
#                                                           All rights Reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cpanel license. Unauthorized copying is prohibited

sub path_installed {
    my ($easy_obj) = @_;

    # need to tell this where mono is this way:
    #   local $ENV{'PATH'}   = '/opt/mono/bin:' . $ENV{'PATH'};
    #   return $self->get_path_installed('Cpanel::Easy::OptLib::xsp');

    return {
        'name'         => 'xsp',
        'install_path' => '/opt/mono/',
        'itis_up2date' => sub {
            if ( `/opt/mono/bin/xsp --version` =~ m{ 2 [.] 6 [.] 5}xms ) {
                my $mono_mtime = ( stat('/opt/mono/bin/mono') )[9];
                my $xsp_mtime  = ( stat('/opt/mono/bin/xsp') )[9];
                return $xsp_mtime > $mono_mtime;
            }
            return 0;
        },
        'working_path' => 'xsp-2.6.5',
        'command_list' => [ [qw(./configure --prefix=/opt/mono)], ['make'], [ 'make', 'install' ], ],
    };
}

1;
