1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.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", "services/login-sync"],
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-login-sync'
39 s.date = git_timestamp.strftime("%Y-%m-%d")
40 s.summary = "Set up local login accounts for Arvados users"
41 s.description = "Creates and updates local login accounts for Arvados users. Built from git commit #{git_hash}"
42 s.authors = ["Arvados Authors"]
43 s.email = 'packaging@arvados.org'
44 s.licenses = ['AGPL-3.0']
45 s.files = ["bin/arvados-login-sync", "agpl-3.0.txt"]
46 s.executables << "arvados-login-sync"
47 s.required_ruby_version = '>= 2.5.0'
48 # The minimum version's 'a' suffix is necessary to enable bundler
49 # to consider 'pre-release' versions. See:
50 # https://github.com/rubygems/bundler/issues/4340
51 s.add_runtime_dependency 'arvados', arv_dep_version
52 s.add_runtime_dependency 'launchy', '< 2.5'
53 # arvados fork of google-api-client gem with old API and new
54 # compatibility fixes, built from ../../sdk/ruby-google-api-client/
55 s.add_runtime_dependency('arvados-google-api-client', '>= 0.8.7.5', '< 0.8.9')