# This configuration file is used to update clamav-update oneself automatically.
# And this is NOT a sample. If you want to customize the setting, edit
# /etc/clamav-update-update.conf or ~/.clamav-update-update.conf .

# You can update clamav-update.pl automatically, using clamav-update.pl with
# --config optioin.
#   ex) clamav-update.pl --config /usr/local/clamXav/etc/clamav-update-update.conf

# $Id: clamav-update-update.conf,v 1.10 2008/07/08 16:24:08 okamura Exp $

#### Logging ####
# log destination
#   GLOB destinations
#       \*STDOUT  - standerd output
#       \*STDERR  - standerd error output
#   Syslog destinations
#       'unix'    - unix domain socket
#       ['stream', 'FILE_PATH'] - the file of which path name is FILE_PATH
#       'inet'    - INET socket (either tcp or udp, tried in that order) returned by getservbyname()
#       'tcp'     - tcp socket returned by getservbyname()
#       'udp'     - udp socket returned by getservbyname()
#       'console' - console
#$Setting{logging}->{setlogsock} = \*STDERR;

# log level
#   'emerg'   - A panic condition.
#   'alert'   - A condition that should be corrected immediately.
#   'crit'    - Critical conditions.
#   'err'     - Errors.
#   'warning' - Warning messages.
#   'notice'  - Conditions that are not error conditions, but should possibly be
#               handled specially.
#   'info'    - Informational messages.
#   'debug'   - Messages that contain information normally of use only when
#               debugging a program.
#$Setting{logging}->{setlogmask} = 'warning';

# log identity (only syslog)
#   'NAME' - NAME is prepended to every message.
#$Setting{logging}->{openlog}->{ident} = 'clamav-update';

# log options (only syslog)
#   ['OPTION1', 'OPTION2' ...] or [qw(OPTION1 OPTION2 ...)]
#   ndelay - Open the connection to syslogd(8) immediately.
#   perror - Write the message to standard error output as well to the system log.
#   pid    - Log the process id with each message.
#$Setting{logging}->{openlog}->{logopt} = [qw()];

# log facility (only syslog)
#   'console' - Messages written to /dev/console by the kernel console output
#               driver.
#   'daemon'  - System daemons, such as routed(8), that are not provided for
#               explicitly by other facilities.
#   'mail'    - The mail system.
#   'news'    - The network news system.
#   'user'    - Messages generated by random user processes.
#   'local1'  - for other purpose.
#   'local2'  - for other purpose.
#   'local3'  - for other purpose.
#   'local4'  - for other purpose.
#   'local5'  - for other purpose.
#   'local6'  - for other purpose.
#   'local7'  - for other purpose.
#$Setting{logging}->{openlog}->{facility} = 'local6';


#### Getting Version Method ####
# latest version
#   command to get
$Setting{version}->{latest}->{command} = [qw(curl --silent --location http://clamav-update.sourceforge.jp/release/clamav-update-2/version.txt)];

#   the regular expression that is applied to command output
$Setting{version}->{latest}->{regexp} = qr/^(\d+(?:\.\d+)*)\s*$/;

# current version
#   command to get
$Setting{version}->{current}->{command} = [qw(clamav-update.pl --version)];

#   the regular expression that is applied to command output
$Setting{version}->{current}->{regexp} = qr/^(?s-im)clamav-update\.pl v(\d+(?:\.\d+)*)\s+.*$/;

# version string compare function
#$Setting{version}->{compare} = sub {
#   my  ($a, $b) = @_;
#   my  @a = reverse(split(/\./, $a));
#   my  @b = reverse(split(/\./, $b));
#
#   while (0 < scalar(@a) and 0 < scalar(@b)) {
#       $a = pop @a;
#       $b = pop @b;
#       return -1   if ($a < $b);
#       return  1   if ($a > $b);
#   }
#   return  1   if (0 < scalar(@a));
#   return -1   if (0 < scalar(@b));
#   return  0;
#};


#### Environment Variables ####
#   $Setting{environment}->{VARNAME} = 'VALUE';
# PATH
#   for ClamXav user
#$Setting{environment}->{PATH} = '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/clamXav/bin';
#   for the other user
#$Setting{environment}->{PATH} = '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin';


#### Options ####
# These settings will be overwrited with command line options.
# download from
#   'http://osdn.dl.sourceforge.jp/clamav-update'       - Tokyo Japan: OSDN Japan
#   'http://keihanna.dl.sourceforge.jp/clamav-update'   - Keihanna Japan: Kansai Science City Internet Community
#   'http://globalbase.dl.sourceforge.jp/clamav-update' - Osaka Japan: GLOBALBASE
#   'http://jaist.dl.sourceforge.jp/clamav-update'      - Ishikawa Japan: Japan Advanced Institute of Science and Technology
$Setting{option}->{src} = 'http://osdn.dl.sourceforge.jp/clamav-update';

#   download to
#$Setting{option}->{dst} = tempdir(CLEANUP => 1);

#   package name
$Setting{option}->{name} = 'clamav-update';

#   archive file extention
#$Setting{option}->{ext} = 'tar.gz';

#   force install
#$Setting{option}->{force} = 0;

#	update limit
#		version supremum
$Setting{option}->{limit}->{version} = '3';

#		phase name for limited action
#$Setting{option}->{limit}->{action} = undef;


#### Update Phases Specification ####
# phases sequence
$Setting{phase}->{sequence} = [qw(download extract install)];

# custom phase specifier
#   for ClamXav user
$Setting{phase}->{specifier} = \&PhaseSpecifier4ClamavUpdate4ClamXav;
#	for the other user
#$Setting{phase}->{specifier} = \&PhaseSpecifier4ClamavUpdate;


#### Load Your Custom Settings ####
# /etc/clamav-update-update.conf - system wide settings.
# ~/.clamav-update-update.conf   - personal settings.
if (-f '/etc/clamav-update-update.conf') {
	Log 'notice', 'Loading: %s', '/etc/clamav-update-update.conf';
	require '/etc/clamav-update-update.conf';
}
unless (exists $ENV{HOME}) {
	my	@ent = getpwuid( $> );

	$ENV{HOME} = $ent[7];
}
if (-f "$ENV{HOME}/.clamav-update-update.conf") {
	Log 'notice', 'Loading: %s', "$ENV{HOME}/.clamav-update-update.conf";
	require "$ENV{HOME}/.clamav-update-update.conf";
}


#### DO NOT EDIT ####
1;
