2025-09-26 05:56:28 +00:00
|
|
|
# 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"
|
|
|
|
|
|
2025-10-10 06:10:49 +00:00
|
|
|
groonga_repository = ENV["GROONGA_REPOSITORY"]
|
|
|
|
|
if groonga_repository.nil?
|
|
|
|
|
puts("You need to specify GROONGA_REPOSITORY environment variable " +
|
|
|
|
|
"to push packages to Launchpad")
|
|
|
|
|
else
|
|
|
|
|
require "#{groonga_repository}/packages/launchpad-helper"
|
|
|
|
|
end
|
|
|
|
|
|
2025-09-26 05:56:28 +00:00
|
|
|
require_relative "../helper"
|
|
|
|
|
|
|
|
|
|
class OpenArmCANPackageTask < PackageTask
|
2025-10-10 06:10:49 +00:00
|
|
|
include LaunchpadHelper if Object.const_defined?(:LaunchpadHelper)
|
|
|
|
|
|
2025-09-26 05:56:28 +00:00
|
|
|
def initialize
|
|
|
|
|
super("openarm-can", detect_version, detect_release_time)
|
|
|
|
|
end
|
|
|
|
|
|
2025-10-10 06:10:49 +00:00
|
|
|
def define
|
|
|
|
|
super
|
|
|
|
|
define_ubuntu_tasks if respond_to?(:define_ubuntu_tasks, true)
|
|
|
|
|
end
|
|
|
|
|
|
2025-09-26 05:56:28 +00:00
|
|
|
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
|
|
|
|
|
|
2025-10-10 06:10:32 +00:00
|
|
|
def update_spec
|
|
|
|
|
update_content("fedora/openarm-can.spec") do |content|
|
|
|
|
|
content.gsub!(/^(Version:\s+)[\d.]+$/) do
|
|
|
|
|
"#{$1}#{@version}"
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2025-09-26 05:56:28 +00:00
|
|
|
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
|
2025-10-07 08:00:40 +00:00
|
|
|
ENV["GITHUB_REPOSITORY"] || "enactic/openarm_can"
|
2025-09-26 05:56:28 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def docker_image(os, architecture)
|
2025-10-02 09:36:05 +00:00
|
|
|
"ghcr.io/#{github_repository.gsub("_", "-")}-package:#{super}"
|
2025-09-26 05:56:28 +00:00
|
|
|
end
|
2025-10-10 06:10:49 +00:00
|
|
|
|
|
|
|
|
def dput_configuration_name
|
|
|
|
|
"openarm-ppa"
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def dput_incoming
|
|
|
|
|
"~openarm/main/ubuntu/"
|
|
|
|
|
end
|
2025-09-26 05:56:28 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
task = OpenArmCANPackageTask.new
|
|
|
|
|
task.define
|