# This configuration file is a sample for ClamdOmitScan.
# You can update ClamdOmitScan automatically, using clamav-update.pl with
# --config optioin.
#   ex) clamav-update.pl --config /usr/local/etc/ClamdOmitScan-update.conf

# $Id: ClamdOmitScan-update.conf,v 1.2 2009/04/25 00:09:15 okamura Exp $

#### Getting Version Method ####
# latest version
#   command to get
$Setting{version}->{latest}->{command} = [qw(curl --silent --location http://clamav-update.sourceforge.jp/release/ClamdOmitScan/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(ClamdOmitScan.pl --version)];

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


#### Environment Variables ####
#   $Setting{environment}->{VARNAME} = 'VALUE';
# PATH
$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://qgpop.dl.sourceforge.jp/clamav-update'
#       Fukuoka Japan: Kyushu GigaPOP Project
$Setting{option}->{src} = 'http://osdn.dl.sourceforge.jp/clamav-update';

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


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

# custom phase specifier
$Setting{phase}->{specifier} = sub {
	PhaseSpecifier4General();
	delete $Phase{build};

	$Phase{download}->{method} = [
		sub {
			my	$releaseID;
	
			$releaseID = ReadCommandResult(qw(curl --silent --location http://clamav-update.sourceforge.jp/release/ClamdOmitScan/release_id.txt));
			return 0	unless (defined($releaseID));
			chomp $releaseID;
			Log 'debug', 'release ID is %s', $releaseID;

			return DoCommand(
				'curl', '--silent', '--location', '-o',
				"$Setting{option}->{dst}/$Setting{option}->{name}-$LatestVersion.$Setting{option}->{ext}",
				"$Setting{option}->{src}/$releaseID/$Setting{option}->{name}-$LatestVersion.$Setting{option}->{ext}"
			);
		},
	];
};


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