package Cpanel::Easy::Apache::Distcache;

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

our $easyconfig = {
    'name'      => 'Distcache',
    'skip'      => 0,
    'ensurepkg' => ['distcache-devel'],
    'url'       => 'http://distcache.sourceforge.net/',
    'dryrun'    => {
        '0' => {
            'name'    => 'Checking for Distcache',
            'command' => sub {
                my ($self) = @_;
                $self->{'__'}{'SKIP'} = !-e '/usr/include/distcache/dc_client.h';
                if ( $self->{'__'}{'SKIP'} ) {
                    return ( 1, 'Distcache headers not available' );
                }
                else {
                    return ( 1, 'Ok' );
                }
            },
        },
    },
    'step' => {
        '0' => {
            'name'    => 'to config options',
            'command' => sub {
                my ($self) = @_;
                $self->add_to_configure( { '--enable-distcache' => '' } );
                return ( 1, 'Ok' );
            },
        },
    },
};

1;
