package Cpanel::Easy::OptLib::libxml2;

# cpanel - Cpanel/Easy/OptLib/libxml2.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) = @_;

    my $xml2version = '2.9.7';

    my @command_list;
    push @command_list, [qw( ./configure --prefix=/opt/xml2 --with-python=no )];
    push @command_list, [qw( make )];
    push @command_list, [qw( make install )];

    return {
        'name'         => 'libxml2',       # if missing auto gen from NS
        'install_path' => '/opt/xml2/',    # ensure trailing slash ?
        'itis_up2date' => sub {
            return 0 unless `/opt/xml2/bin/xml2-config --version` =~ m{\Q$xml2version\E}xms;
            return 1;
        },
        'working_path' => 'libxml2-2',
        'command_list' => \@command_list,
    };
}

1;
