use alienfile;

plugin 'Probe::CommandLine' => (
	command => 'bc',
);

share {
	start_url 'https://ftp.gnu.org/gnu/bc/';

	plugin 'Download' => (
		filter  => qr/(\d\.)+\d\.tar\.gz$/,
		version => qr/([0-9\.]+)/,
		prefer  => 1,
	);

	plugin 'Extract' => 'tar.gz';

	plugin 'Build::Autoconf';

	build [
		'%{configure}',
		'%{make}',
		'%{make} install',
	];

	after 'gather' => sub {
		my $build = shift;
		$build->runtime_prop->{'command'} = 'bc';
	};
};
