# Copyright 2025 Enactic, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. require "time" apache_arrow_repository = ENV["APACHE_ARROW_REPOSITORY"] if apache_arrow_repository.nil? raise "Specify APACHE_ARROW_REPOSITORY environment variable" end require "#{apache_arrow_repository}/dev/tasks/linux-packages/package-task" require_relative "../helper" class OpenArmCANPackageTask < PackageTask def initialize super("openarm-can", detect_version, detect_release_time) end private def detect_version Helper.detect_version end def detect_release_time release_time_env = ENV["RELEASE_TIME"] if release_time_env Time.parse(release_time_env).utc else Time.now.utc end end def enable_yum? false end def define_archive_task file @archive_name do if File.exist?("../#{@archive_name}") ln_s("../#{@archive_name}", @archive_name) else download("https://github.com/#{github_repository}/" + "releases/download/#{@version}/#{@archive_name}", @archive_name) end end end def github_repository "enactic/openarm_can" end def docker_image(os, architecture) "ghcr.io/#{github_repository.gsub("_", "-")}-package:#{super}" end end task = OpenArmCANPackageTask.new task.define