use alienfile;

plugin 'Probe::CommandLine' => (
  command => 'gzip',
  args    => [ '--version' ],
  match   => qr/gzip/,
  version => qr/gzip ([0-9\.]+)/,
);

plugin 'Probe::CommandLine' => (
  command        => 'gzip',
  args           => [ '--version' ],
  match_stderr   => qr/gzip/,
  version_stderr => qr/gzip ([0-9\.]+)/,
) if $^O eq 'darwin';

share {

  meta->prop->{out_of_source} = 1;

  plugin Download => (
    url     => 'https://ftp.gnu.org/gnu/gzip/',
    filter  => qr/^gzip-.*\.tar\.xz$/,
    version => qr/([0-9\.]+)/,
  );

  # So.  Gnu Not Understandable apparently
  # does not distribute gzip as a tarball
  # anymore.  So yeah.  You need xz.  
  plugin Extract => 'tar.xz';
  
  plugin 'Build::Autoconf' => ( with_pic => 0 );

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

};
