1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: Apache-2.0
6 git_root = "#{__dir__}/../.."
7 git_timestamp, git_hash = IO.popen(
8 ["git", "-C", git_root,
9 "log", "-n1", "--first-parent", "--format=%ct:%H",
10 "--", "build/version-at-commit.sh", "sdk/ruby", "sdk/cli"],
12 git_log.readline.chomp.split(":")
15 $stderr.puts("failed to get version information: 'git' not found")
16 exit 69 # EX_UNAVAILABLE
20 $stderr.puts("failed to get version information: 'git log' exited #{$?}")
23 git_timestamp = Time.at(git_timestamp.to_i).utc
24 version = ENV["ARVADOS_BUILDING_VERSION"] || IO.popen(
25 ["#{git_root}/build/version-at-commit.sh", git_hash],
27 ver_out.readline.chomp.encode("utf-8")
29 version = version.sub("~dev", ".dev").sub("~rc", ".rc")
30 arv_dep_version = if dev_index = (version =~ /\.dev/)
31 "~> #{version[...dev_index]}.a"
36 Gem::Specification.new do |s|
37 s.name = 'arvados-cli'
39 s.date = git_timestamp.strftime("%Y-%m-%d")
40 s.summary = "Arvados CLI tools"
41 s.description = "Arvados command line tools, git commit #{git_hash}"
42 s.authors = ["Arvados Authors"]
43 s.email = 'packaging@arvados.org'
45 s.licenses = ['Apache-2.0']
46 s.files = ["bin/arv", "bin/arv-tag", "LICENSE-2.0.txt"]
47 s.executables << "arv"
48 s.executables << "arv-tag"
49 s.required_ruby_version = '>= 2.7.0'
50 s.add_runtime_dependency 'arvados', arv_dep_version
51 # arvados fork of google-api-client gem with old API and new
52 # compatibility fixes, built from ../ruby-google-api-client/
53 s.add_runtime_dependency('arvados-google-api-client', '>= 0.8.7.5', '< 0.8.9')
54 # Rails 7.1.3.x is the last version to support Ruby 2.7.0 in Ubuntu 20.04.
55 # Later 7.1.x releases require Ruby >= 2.7.3:
56 # <https://github.com/rails/rails/issues/54276>
57 s.add_runtime_dependency 'activesupport', '~> 7.1.3.4'
58 s.add_runtime_dependency 'json', '>= 1.7.7', '<3'
59 s.add_runtime_dependency 'optimist', '~> 3.0'
60 s.add_runtime_dependency 'andand', '~> 1.3', '>= 1.3.3'
61 # oj 3.10.9 requires ruby >= 2.4 and arvbox doesn't currently have it because of SSO
62 s.add_runtime_dependency 'oj', '< 3.10.9'
63 s.add_runtime_dependency 'curb', '~> 0.8'
64 s.add_runtime_dependency 'launchy', '< 2.5'