require 'package'

class Perl_xml_sax < Package
  description 'XML::SAX - Simple API for XML'
  homepage 'https://metacpan.org/pod/XML::SAX'
  version '1.02'
  license 'GPL-1+ or Artistic'
  compatibility 'all'
  source_url 'https://cpan.metacpan.org/authors/id/G/GR/GRANTM/XML-SAX-1.02.tar.gz'
  source_sha256 '4506c387043aa6a77b455f00f57409f3720aa7e553495ab2535263b4ed1ea12a'

  binary_url({
    i686: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/perl_xml_sax/1.02_i686/perl_xml_sax-1.02-chromeos-i686.tar.zst',
  x86_64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/perl_xml_sax/1.02_x86_64/perl_xml_sax-1.02-chromeos-x86_64.tar.zst'
  })
  binary_sha256({
    i686: 'b967b46a1d777e550ec9173605cc1ab19f7149fbd3e901d26ade3f05d065e46d',
  x86_64: 'a5c4f62598b738a7846fbb86d3db1ba3ef67fe30cfb34fea90b2d1513794402e'
  })

  depends_on 'perl_xml_sax_base'
  depends_on 'perl_xml_namespacesupport'

  def self.prebuild
    system 'perl', 'Makefile.PL'
    system "sed -i 's,/usr/local,#{CREW_PREFIX},g' Makefile"
  end

  def self.build
    system 'make'
  end

  def self.install
    system 'make', "DESTDIR=#{CREW_DEST_DIR}", 'install'
  end
end
