require_relative "packages-groonga-org-package-task"

class GroongaPackageTask < PackagesGroongaOrgPackageTask
  def initialize
    base_version_file = File.join(__dir__,
                                  "..",
                                  "base_version")
    version = File.read(base_version_file).chomp
    super("groonga", version, detect_release_time)
    @archive_name = "groonga-#{version}.tar.gz"
    @original_archive_name = @archive_name
  end

  private
  def define_archive_task
    file @original_archive_name do
      File.symlink("../#{@original_archive_name}",
                   @original_archive_name)
    end
  end

  def apt_targets_default
    [
      "debian-stretch",
      "debian-stretch-i386",
      "debian-buster",
      "debian-buster-i386",
    ]
  end

  def yum_targets_default
    [
      "centos-6",
      "centos-7",
      "centos-8",
    ]
  end
end

task = GroongaPackageTask.new
task.define
