repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/highline-gem.rb | config/software/highline-gem.rb | #
# Copyright 2014 Chef Software, 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.
#
# expeditor/ignore: deprecated 2021-04
name "highline-gem"
default_version "1.6.21"
license "Ruby"
license_file "https://raw.githubusercontent.com/JEG2/highline/master/LICENSE"
license_file "http://www.ruby-lang.org/en/LICENSE.txt"
# highline does not have any dependencies. We only install it from
# rubygems here.
skip_transitive_dependency_licensing true
dependency "ruby"
build do
env = with_standard_compiler_flags(with_embedded_path)
gem "install highline" \
" --version '#{version}'" \
" --bindir '#{install_dir}/embedded/bin'" \
" --no-document", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/util-macros.rb | config/software/util-macros.rb | #
# Copyright 2014 Chef Software, 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.
#
name "util-macros"
default_version "1.19.3"
# version_list: url=https://www.x.org/releases/individual/util/ filter=util-macros-*.tar.gz
version("1.19.3") { source sha256: "624bb6c3a4613d18114a7e3849a3d70f2d7af9dc6eabeaba98060d87e3aef35b" }
version("1.19.0") { source sha256: "0d4df51b29023daf2f63aebf3ebc638ea88efedfd560ab5866741ab3f92acaa1" }
version("1.18.0") { source sha256: "cf4ab0e17bfee0f7689cdcff8c7d7f164c9a710f851f91c488f5cd81fac9c0aa" }
source url: "https://www.x.org/releases/individual/util/util-macros-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
license "MIT"
license_file "COPYING"
skip_transitive_dependency_licensing true
relative_path "util-macros-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
command "./configure" \
" --prefix=#{install_dir}/embedded", env: env
make "-j #{workers}", env: env
make "-j #{workers} install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/popt.rb | config/software/popt.rb | #
# Copyright 2012-2014 Chef Software, 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.
#
name "popt"
default_version "1.19"
license "MIT"
license_file "COPYING"
skip_transitive_dependency_licensing true
dependency "config_guess"
# versions_list: https://github.com/rpm-software-management/popt/releases filter=*.tar.gz
version("1.19") { source sha256: "c25a4838fc8e4c1c8aacb8bd620edb3084a3d63bf8987fdad3ca2758c63240f9" }
version("1.18") { source sha256: "5159bc03a20b28ce363aa96765f37df99ea4d8850b1ece17d1e6ad5c24fdc5d1" }
version("1.16") { source sha256: "e728ed296fe9f069a0e005003c3d6b2dde3d9cad453422a10d6558616d304cc8" }
if version == "1.16"
source url: "https://src.fedoraproject.org/repo/pkgs/popt/popt-#{version}.tar.gz/3743beefa3dd6247a73f8f7a32c14c33/popt-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
else
source url: "http://ftp.rpm.org/popt/releases/popt-1.x/popt-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
end
relative_path "popt-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
update_config_guess
if version == "1.7.10.1" && (ppc64? || ppc64le?)
patch source: "v1.7.10.1.ppc64le-configure.patch", plevel: 1
end
# --disable-nls => Disable localization support.
command "./configure" \
" --prefix=#{install_dir}/embedded" \
" --disable-nls", env: env
make "-j #{workers}", env: env
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/ruby-windows-devkit.rb | config/software/ruby-windows-devkit.rb | #
# Copyright 2012-2014 Chef Software, 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.
#
name "ruby-windows-devkit"
default_version "4.7.2-20130224"
license "BSD-3-Clause"
license_file "https://raw.githubusercontent.com/oneclick/rubyinstaller/master/LICENSE.txt"
skip_transitive_dependency_licensing true
if windows_arch_i386?
version "4.5.2-20111229-1559" do
source url: "https://github.com/oneclick/rubyinstaller/releases/download/DevKit-tdm-32-4.5.2/DevKit-tdm-32-#{version}-sfx.exe",
sha256: "6c3af5487dafda56808baf76edd262b2020b1b25ab86aabf972629f4a6a54491"
end
version "4.7.2-20130224" do
source url: "https://github.com/oneclick/rubyinstaller/releases/download/devkit-4.7.2/DevKit-mingw64-32-#{version}-1151-sfx.exe",
sha256: "61a06b5da06dd94343e591163ac0d43c544e9cd4df770f01275645b268b44dc7"
end
else
version "4.7.2-20130224" do
source url: "https://github.com/oneclick/rubyinstaller/releases/download/devkit-4.7.2/DevKit-mingw64-64-#{version}-1432-sfx.exe",
sha256: "2ada04c7234199126c0f34f6ea7163a8f8dccb1e15814af175a189f6ac48b8ac"
end
end
build do
env = with_standard_compiler_flags(with_embedded_path)
embedded_dir = "#{install_dir}/embedded"
command "#{project_file} -y -o#{windows_safe_path(embedded_dir)}", env: env
command "echo - #{install_dir}/embedded > config.yml", cwd: embedded_dir
ruby "dk.rb install", env: env, cwd: embedded_dir
# Normally we would symlink the required unix tools.
# However with the introduction of git-cache to speed up omnibus builds,
# we can't do that anymore since git on windows doesn't support symlinks.
# https://groups.google.com/forum/#!topic/msysgit/arTTH5GmHRk
# Therefore we copy the tools to the necessary places.
# We need tar for 'knife cookbook site install' to function correctly and
# many gems that ship with native extensions assume tar will be available
# in the PATH.
{
"tar.exe" => "bsdtar.exe",
"libarchive-2.dll" => "libarchive-2.dll",
"libexpat-1.dll" => "libexpat-1.dll",
"liblzma-1.dll" => "liblzma-1.dll",
"libbz2-2.dll" => "libbz2-2.dll",
"libz-1.dll" => "libz-1.dll",
"libssp-0.dll" => "libssp-0.dll",
}.each do |target, to|
copy "#{install_dir}/embedded/mingw/bin/#{to}", "#{install_dir}/bin/#{target}"
copy "#{install_dir}/embedded/bin/x64-msvcrt-ruby300.dll", "#{install_dir}/bin/x64-msvcrt-ruby300.dll"
copy "#{install_dir}/embedded/mingw/include/ansidecl.h", "#{install_dir}/embedded/mingw/x86_64-w64-mingw32/include/ansidecl.h"
end
# IIS 8.5 Server STIG finding V-76717 warns on this file because it ends with
# `.java`. From the file name it presumes it contains Java source code which
# should not be stored on a web server.
#
# https://www.stigviewer.com/stig/iis_8.5_server/2019-01-08/finding/V-76717
#
# Searching GitHub for software that may use this functionality with the
# the following keywords presented no interesting results
# - %language java extension:.y
# - bison "-L java"
# - bison "--language java"
#
# It is highly unlikely that a user would try to use our compiler stack on a
# Windows system to compile a Java program that used bison.
delete "#{install_dir}/embedded/share/bison/lalr1.java"
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/musl.rb | config/software/musl.rb | # Copyright 2012-2018 Chef Software, Inc.
# Copyright 2018 Microsoft
#
# 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.
#######################################################################
# MUSL libc software definition README #
#######################################################################
#
# The musl (pronounced muscle) library is an alternative C library
# to glibc.
#
# One may incorporate the musl linker into their omnibus build
# definitions in order to build universal linux packages which will be
# linked against the embedded musl-libc. As opposed to linking against
# the system glibc that may vary from platform to platform.
#
# This is an easy way to create linux packages that have far greater
# portability across linux platforms than have been traditionally
# produced with omnibus. You may produce one binary artifact, with
# a singular build pipeline, that will run on all supported versions
# of Ubuntu and CentOS. As opposed to running a separate build
# pipeline for each platform and version which you intend to support.
#
# In order to use the musl linker in your project, simply override
# the `CC` environment variable in your project definition(s) so that
# the musl-gcc wrapper takes action to link all the C code in your
# project against the musl-libc libraries. The below snippet will
# need to be invoked before any dependencies in your project that
# compile C code. Note that the musl-gcc wrapper is dependent on
# having a system gcc in-place. This software definition is
# dependent on the gcc location being symlinked, or installed, at
# `/usr/bin/gcc`.
#
# Example project definition override:
#
# if linux?
# ENV['CC'] = "#{install_dir}/embedded/bin/musl-gcc"
# dependency 'musl'
# end
#
# How that works:
#
# 1. Set `CC` equal to the embedded musl-gcc wrapper in project
# definition. e.g. chef-workstation
#
# 2. The musl software definition overrides `CC=/usr/bin/gcc` and
# builds musl-libc and installs in $install_dir/embedded.
# e.g. /opt/chef/embedded/(lib|bin)
#
# 3. Software definition (e.g. ruby) picks up `CC` environment
# variable from project definition and uses the embedded musl-gcc
# wrapper to link the code against the embedded musl libraries.
#
#####################################################################
#
# expeditor/ignore: deprecated 2021-04
name "musl"
default_version "1.2.2"
license "MIT"
license_file "COPYRIGHT"
# versions_list: https://www.musl-libc.org/releases/ filter=*.tar.gz
version("1.2.2") { source sha256: "9b969322012d796dc23dda27a35866034fa67d8fb67e0e2c45c913c3d43219dd" }
version("1.2.1") { source sha256: "68af6e18539f646f9c41a3a2bb25be4a5cfa5a8f65f0bb647fd2bbfdf877e84b" }
version("1.1.22") { source sha256: "8b0941a48d2f980fd7036cfbd24aa1d414f03d9a0652ecbd5ec5c7ff1bee29e3" }
version("1.1.20") { source sha256: "44be8771d0e6c6b5f82dd15662eb2957c9a3173a19a8b49966ac0542bbd40d61" }
version("1.1.19") { source sha256: "db59a8578226b98373f5b27e61f0dd29ad2456f4aa9cec587ba8c24508e4c1d9" }
source url: "https://www.musl-libc.org/releases/musl-#{version}.tar.gz"
relative_path "musl-#{version}"
build do
# The musl definition must be compiled with a system gcc.
# This isn't a self-hosting build definition wherein
# musl compiles itself.
env = with_standard_compiler_flags(with_embedded_path)
env["CC"] = "/usr/bin/gcc"
command "./configure" \
" --prefix=#{install_dir}/embedded" \
" --syslibdir=#{install_dir}/embedded/lib", env: env
make env: env
make "install", env: env
# Ruby compilation requires the linux kernel headers to be in the
# same location as the Libc headers. For this to work correctly
# will need to have a kernel-dev(el) package installed on your
# omnibus builder.
%w{asm asm-generic linux}.each do |d|
copy "/usr/include/#{d}", "#{install_dir}/embedded/include"
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/fakeroot.rb | config/software/fakeroot.rb | #
# Copyright 2016, Chef Software, 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.
#
# expeditor/ignore: deprecated 2021-04
name "fakeroot"
default_version "1.20.2"
version("1.20.2") { source sha256: "7c0a164d19db3efa9e802e0fc7cdfeff70ec6d26cdbdc4338c9c2823c5ea230c" }
license "GPL-3.0"
license_file "COPYING"
source url: "ftp://ftp.debian.org/debian/pool/main/f/fakeroot/fakeroot_#{version}.orig.tar.bz2"
relative_path "fakeroot-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
configure_command = ["./configure",
"--prefix=#{install_dir}/embedded",
# This bit of magic is so we don't require the libcap library
"ac_cv_func_capset=no"]
command configure_command.join(" "), env: env
make "-j #{workers}", env: env
make "-j #{workers} install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/pkg-config-lite.rb | config/software/pkg-config-lite.rb | #
# Copyright 2013-2014 Chef Software, 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.
#
name "pkg-config-lite"
default_version "0.28-1"
license "GPL-2.0"
license_file "COPYING"
skip_transitive_dependency_licensing true
dependency "config_guess"
# version_list: url=http://downloads.sourceforge.net/project/pkgconfiglite/#{version}/ filter=*.tar.gz
version("0.28-1") { source sha256: "21b76ec4e115ee30f9b3077a2506e48e8b837332ed4d30c9776502e69c6a29e5" }
source url: "https://downloads.sourceforge.net/project/pkgconfiglite/#{version}/pkg-config-lite-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "pkg-config-lite-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
update_config_guess
command "./configure" \
" --prefix=#{install_dir}/embedded" \
" --disable-host-tool" \
" --with-pc-path=#{install_dir}/embedded/bin/pkgconfig", env: env
make "-j #{workers}", env: env
make "-j #{workers} install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/perl-extutils-embed.rb | config/software/perl-extutils-embed.rb | #
# Copyright 2014 Chef Software, 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.
#
# expeditor/ignore: deprecated 2021-04
name "perl-extutils-embed"
default_version "1.14"
dependency "perl"
source url: "http://search.cpan.org/CPAN/authors/id/D/DO/DOUGM/ExtUtils-Embed-#{version}.tar.gz",
md5: "b2a2c26a18bca3ce69f8a0b1b54a0105"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "ExtUtils-Embed-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path).merge(
"INSTALL_BASE" => "#{install_dir}/embedded"
)
command "#{install_dir}/embedded/bin/perl Makefile.PL", env: env
make env: env
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/mysql2.rb | config/software/mysql2.rb | #
# Copyright 2012-2014 Chef Software, 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.
#
#
# Enable MySQL support by adding the following to '/etc/chef-server/chef-server.rb':
#
# database_type = 'mysql'
# postgresql['enable'] = false
# mysql['enable'] = true
# mysql['destructive_migrate'] = true
#
# Then run 'chef-server-ctl reconfigure'
#
versions_to_install = ["0.3.6", "0.3.7"]
name "mysql2"
default_version versions_to_install.join("-")
dependency "ruby"
build do
env = with_standard_compiler_flags(with_embedded_path)
cache_path = "#{install_dir}/embedded/service/gem/ruby/1.9.1/cache"
gem "install rake-compiler" \
" --version '0.8.3'" \
" --no-document", env: env
mkdir cache_path
versions_to_install.each do |version|
gem "fetch mysql2" \
" --version '#{version}'", env: env, cwd: cache_path
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/patch.rb | config/software/patch.rb | #
# Copyright 2015-2018 Chef Software, 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.
#
name "patch"
dependency "config_guess"
license "GPL-3.0"
license_file "COPYING"
skip_transitive_dependency_licensing true
default_version "2.7.6"
# version_list: url=https://ftp.gnu.org/gnu/patch/ filter=*.tar.gz
version("2.7.6") { source sha256: "8cf86e00ad3aaa6d26aca30640e86b0e3e1f395ed99f189b06d4c9f74bc58a4e" }
version("2.7.5") { source sha256: "7436f5a19f93c3ca83153ce9c5cbe4847e97c5d956e57a220121e741f6e7968f" }
version("2.7") { source sha256: "59c29f56faa0a924827e6a60c6accd6e2900eae5c6aaa922268c717f06a62048" }
source url: "https://ftp.gnu.org/gnu/patch/patch-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "patch-#{version}"
env = with_standard_compiler_flags(with_embedded_path)
build do
update_config_guess(target: "build-aux")
configure "--disable-xattr", env: env
make "-j #{workers}", env: env
make "-j #{workers} install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/git-windows.rb | config/software/git-windows.rb | #
# Copyright:: Chef Software, 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.
#
# expeditor/ignore: deprecated 2021-04
#
name "git-windows"
default_version "2.33.0"
license "LGPL-2.1"
# the license file does not ship in the portable git package so pull from the source repo
license_file "https://raw.githubusercontent.com/git-for-windows/git/master/LGPL-2.1"
arch_suffix = windows_arch_i386? ? "32" : "64"
# The Git for Windows project includes a build number in their tagging
# scheme and therefore in the URLs for downloaded releases.
# Occasionally, something goes wrong with a build/release and the "real"
# release of a version has a build number other than 1. And so far, the
# release URLs have not followed a consistent pattern for whether and how
# the build number is included.
# This URL pattern has worked for most releases. If a version has multiple
# builds, set the `source url:` again explicitly to the one appropriate for
# that version's release.
source url: "https://github.com/git-for-windows/git/releases/download/v#{version}.windows.1/PortableGit-#{version}-#{arch_suffix}-bit.7z.exe"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/PortableGit-#{version}-#{arch_suffix}-bit.7z.exe",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
if windows_arch_i386?
# version_list: url=https://github.com/git-for-windows/git/releases filter=PortableGit-*-32-bit.7z.exe
version("2.48.1") { source sha256: "63ddbc7ea11ea8a1375f39f45d38f928dbec564360ad12dd11d0d649474063a0" }
version("2.47.0") { source sha256: "b2def285b907ce1d47abd2df8df83df629b768defe08c1fcd4ad91582fc6606b" }
version("2.41.0") { source sha256: "e1360e94cb292862fb023018578a1029022a09278b160f7264c6dc444f65c9ca" }
version("2.33.0") { source sha256: "c3b6f1a8f8c1b5be2175b7190d35926dce07a58294780291326a437ef0694676" }
version("2.31.1") { source sha256: "d6d48e16e3f0ecbc0a45d410ad3ebae15e5618202855ebe72cd9757e4d35b880" }
version("2.30.2") { source sha256: "8b203531c91d3f9075aa3ef1e89b0d6e5d18aa289c3bc485e093c9bfb860a116" }
version("2.29.2") { source sha256: "5e4dc60d3ee143585da03843613bc4d9032b1b6f4d3a2473ef6d9adc8e4c71c0" }
version("2.28.0") { source sha256: "11b854e9246057a22014dbf349adfc160ffa740dba7af0dbd42d642661b2cc7f" }
version("2.27.0") { source sha256: "8cbe1e3b57eb9d02e92cff12089454f2cf090c02958080d62e199ef8764542d3" }
else
# version_list: url=https://github.com/git-for-windows/git/releases filter=PortableGit-*-64-bit.7z.exe
version("2.48.1") { source sha256: "a4335111b3363871cac632be93d7466154d8eb08782ff55103866b67d6722257" }
version("2.47.0") { source sha256: "0b7fcd76902ebde5b4c00ebae597d7f65dff8c3dd0ae59f5059e1aaa3adace87" }
version("2.41.0") { source sha256: "fcbaeffd24fdf435a1f7844825253509136377915e6720aa66aa256ec1f83c30" }
version("2.33.0") { source sha256: "12c10fad2c2db17d9867dbbacff1adc8be50868b793a73d451c2b878914bb32d" }
version("2.31.1") { source sha256: "fce2161a8891c4deefdb8d215ab76498c245072f269843ef1a489c4312baef52" }
version("2.30.2") { source sha256: "f719f248de3dd7ef234331f8da95762594a388f6aa62f4c0260df18068e5a447" }
version("2.29.2") { source sha256: "7d114e81a541536b025313efcdf6feea1e973323f2b8f53995721bfd511139bd" }
version("2.28.0") { source sha256: "0cd682188b76eeb3a5da3a466d4095d2ccd892e07aae5871c45bf8c43cdb3b13" }
version("2.27.0") { source sha256: "0fd2218ba73e07e5a664d06e0ce514edcd241a2de0ba29ceca123e7d36aa8f58" }
end
# The git portable archives come with their own copy of posix related tools
# i.e. msys/basic posix/what-do-you-mean-you-dont-have-bash tools that git
# needs. Surprising nobody who has ever dealt with this on windows, we ship
# our own set of posix libraries and ported tools - the highlights being
# tar.exe, sh.exe, bash.exe, perl.exe etc. Since our tools reside in
# embedded/bin, we cannot simply extract git's bin/ cmd/ and lib directories
# into embedded. So we we land them in embedded/git instead. Git uses a
# strategy similar to ours when it comes to "appbundling" its binaries. It has
# a /bin top level directory and a /cmd directory. The unixy parts of it use
# /bin. The windowsy parts of it use /cmd. If you add /cmd to the path, there
# are tiny shim-executables in there that forward your call to the appropriate
# internal binaries with the path and environment reconfigured correctly.
# Unfortunately, they work based on relative directories... so /cmd/git.exe
# looks for ../bin/git. If we want delivery-cli or other applications to access
# git binaries without having to add yet another directory to the system path,
# we need to add our own shims (or shim-shims as I like to call them). These
# are .bat files in embedded/bin - one for each binary in git's /cmd directory -
# that simply call out to git's shim binaries.
build do
env = with_standard_compiler_flags(with_embedded_path)
source_7z = "#{project_dir}/PortableGit-#{version}-#{arch_suffix}-bit.7z.exe"
destination = "#{install_dir}/embedded/git"
command "#{source_7z} -y"
sync "PortableGit", "#{windows_safe_path(destination)}", env: env
block "Create bat files to point to executables under embedded/git/cmd" do
Dir.glob("#{destination}/cmd/*") do |git_bin|
ext = File.extname(git_bin)
base = File.basename(git_bin, ext)
File.open("#{install_dir}/embedded/bin/#{base}.bat", "w") do |f|
f.puts "@ECHO OFF"
f.print "START \"\" " if %w{gitk git-gui}.include?(base.downcase)
f.puts "\"%~dp0..\\git\\cmd\\#{base}#{ext}\" %*"
end
end
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/libzmq.rb | config/software/libzmq.rb | #
# Copyright:: Chef Software 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.
#
# We use the version in util-linux, and only build the libuuid subdirectory
#
# expeditor/ignore: deprecated 2021-04
name "libzmq"
default_version "4.0.7"
license "LGPL-3.0"
license_file "COPYING"
license_file "COPYING.LESSER"
skip_transitive_dependency_licensing true
version "4.2.2" do
source md5: "52499909b29604c1e47a86f1cb6a9115"
dependency "libsodium"
end
version "4.1.4" do
source md5: "a611ecc93fffeb6d058c0e6edf4ad4fb"
dependency "libsodium"
end
# Last stable version for "4.0.x"
version "4.0.7" do
source sha256: "e00b2967e074990d0538361cc79084a0a92892df2c6e7585da34e4c61ee47b03"
dependency "libsodium"
end
version "4.0.5" do
source md5: "73c39f5eb01b9d7eaf74a5d899f1d03d"
dependency "libsodium"
end
version "4.0.4" do
source md5: "f3c3defbb5ef6cc000ca65e529fdab3b"
dependency "libsodium"
end
relative_path "zeromq-#{version}"
if version.satisfies?(">= 4.2.0")
source url: "https://github.com/zeromq/libzmq/releases/download/v#{version}/zeromq-#{version}.tar.gz"
else
source url: "http://download.zeromq.org/zeromq-#{version}.tar.gz"
end
build do
env = with_standard_compiler_flags(with_embedded_path)
if aix?
# In tcp_connector.hpp the `open` method was getting redefined to open64 because the compiler's `_LARGE_FILES` flag
# is set. We renamed `open` to `openn` to keep it from getting redefined during compilation.
# reference: https://www.ibm.com/support/knowledgecenter/en/ssw_aix_71/com.ibm.aix.genprogc/writing_programsa_access.htm
# reference: https://www.ibm.com/support/knowledgecenter/ssw_aix_71/com.ibm.aix.basetrf1/open.htm
patch source: "zeromq-aix-4.2.2-LARGE_FILES.patch", plevel: 0, env: env
# When trying to run libzmq and request a socket we were seeing failures (resulting in core dumps) around the use of mutexes.
# We eventually narrowed this down to the `atomic_counter.hpp`. This class has a bunch of overrides to support atomic
# operations using system or compiler native features. As a fallback it would use a mutex to perform atomic operations but
# we were seeing that mutex never be initialized. So we added support for the built-in AIX atomic operations fetch_and_add.
patch source: "zeromq-aix-4.2.2-atomic-counter-fetch_and_add.patch", plevel: 0, env: env
end
# If we were building with CMake this would be the default
# and newer versions of libzmq use this as the default.
env["CPPFLAGS"] = "#{env["CPPFLAGS"]} -DFD_SETSIZE=1024" if windows?
# Some test files use inet_pton which is not readily available on windows.
if version.satisfies?(">= 4") && version.satisfies?("< 4.1") && windows?
patch source: "zeromq-4.0.11_mingw_inet_pton.patch", env: env
end
config_command = [
"--with-libsodium",
"--without-documentation",
"--disable-dependency-tracking",
]
configure(*config_command, env: env)
make "-j #{workers}", env: env
make "-j #{workers} install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/logrotate.rb | config/software/logrotate.rb | #
# Copyright 2013-2014 Chef Software, 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.
#
name "logrotate"
default_version "3.21.0"
license "GPL-2.0"
license_file "COPYING"
skip_transitive_dependency_licensing true
dependency "popt"
source url: "https://github.com/logrotate/logrotate/archive/#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
# versions_list: https://github.com/logrotate/logrotate/tags filter=*.tar.gz
version("3.21.0") { source sha256: "7f58d6ab7e4eab3403528a88d3747a91b03e83e866a8fb966551016e0df527bb" }
version("3.20.1") { source sha256: "f37458dee3b4adab6719767ad4b93ff9ec8948755d1148b76f7f4c2c68d3e457" }
version("3.19.0") { source sha256: "7de1796cb99ce4ed21770b5dae0b4e6f81de0b4df310a58a1617d8061b1e0930" }
version("3.18.1") { source sha256: "18e9c9b85dd185e79f097f4e7982bc5b8c137300756a7878e8fa24731f2f8e21" }
version("3.9.2") { source sha256: "2de00c65e23fa9d7909cae6594e550b9abe9a7eb1553669ddeaca92d30f97009" }
relative_path "logrotate-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path).merge(
# Patch allows this to be set manually
"BASEDIR" => "#{install_dir}/embedded"
)
# These EXTRA_* vars allow us to append to the Makefile's hardcoded LDFLAGS
# and CFLAGS
env["EXTRA_LDFLAGS"] = env["LDFLAGS"]
env["EXTRA_CFLAGS"] = env["CFLAGS"]
if version == "3.9.2"
patch source: "logrotate_basedir_override.patch", plevel: 0, env: env
else
command "autoreconf -fiv", env: env
command "./configure --prefix=#{install_dir}/embedded", env: env
end
make "-j #{workers}", env: env
# Yes, this is horrible. Due to how the makefile is structured, we need to
# specify PREFIX, *but not BASEDIR* in order to get this installed into
# +"#{install_dir}/embedded/sbin"+
make "install", env: { "PREFIX" => "#{install_dir}/embedded" }
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/gem-permissions.rb | config/software/gem-permissions.rb | #
# Copyright 2012-2014 Chef Software, 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.
#
#
# Use this software definition to fix the gem-permissions on * nix builds.
#
# expeditor/ignore: logic only
name "gem-permissions"
default_version "0.0.1"
license :project_license
skip_transitive_dependency_licensing true
build do
unless windows?
block "Fix gem permissions" do
FileUtils.chmod_R("a+rX", "#{install_dir}/embedded/lib/ruby/gems/")
rescue Errno::ENOENT
# It is possible that the above method will fail for a variety of reasons, including:
# * there is a symlink to a file that does not exist.
#
# If that happens we "retry" with a slower, but safer approach.
Dir["#{install_dir}/embedded/lib/ruby/gems/**/**"].each do |entry|
FileUtils.chmod("a+rX", entry) if File.exist?(entry)
end
end
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/rbnacl-libsodium.rb | config/software/rbnacl-libsodium.rb | #
# Copyright 2012-2017 Chef Software, 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.
#
# expeditor/ignore: deprecated 2021-04
name "rbnacl-libsodium"
default_version "1.0.11"
relative_path "rbnacl-libsodium"
# versions_list: https://github.com/cryptosphere/rbnacl-libsodium/tags filter=*.tar.gz
source git: "https://github.com/cryptosphere/rbnacl-libsodium.git"
license "MIT"
license_file "LICENSE"
dependency "ruby"
build do
env = with_embedded_path
bundle "config set --local without development_extras", env: env
bundle "install", env: env
bundle "exec rake gem", env: env
delete "pkg/*java*"
gem "install pkg/rbnacl-libsodium-*.gem" \
" --no-document", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/cacerts.rb | config/software/cacerts.rb | #
# Copyright:: Chef Software, 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.
#
name "cacerts"
license "MPL-2.0"
license_file "https://www.mozilla.org/media/MPL/2.0/index.815ca599c9df.txt"
skip_transitive_dependency_licensing true
default_version "2022-10-11"
source url: "https://curl.se/ca/cacert-#{version}.pem"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/cacert-#{version}.pem",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
# versions_list: https://curl.se/docs/caextract.html
version("2022-10-11") { source sha256: "2cff03f9efdaf52626bd1b451d700605dc1ea000c5da56bd0fc59f8f43071040" }
version("2022-07-19") { source sha256: "6ed95025fba2aef0ce7b647607225745624497f876d74ef6ec22b26e73e9de77" }
version("2022-04-26") { source sha256: "08df40e8f528ed283b0e480ba4bcdbfdd2fdcf695a7ada1668243072d80f8b6f" }
version("2022-03-29") { source sha256: "1979e7fe618c51ed1c9df43bba92f977a0d3fe7497ffa2a5e80dfc559a1e5a29" }
version("2022-02-01") { source sha256: "1d9195b76d2ea25c2b5ae9bee52d05075244d78fcd9c58ee0b6fac47d395a5eb" }
version("2021-10-26") { source sha256: "ae31ecb3c6e9ff3154cb7a55f017090448f88482f0e94ac927c0c67a1f33b9cf" }
version("2021-09-30") { source sha256: "f524fc21859b776e18df01a87880efa198112214e13494275dbcbd9bcb71d976" }
relative_path "cacerts-#{version}"
build do
mkdir "#{install_dir}/embedded/ssl/certs"
copy "#{project_dir}/cacert*.pem", "#{install_dir}/embedded/ssl/certs/cacert.pem"
copy "#{project_dir}/cacert*.pem", "#{install_dir}/embedded/ssl/cert.pem" if windows?
# Windows does not support symlinks
unless windows?
link "certs/cacert.pem", "#{install_dir}/embedded/ssl/cert.pem", unchecked: true
block { File.chmod(0644, "#{install_dir}/embedded/ssl/certs/cacert.pem") }
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/libossp-uuid.rb | config/software/libossp-uuid.rb | #
# Copyright 2012-2014 Chef Software, 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.
#
name "libossp-uuid"
default_version "1.6.2"
license "MIT"
license_file "README"
skip_transitive_dependency_licensing true
dependency "config_guess"
# version_list: url=https://www.mirrorservice.org/sites/ftp.ossp.org/pkg/lib/uuid/ filter=*.tar.gz
version("1.6.2") { source sha256: "11a615225baa5f8bb686824423f50e4427acd3f70d394765bdff32801f0fd5b0" }
# ftp on ftp.ossp.org is unavaiable so we must use another mirror site.
source url: "https://www.mirrorservice.org/sites/ftp.ossp.org/pkg/lib/uuid/uuid-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/uuid-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "uuid-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
update_config_guess
command "./configure" \
" --prefix=#{install_dir}/embedded", env: env
make "-j #{workers}", env: env
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/mpc.rb | config/software/mpc.rb | #
# Copyright 2014-2019 Chef Software, 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.
#
# expeditor/ignore: deprecated 2022-12
name "mpc"
default_version "1.3.1"
dependency "gmp"
dependency "mpfr"
license "LGPL-3.0-or-later"
license_file "COPYING.LESSER"
# version_list: url=https://ftp.gnu.org/gnu/mpc/ filter=*.tar.gz
version("1.3.1") { source sha256: "ab642492f5cf882b74aa0cb730cd410a81edcdbec895183ce930e706c1c759b8" }
version("1.2.1") { source sha256: "17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459" }
version("1.1.0") { source sha256: "6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e" }
source url: "https://ftp.gnu.org/gnu/mpc/mpc-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "mpc-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
configure_command = ["./configure",
"--prefix=#{install_dir}/embedded"]
command configure_command.join(" "), env: env
make "-j #{workers}", env: env
make "-j #{workers} install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/go.rb | config/software/go.rb | #
# Copyright 2019 Chef Software, 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.
#
name "go"
default_version "1.19.5"
license "BSD-3-Clause"
license_file "https://raw.githubusercontent.com/golang/go/master/LICENSE"
# Defaults
platform = "linux"
arch = "amd64"
ext = "tar.gz"
if windows?
platform = "windows"
ext = "zip"
# version_list: url=https://golang.org/dl/ filter=*.windows-amd64.zip
version("1.23.12") { source sha256: "07c35866cdd864b81bb6f1cfbf25ac7f87ddc3a976ede1bf5112acbb12dfe6dc" }
version("1.23.9") { source sha256: "16409aa244b672de037389e9e39115cbf82633e5fa0d4db6ec1a9191ca00a1e1" }
version("1.22.5") { source sha256: "59968438b8d90f108fd240d4d2f95b037e59716995f7409e0a322dcb996e9f42" }
version("1.21.5") { source sha256: "bbe603cde7c9dee658f45164b4d06de1eff6e6e6b800100824e7c00d56a9a92f" }
version("1.19.5") { source sha256: "167db91a2e40aeb453d3e59d213ecab06f62e1c4a84d13a06ccda1d999961caa" }
source url: "https://dl.google.com/go/go#{version}.%{platform}-%{arch}.%{ext}" % { platform: platform, arch: arch, ext: ext }
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}#{version}.windows-amd64.zip",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
elsif mac_os_x?
platform = "darwin"
if intel?
arch = "amd64"
# version_list: url=https://golang.org/dl/ filter=*.darwin-amd64.tar.gz
version("1.23.12") { source sha256: "0f6efdc3ffc6f03b230016acca0aef43c229de022d0ff401e7aa4ad4862eca8e" }
version("1.23.9") { source sha256: "50200cba5173100a6e880098cf3b2db4063394beaf7374e9766b6c19bb18012d" }
version("1.22.5") { source sha256: "95d9933cdcf45f211243c42c7705c37353cccd99f27eb4d8e2d1bf2f4165cb50" }
version("1.21.5") { source sha256: "a2e1d5743e896e5fe1e7d96479c0a769254aed18cf216cf8f4c3a2300a9b3923" }
version("1.19.5") { source sha256: "23d22bb6571bbd60197bee8aaa10e702f9802786c2e2ddce5c84527e86b66aa0" }
source url: "https://dl.google.com/go/go#{version}.%{platform}-%{arch}.%{ext}" % { platform: platform, arch: arch, ext: ext }
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}#{version}.darwin-amd64.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
else
arch = "arm64"
# version_list: url=https://golang.org/dl/ filter=*.darwin-arm64.tar.gz
version("1.23.12") { source sha256: "5bfa117e401ae64e7ffb960243c448b535fe007e682a13ff6c7371f4a6f0ccaa" }
version("1.23.9") { source sha256: "2bf624b6399e41248255858b2d61abae2703eecafad39808449951f3f1ab3766" }
version("1.22.5") { source sha256: "4cd1bcb05be03cecb77bccd765785d5ff69d79adf4dd49790471d00c06b41133" }
version("1.21.5") { source sha256: "d0f8ac0c4fb3efc223a833010901d02954e3923cfe2c9a2ff0e4254a777cc9cc" }
source url: "https://dl.google.com/go/go#{version}.%{platform}-%{arch}.%{ext}" % { platform: platform, arch: arch, ext: ext }
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}#{version}.darwin-arm64.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
end
elsif armhf?
arch = "armv6l"
# version_list: url=https://golang.org/dl/ filter=*.linux-armv6l.tar.gz
version("1.23.12") { source sha256: "9704eba01401a3793f54fac162164b9c5d8cc6f3cab5cee72684bb72294d9f41" }
version("1.23.9") { source sha256: "ade33880caacb8919b48767e0957e9880f2cdf634e137402a6f22552504136dd" }
version("1.22.5") { source sha256: "8c4587cf3e63c9aefbcafa92818c4d9d51683af93ea687bf6c7508d6fa36f85e" }
version("1.21.5") { source sha256: "837f4bf4e22fcdf920ffeaa4abf3d02d1314e03725431065f4d44c46a01b42fe" }
version("1.19.5") { source sha256: "ec14f04bdaf4a62bdcf8b55b9b6434cc27c2df7d214d0bb7076a7597283b026a" }
source url: "https://dl.google.com/go/go#{version}.%{platform}-%{arch}.%{ext}" % { platform: platform, arch: arch, ext: ext }
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}#{version}.linux-armv6l.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
elsif arm?
arch = "arm64"
# version_list: url=https://golang.org/dl/ filter=*.linux-arm64.tar.gz
version("1.23.12") { source sha256: "52ce172f96e21da53b1ae9079808560d49b02ac86cecfa457217597f9bc28ab3" }
version("1.23.9") { source sha256: "3dc4dd64bdb0275e3ec65a55ecfc2597009c7c46a1b256eefab2f2172a53a602" }
version("1.22.5") { source sha256: "8d21325bfcf431be3660527c1a39d3d9ad71535fabdf5041c826e44e31642b5a" }
version("1.21.5") { source sha256: "841cced7ecda9b2014f139f5bab5ae31785f35399f236b8b3e75dff2a2978d96" }
version("1.19.5") { source sha256: "fc0aa29c933cec8d76f5435d859aaf42249aa08c74eb2d154689ae44c08d23b3" }
source url: "https://dl.google.com/go/go#{version}.%{platform}-%{arch}.%{ext}" % { platform: platform, arch: arch, ext: ext }
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}#{version}.linux-arm64.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
else
# version_list: url=https://golang.org/dl/ filter=*.linux-amd64.tar.gz
version("1.23.12") { source sha256: "d3847fef834e9db11bf64e3fb34db9c04db14e068eeb064f49af747010454f90" }
version("1.23.9") { source sha256: "de03e45d7a076c06baaa9618d42b3b6a0561125b87f6041c6397680a71e5bb26" }
version("1.22.5") { source sha256: "904b924d435eaea086515bc63235b192ea441bd8c9b198c507e85009e6e4c7f0" }
version("1.21.5") { source sha256: "e2bc0b3e4b64111ec117295c088bde5f00eeed1567999ff77bc859d7df70078e" }
version("1.19.5") { source sha256: "36519702ae2fd573c9869461990ae550c8c0d955cd28d2827a6b159fda81ff95" }
source url: "https://dl.google.com/go/go#{version}.%{platform}-%{arch}.%{ext}" % { platform: platform, arch: arch, ext: ext }
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}#{version}.linux-amd64.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
end
build do
# We do not use 'sync' since we've found multiple errors with other software definitions
mkdir "#{install_dir}/embedded/go"
copy "#{project_dir}/go/*", "#{install_dir}/embedded/go"
mkdir "#{install_dir}/embedded/bin"
%w{go gofmt}.each do |bin|
link "#{install_dir}/embedded/go/bin/#{bin}", "#{install_dir}/embedded/bin/#{bin}"
end
end | ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/openssl.rb | config/software/openssl.rb | #
# Copyright:: Copyright (c) Chef Software 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.
#
name "openssl"
license "OpenSSL"
license_file "LICENSE"
skip_transitive_dependency_licensing true
# Override default version if CI_OPENSSL_VERSION is set (this is used in CI for ruby software testing)
default_version ENV["CI_OPENSSL_VERSION"] || "1.1.1t" # do_not_auto_update
dependency "cacerts"
dependency "openssl-fips" if fips_mode? && !(version.satisfies?(">= 3.0.0"))
# Openssl builds engines as libraries into a special directory. We need to include
# that directory in lib_dirs so omnibus can sign them during macOS deep signing.
lib_dirs lib_dirs.concat(["#{install_dir}/embedded/lib/engines"])
lib_dirs lib_dirs.concat(["#{install_dir}/embedded/lib/engines-1.1"]) if version.start_with?("1.1")
if version.start_with?("3.")
lib_dirs lib_dirs.concat(["#{install_dir}/embedded/lib/engines-3"])
lib_dirs lib_dirs.concat(["#{install_dir}/embedded/lib/ossl-modules"])
end
# 1.0.2u was the last public release of 1.0.2. Subsequent releases come from a support contract with OpenSSL Software Services
if version.satisfies?("< 1.1.0")
source url: "https://s3.amazonaws.com/chef-releng/openssl/openssl-#{version}.tar.gz", extract: :lax_tar
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz", extract: :lax_tar,
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
else
# As of 2020-09-09 even openssl-1.0.0.tar.gz can be downloaded from /source/openssl-VERSION.tar.gz
# However, the latest releases are not in /source/old/VERSION/openssl-VERSION.tar.gz.
# Let's stick with the simpler one for now.
source url: "https://www.openssl.org/source/openssl-#{version}.tar.gz", extract: :lax_tar
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz", extract: :lax_tar,
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
end
version("3.2.4") { source sha256: "b23ad7fd9f73e43ad1767e636040e88ba7c9e5775bfa5618436a0dd2c17c3716" }
version("3.3.3") { source sha256: "712590fd20aaa60ec75d778fe5b810d6b829ca7fb1e530577917a131f9105539" }
version("3.4.1") { source sha256: "002a2d6b30b58bf4bea46c43bdd96365aaf8daa6c428782aa4feee06da197df3" }
version("3.1.2") { source sha256: "a0ce69b8b97ea6a35b96875235aa453b966ba3cba8af2de23657d8b6767d6539" } # FIPS validated
version("3.0.15") { source sha256: "23c666d0edf20f14249b3d8f0368acaee9ab585b09e1de82107c66e1f3ec9533" }
version("3.0.12") { source sha256: "f93c9e8edde5e9166119de31755fc87b4aa34863662f67ddfcba14d0b6b69b61" }
version("3.0.11") { source sha256: "b3425d3bb4a2218d0697eb41f7fc0cdede016ed19ca49d168b78e8d947887f55" }
version("3.0.9") { source sha256: "eb1ab04781474360f77c318ab89d8c5a03abc38e63d65a603cabbf1b00a1dc90" } # FIPS validated
version("3.0.5") { source sha256: "aa7d8d9bef71ad6525c55ba11e5f4397889ce49c2c9349dcea6d3e4f0b024a7a" }
version("3.0.4") { source sha256: "2831843e9a668a0ab478e7020ad63d2d65e51f72977472dc73efcefbafc0c00f" }
version("3.0.3") { source sha256: "ee0078adcef1de5f003c62c80cc96527721609c6f3bb42b7795df31f8b558c0b" }
version("3.0.1") { source sha256: "c311ad853353bce796edad01a862c50a8a587f62e7e2100ef465ab53ec9b06d1" } # only ruby 3.1 supports openssl-3.0.1
version("1.1.1t") { source sha256: "8dee9b24bdb1dcbf0c3d1e9b02fb8f6bf22165e807f45adeb7c9677536859d3b" }
version("1.1.1q") { source sha256: "d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca" }
version("1.1.1p") { source sha256: "bf61b62aaa66c7c7639942a94de4c9ae8280c08f17d4eac2e44644d9fc8ace6f" }
version("1.1.1o") { source sha256: "9384a2b0570dd80358841464677115df785edb941c71211f75076d72fe6b438f" }
version("1.1.1m") { source sha256: "f89199be8b23ca45fc7cb9f1d8d3ee67312318286ad030f5316aca6462db6c96" }
version("1.1.1l") { source sha256: "0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1" }
version("1.1.1w") { source sha256: "cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8" }
version("1.0.2zg") { source sha256: "09f8372eaede77ec8e6945e2d2d8eeb1b91662980cf23fe95f627b377162296c" }
version("1.0.2zb") { source sha256: "b7d8f8c895279caa651e7f3de9a7b87b8dd01a452ca3d9327f45a9ef31d0c518" }
version("1.0.2za") { source sha256: "86ec5d2ecb53839e9ec999db7f8715d0eb7e534d8a1d8688ef25280fbeee2ff8" }
version("1.0.2ze") { source sha256: "796624c593c361c695bd16314bc6f944184f5d2ff87efcf0bfa0545aa84c4d88" }
version("1.0.2zf") { source sha256: "85d2242b7d11a33d5f239f1f34a1ff7eb37431a554b7df99c52c646b70b14b2e" }
version("1.0.2zi") { source sha256: "80b6c07995fc92456e31c61cf1b2a18f75e314063189bb183af6ae66d0261d84" }
relative_path "openssl-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
if aix?
env["M4"] = "/opt/freeware/bin/m4"
elsif mac_os_x? && arm?
env["CFLAGS"] << " -Qunused-arguments"
elsif windows?
# XXX: OpenSSL explicitly sets -march=i486 and expects that to be honored.
# It has OPENSSL_IA32_SSE2 controlling whether it emits optimized SSE2 code
# and the 32-bit calling convention involving XMM registers is... vague.
# Do not enable SSE2 generally because the hand optimized assembly will
# overwrite registers that mingw expects to get preserved.
env["CFLAGS"] = "-I#{install_dir}/embedded/include"
env["CPPFLAGS"] = env["CFLAGS"]
env["CXXFLAGS"] = env["CFLAGS"]
end
configure_args = [
"--prefix=#{install_dir}/embedded",
"no-unit-test",
"no-comp",
"no-idea",
"no-mdc2",
"no-rc5",
"no-ssl2",
"no-ssl3",
"no-zlib",
"shared",
]
configure_args += ["--libdir=#{install_dir}/embedded/lib"] if version.satisfies?(">=3.0.1")
# https://www.openssl.org/blog/blog/2021/09/13/LetsEncryptRootCertExpire/
configure_args += [ "-DOPENSSL_TRUSTED_FIRST_DEFAULT" ] if version.satisfies?(">= 1.0.2zb") && version.satisfies?("< 1.1.0")
if version.satisfies?("< 3.0.0")
configure_args += ["--with-fipsdir=#{install_dir}/embedded", "fips"] if fips_mode?
else
configure_args += ["enable-fips"] if fips_mode?
end
configure_cmd =
if aix?
"perl ./Configure aix64-cc"
elsif mac_os_x?
intel? ? "./Configure darwin64-x86_64-cc" : "./Configure darwin64-arm64-cc no-asm"
elsif smartos?
"/bin/bash ./Configure solaris64-x86_64-gcc -static-libgcc"
elsif omnios?
"/bin/bash ./Configure solaris-x86-gcc"
elsif solaris2?
platform = sparc? ? "solaris64-sparcv9-gcc" : "solaris64-x86_64-gcc"
if version.satisfies?("< 1.1.0")
"/bin/bash ./Configure #{platform} -static-libgcc"
else
"./Configure #{platform} -static-libgcc"
end
elsif windows?
platform = "mingw64"
"perl.exe ./Configure #{platform}"
else
prefix =
if linux? && ppc64?
"./Configure linux-ppc64"
elsif linux? && s390x?
# With gcc > 4.3 on s390x there is an error building
# with inline asm enabled
"./Configure linux64-s390x -DOPENSSL_NO_INLINE_ASM"
else
"./config"
end
"#{prefix} disable-gost"
end
patch_env = if aix?
# This enables omnibus to use 'makedepend'
# from fileset 'X11.adt.imake' (AIX install media)
env["PATH"] = "/usr/lpp/X11/bin:#{ENV["PATH"]}"
penv = env.dup
penv["PATH"] = "/opt/freeware/bin:#{env["PATH"]}"
penv
else
env
end
if version.start_with? "1.0"
patch source: "openssl-1.0.1f-do-not-build-docs.patch", env: patch_env
elsif version.start_with? "1.1"
patch source: "openssl-1.1.0f-do-not-install-docs.patch", env: patch_env
elsif version.start_with?("3.0") || version.start_with?("3.1")
patch source: "openssl-3.0.1-do-not-install-docs.patch", env: patch_env
# Some of the algorithms which are being used are deprecated in OpenSSL3 and moved to legacy provider.
# We need those algorithms for the working of chef-workstation and other packages.
# This patch will enable the legacy providers!
configure_args << "enable-legacy"
patch source: "openssl-3.0.0-enable-legacy-provider.patch", env: patch_env
else
patch source: "openssl-3.2.4-do-not-install-docs.patch", env: patch_env
configure_args << "enable-legacy"
patch source: "openssl-3.2.4-enable-legacy-provider.patch", env: patch_env
end
if version.start_with?("1.0.2") && mac_os_x? && arm?
patch source: "openssl-1.0.2x-darwin-arm64.patch"
end
if version.start_with?("1.0.2") && windows?
# Patch Makefile.org to update the compiler flags/options table for mingw.
patch source: "openssl-1.0.1q-fix-compiler-flags-table-for-msys.patch", env: env
end
# Out of abundance of caution, we put the feature flags first and then
# the crazy platform specific compiler flags at the end.
configure_args << env["CFLAGS"]
configure_command = configure_args.unshift(configure_cmd).join(" ")
command configure_command, env: env, in_msys_bash: true
if version.start_with?("1.0.2") && windows?
patch source: "openssl-1.0.1j-windows-relocate-dll.patch", env: env
end
make "depend", env: env
# make -j N on openssl is not reliable
make env: env
if aix?
# We have to sudo this because you can't actually run slibclean without being root.
# Something in openssl changed in the build process so now it loads the libcrypto
# and libssl libraries into AIX's shared library space during the first part of the
# compile. This means we need to clear the space since it's not being used and we
# can't install the library that is already in use. Ideally we would patch openssl
# to make this not be an issue.
# Bug Ref: http://rt.openssl.org/Ticket/Display.html?id=2986&user=guest&pass=guest
command "sudo /usr/sbin/slibclean", env: env
end
make "install", env: env
if fips_mode? && version.satisfies?(">= 3.0.0")
openssl_fips_version = project.overrides.dig(:openssl, :fips_version) || "3.0.9"
# Downloading the openssl-3.0.9.tar.gz file and extracting it
command "wget https://www.openssl.org/source/openssl-#{openssl_fips_version}.tar.gz"
command "tar -xf openssl-#{openssl_fips_version}.tar.gz"
# Configuring the fips provider
if windows?
platform = windows_arch_i386? ? "mingw" : "mingw64"
command "cd openssl-#{openssl_fips_version} && perl.exe Configure #{platform} enable-fips"
else
command "cd openssl-#{openssl_fips_version} && ./Configure enable-fips"
end
# Building the fips provider
command "cd openssl-#{openssl_fips_version} && make"
fips_provider_path = "#{install_dir}/embedded/lib/ossl-modules/fips.#{windows? ? "dll" : "so"}"
fips_cnf_file = "#{install_dir}/embedded/ssl/fipsmodule.cnf"
# Running the `openssl fipsinstall -out fipsmodule.cnf -module fips.so` command
command "#{install_dir}/embedded/bin/openssl fipsinstall -out #{fips_cnf_file} -module #{fips_provider_path}"
# Copying the fips provider and fipsmodule.cnf file to the embedded directory
command "cp openssl-#{openssl_fips_version}/providers/fips.#{windows? ? "dll" : "so"} #{install_dir}/embedded/lib/ossl-modules/"
command "cp openssl-#{openssl_fips_version}/providers/fipsmodule.cnf #{install_dir}/embedded/ssl/"
# Updating the openssl.cnf file to enable the fips provider
command "sed -i -e 's|# .include fipsmodule.cnf|.include #{fips_cnf_file}|g' #{install_dir}/embedded/ssl/openssl.cnf"
command "sed -i -e 's|# fips = fips_sect|fips = fips_sect|g' #{install_dir}/embedded/ssl/openssl.cnf"
command "#{install_dir}/embedded/bin/openssl list -providers"
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/rubygems.rb | config/software/rubygems.rb | #
# Copyright 2012-2016 Chef Software, 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.
#
# expeditor/ignore: deprecated 2021-04
name "rubygems"
license "MIT"
license_file "https://raw.githubusercontent.com/rubygems/rubygems/master/LICENSE.txt"
skip_transitive_dependency_licensing true
dependency "ruby"
if version && !source
known_tarballs = {
"2.4.1" => "7e39c31806bbf9268296d03bd97ce718",
"2.4.4" => "440a89ad6a3b1b7a69b034233cc4658e",
"2.4.5" => "5918319a439c33ac75fbbad7fd60749d",
"2.4.8" => "dc77b51449dffe5b31776bff826bf559",
"2.6.7" => "9cd4c5bdc70b525dfacd96e471a64605",
"2.6.8" => "40b3250f28c1d0d5cb9ff5ab2b17df6e",
}
known_tarballs.each do |vsn, md5|
version vsn do
source md5: md5, url: "https://rubygems.org/rubygems/rubygems-#{vsn}.tgz"
relative_path "rubygems-#{vsn}"
end
end
end
# If we still don't have a source (if it's a tarball) grab from ruby ...
if version && !source
# If the version is a gem version, we"ll just be using rubygems.
# If it's a branch or SHA (i.e. v1.2.3) we use github.
begin
Gem::Version.new(version)
rescue ArgumentError
source git: "https://github.com/rubygems/rubygems.git"
end
end
# git repo is always expanded to "rubygems"
if source && source.include?(:git)
relative_path "rubygems"
end
build do
env = with_standard_compiler_flags(with_embedded_path)
if source
# Building from source:
command "git submodule init", env: env
command "git submodule update", env: env
ruby "setup.rb --no-document", env: env
else
# Installing direct from rubygems:
# If there is no version, this will get latest.
gem "update --no-document --system #{version}", env: env
gem "uninstall rubygems-update -ax"
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/rust-uninstall.rb | config/software/rust-uninstall.rb | # Copyright 2016 Chef Software, 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.
#
# expeditor/ignore: deprecated 2022-02
name "rust-uninstall"
default_version "0.0.1"
license :project_license
dependency "rust"
build do
env = with_standard_compiler_flags(with_embedded_path)
# Until Omnibus has full support for build depedencies (see chef/omnibus#483)
# we don't want to ship the Rust and Cargo in our final artifact. Luckily
# Rust ships with a nice uninstall script which makes it easy to strip
# everything out.
command "sh #{install_dir}/embedded/lib/rustlib/uninstall.sh", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/berkshelf-no-depselector.rb | config/software/berkshelf-no-depselector.rb | #
# Copyright 2016 Chef Software, 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.
#
# expeditor/ignore: deprecated 2021-04
name "berkshelf-no-depselector"
default_version "main"
license "Apache-2.0"
license_file "LICENSE"
source git: "https://github.com/berkshelf/berkshelf.git"
relative_path "berkshelf"
dependency "ruby"
unless windows? && (project.overrides[:ruby].nil? || project.overrides[:ruby][:version] == "ruby-windows")
dependency "libarchive"
end
dependency "nokogiri"
build do
env = with_standard_compiler_flags(with_embedded_path)
bundle "config set --local without guard changelog development test", env: env
bundle "install --jobs #{workers}", env: env
bundle "exec thor gem:build", env: env
gem "install pkg/berkshelf-*.gem" \
" --no-document", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/server-jre.rb | config/software/server-jre.rb | #
# Copyright 2013-2014 Chef Software, 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.
#
# expeditor/ignore: deprecated 2021-04
name "server-jre"
default_version "8u202"
unless _64_bit?
raise "Server-jre can only be installed on x86_64 systems."
end
license "Oracle-Binary"
license_file "LICENSE"
#
# October 2016 (ssd):
# Unfortunately http://java.com/license/ redirects to https://java.com/license/
# which then redirects to http://www.oracle.com/technetwork/java/javase/terms/license/
# triggering a bad redirect error.
#
license_file "http://www.oracle.com/technetwork/java/javase/terms/license/"
skip_transitive_dependency_licensing true
whitelist_file "jre/bin/javaws"
whitelist_file "jre/bin/policytool"
whitelist_file "jre/lib"
whitelist_file "jre/plugin"
whitelist_file "jre/bin/appletviewer"
license_warning = "By including the JRE, you accept the terms of the Oracle Binary Code License Agreement for the Java SE Platform Products and JavaFX, which can be found at http://www.oracle.com/technetwork/java/javase/terms/license/index.html"
license_cookie = "gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie"
# This is the final release of the Oracle Java under the 'Oracle Binary Code License Agreement'
version "8u202" do
source url: "https://download.oracle.com/otn/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/server-jre-8u202-linux-x64.tar.gz",
sha256: "61292e9d9ef84d9702f0e30f57b208e8fbd9a272d87cd530aece4f5213c98e4e",
cookie: license_cookie,
warning: license_warning,
unsafe: true
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "jdk1.8.0_202"
end
version "8u162" do
# https://www.oracle.com/webfolder/s/digest/8u162checksum.html
source url: "http://download.oracle.com/otn-pub/java/jdk/8u162-b12/0da788060d494f5095bf8624735fa2f1/server-jre-8u162-linux-x64.tar.gz",
sha256: "6942684acb6001748a01fc090a18f52ebd8cbfcf7be27ec6131981906bfa8b53",
cookie: license_cookie,
warning: license_warning,
unsafe: true
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "jdk1.8.0_162"
end
version "8u151" do
# https://www.oracle.com/webfolder/s/digest/8u151checksum.html
source url: "http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/server-jre-8u151-linux-x64.tar.gz",
sha256: "123b1d755416aa7579abc03f01ab946e612e141b6f7564130f2ada00ed913f1d",
cookie: license_cookie,
warning: license_warning,
unsafe: true
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "jdk1.8.0_151"
end
version "8u144" do
# https://www.oracle.com/webfolder/s/digest/8u144checksum.html
source url: "http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/server-jre-8u144-linux-x64.tar.gz",
sha256: "8ba6f1c692518beb0c727c6e1fb8c30a5dfcc38f8ef9f4f7c7c114c01c747ebc",
cookie: license_cookie,
warning: license_warning,
unsafe: true
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "jdk1.8.0_144"
end
version "8u121" do
# https://www.oracle.com/webfolder/s/digest/8u121checksum.html
source url: "http://download.oracle.com/otn-pub/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/server-jre-8u121-linux-x64.tar.gz",
sha256: "c25a60d02475499109f2bd6aa483721462aa7bfbb86b23ca6ac59be472747e5d",
cookie: license_cookie,
warning: license_warning,
unsafe: true
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "jdk1.8.0_121"
end
version "8u111" do
# https://www.oracle.com/webfolder/s/digest/8u111checksum.html
source url: "http://download.oracle.com/otn-pub/java/jdk/8u111-b14/server-jre-8u111-linux-x64.tar.gz",
sha256: "53442420cd9534ded4beca16c32c1d109cf5add637db764c86660c6eea1d88d4",
cookie: license_cookie,
warning: license_warning,
unsafe: true
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "jdk1.8.0_111"
end
version "8u91" do
# https://www.oracle.com/webfolder/s/digest/8u91checksum.html
source url: "http://download.oracle.com/otn-pub/java/jdk/8u91-b14/server-jre-8u91-linux-x64.tar.gz",
md5: "c8aefc3b97328d6f5197315fa6507bbf",
cookie: license_cookie,
warning: license_warning,
unsafe: true
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "jdk1.8.0_91"
end
build do
mkdir "#{install_dir}/embedded/jre"
sync "#{project_dir}/", "#{install_dir}/embedded/jre"
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/pcre.rb | config/software/pcre.rb | #
# Copyright:: Chef Software, 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.
#
name "pcre"
default_version "8.45"
license "BSD-2-Clause"
license_file "LICENCE"
skip_transitive_dependency_licensing true
dependency "libedit"
dependency "ncurses"
dependency "config_guess"
# version_list: url=https://sourceforge.net/projects/pcre/files/pcre/ filter=*.tar.gz
version("8.45") { source sha256: "4e6ce03e0336e8b4a3d6c2b70b1c5e18590a5673a98186da90d4f33c23defc09" }
version("8.44") { source sha256: "aecafd4af3bd0f3935721af77b889d9024b2e01d96b58471bd91a3063fb47728" }
version("8.38") { source sha256: "9883e419c336c63b0cb5202b09537c140966d585e4d0da66147dc513da13e629" }
source url: "https://downloads.sourceforge.net/project/pcre/pcre/#{version}/pcre-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "pcre-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
update_config_guess
command "./configure" \
" --prefix=#{install_dir}/embedded" \
" --disable-cpp" \
" --enable-utf" \
" --enable-unicode-properties" \
" --enable-pcretest-libedit" \
"--disable-pcregrep-jit", env: env
make "-j #{workers}", env: env
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/make.rb | config/software/make.rb | #
# Copyright 2012-2019 Chef Software, 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.
#
name "make"
default_version "4.3"
license "GPL-3.0"
license_file "COPYING"
# version_list: url=https://ftp.gnu.org/gnu/make/ filter=*.tar.gz
version("4.4") { source sha256: "581f4d4e872da74b3941c874215898a7d35802f03732bdccee1d4a7979105d18" }
version("4.3") { source sha256: "e05fdde47c5f7ca45cb697e973894ff4f5d79e13b750ed57d7b66d8defc78e19" }
source url: "https://ftp.gnu.org/gnu/make/make-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "make-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
command "./configure" \
" --disable-nls" \
" --prefix=#{install_dir}/embedded", env: env
make "-j #{workers}", env: env
make "install", env: env
# We are very prescriptive. We made make, we will make all the things use it!
link "#{install_dir}/embedded/bin/make", "#{install_dir}/embedded/bin/gmake"
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/nodejs.rb | config/software/nodejs.rb | #
# Copyright:: Chef Software, 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.
#
# expeditor/ignore: deprecated 2021-11
name "nodejs"
license "MIT"
license_file "LICENSE"
skip_transitive_dependency_licensing true
default_version "0.10.48"
dependency "python"
default_src_url = "https://nodejs.org/dist/v#{version}/node-v#{version}.tar.gz"
version "12.22.3" do
source url: default_src_url, sha256: "30acec454f26a168afe6d1c55307c5186ef23dba66527cc34e4497d01f91bda4"
end
version "0.10.48" do
source url: default_src_url, sha256: "27a1765b86bf4ec9833e2f89e8421ba4bc01a326b883f125de2f0b3494bd5549"
end
relative_path "node-v#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
config_command = [
"--prefix=#{install_dir}/embedded",
"--without-dtrace",
]
if version.satisfies?(">= 12")
config_command << "--without-node-snapshot"
config_command << "--without-inspector"
config_command << "--without-intl"
end
configure(*config_command, env: env)
make "-j #{workers}", env: env
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/chef-gem.rb | config/software/chef-gem.rb | #
# Copyright 2012-2014 Chef Software, 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.
#
# expeditor/ignore: deprecated 2021-04
name "chef-gem"
default_version "11.12.2"
license "Apache-2.0"
license_file "https://raw.githubusercontent.com/chef/chef/main/LICENSE"
dependency "ruby"
dependency "libffi"
dependency "rb-readline"
build do
env = with_standard_compiler_flags(with_embedded_path)
gem "install chef" \
" --version '#{version}'" \
" --bindir '#{install_dir}/embedded/bin'" \
" --no-document", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/shebang-cleanup.rb | config/software/shebang-cleanup.rb | #
# Copyright 2012-2020, Chef Software 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.
#
#
# Use this software definition to fix the shebangs of binaries under embedded/bin
# to point to the embedded ruby.
#
# expeditor/ignore: logic only
name "shebang-cleanup"
default_version "0.0.2"
license :project_license
skip_transitive_dependency_licensing true
build do
if windows?
block "Update batch files to point at embedded ruby" do
load_gemspec = if Gem::VERSION >= "2"
require "rubygems/package"
Gem::Package.method(:new)
else
require "rubygems/format"
Gem::Format.method(:from_file_by_path)
end
Dir["#{install_dir.tr("\\", "/")}/embedded/lib/ruby/gems/**/cache/*.gem"].each do |gem_file|
load_gemspec.call(gem_file).spec.executables.each do |bin|
if File.exist?("#{install_dir}/bin/#{bin}")
File.open("#{install_dir}/bin/#{bin}.bat", "w") do |f|
f.puts <<~EOF
@ECHO OFF
"%~dp0..\\embedded\\bin\\ruby.exe" "%~dpn0" %*
EOF
end
end
if File.exist?("#{install_dir}/embedded/bin/#{bin}")
File.open("#{install_dir}/embedded/bin/#{bin}.bat", "w") do |f|
f.puts <<~EOF
@ECHO OFF
"%~dp0ruby.exe" "%~dpn0" %*
EOF
end
end
# Rubocop is silly and yells at you for structuring the
# last if statement the way it is.
next
end
end
# Fix gem.bat and bundle.bat
%w{gem bundle}.each do |binstub|
File.open("#{install_dir}/embedded/bin/#{binstub}.bat", "w") do |f|
f.puts <<~EOF
@ECHO OFF
"%~dp0ruby.exe" "%~dpn0" %*
EOF
end
end
end
else
block "Update shebangs to point to embedded Ruby" do
# Fix the shebang for binaries with shebangs that have:
# #!/usr/bin/env ruby
Dir.glob("#{install_dir}/embedded/bin/*") do |bin_file|
update_shebang = false
rest_of_the_file = ""
File.open(bin_file) do |f|
shebang = f.readline
if shebang.start_with?("#!") &&
shebang.include?("ruby") &&
!shebang.include?("#{install_dir}/embedded/bin/ruby")
rest_of_the_file = f.read
update_shebang = true
end
end
if update_shebang
File.open(bin_file, "w+") do |f|
f.puts("#!#{install_dir}/embedded/bin/ruby")
f.puts(rest_of_the_file)
end
end
end
end
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/cmake.rb | config/software/cmake.rb | #
# Copyright:: Chef Software, 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.
#
# expeditor/ignore: deprecated 2021-11
name "cmake"
default_version "3.19.7"
dependency "cacerts"
license "BSD-3-Clause"
skip_transitive_dependency_licensing true
if windows?
if windows_arch_i386?
# version_list: url=https://cmake.org/files/v3.20/ filter=*-windows-i386.zip
version("3.20.0") { source sha256: "6df4c34f7d2735100ebae91e6d2d37b3c3c7b81e93decce9f4926a4e505affbc" }
# version_list: url=https://cmake.org/files/v3.19/ filter=*-win32-x86.zip
version("3.19.7") { source sha256: "7771205d94022787bc4c3a623629d236b10bf697315e9f92c214dd8b53e8746e" }
# version_list: url=https://cmake.org/files/v3.18/ filter=*-win32-x86.zip
version("3.18.6") { source sha256: "f6531568def18afecf3d54abd7ccf1f9cf092c683b14fde36b47910c7f822e8d" }
version("3.18.1") { source sha256: "1a20c049e094d9ad49caca4b4d713c75c924a3885ecec4ed3986344aab05b6eb" }
else
# version_list: url=https://cmake.org/files/v3.20/ filter=*-windows-x86_64.zip
version("3.20.0") { source sha256: "056378cb599353479c3a8aa2654454b8a3eaa3c8c0872928ba7e09c3ec50774c" }
# version_list: url=https://cmake.org/files/v3.19/ filter=*-win64-x64.zip
version("3.19.7") { source sha256: "e6788d6e23b3026c37fcfa7658075d6b5f9113f26fae17fe372ad4a7ee62d5fd" }
# version_list: url=https://cmake.org/files/v3.18/ filter=*-win64-x64.zip
version("3.18.6") { source sha256: "6a7166841bf2d72d56b5ff8c7c7606901bd8a0d87194f509b759d3ae3b6fdd6e" }
version("3.18.1") { source sha256: "2c6c06da43c1088fc3a673e4440c8ebb1531bb6511134892c0589aa0b94f11ad" }
end
else
# version_list: url=https://cmake.org/files/v3.20/ filter=*.tar.gz
version("3.20.0") { source sha256: "9c06b2ddf7c337e31d8201f6ebcd3bba86a9a033976a9aee207fe0c6971f4755" }
# version_list: url=https://cmake.org/files/v3.19/ filter=*.tar.gz default_version=true
version("3.19.7") { source sha256: "58a15f0d56a0afccc3cc5371234fce73fcc6c8f9dbd775d898e510b83175588e" }
# version_list: url=https://cmake.org/files/v3.18/ filter=*.tar.gz
version("3.18.6") { source sha256: "124f571ab70332da97a173cb794dfa09a5b20ccbb80a08e56570a500f47b6600" }
version("3.18.1") { source sha256: "c0e3338bd37e67155b9d1e9526fec326b5c541f74857771b7ffed0c46ad62508" }
end
minor_version = version.split(".")[0..1].join(".")
if windows?
if windows_arch_i386?
suffix = version.satisfies?(">= 3.20") ? "windows-i386" : "win32-x86"
source url: "https://cmake.org/files/v#{minor_version}/cmake-#{version}-#{suffix}.zip"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}-#{suffix}.zip",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "cmake-#{version}-win32-x86"
license_file "doc/cmake/Copyright.txt"
else
suffix = version.satisfies?(">= 3.20") ? "windows-x86_64" : "win32-x64"
source url: "https://cmake.org/files/v#{minor_version}/cmake-#{version}-#{suffix}.zip"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}-#{suffix}.zip",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "cmake-#{version}-win64-x64"
license_file "doc/cmake/Copyright.txt"
end
else
source url: "https://cmake.org/files/v#{minor_version}/cmake-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "cmake-#{version}"
license_file "Copyright.txt"
end
build do
# It's hard-slash-impossible to build cmake on windows without cmake, so we don't even try
if windows?
copy "bin/cmake.exe", "#{install_dir}/embedded/bin"
copy "share/cmake-3.18", "#{install_dir}/embedded/share/"
copy "share/aclocal/cmake.m4", "#{install_dir}/embedded/share/aclocal/"
else
env = with_standard_compiler_flags(with_embedded_path)
command "./bootstrap --prefix=#{install_dir}/embedded", env: env
make "-j #{workers}", env: env
make "install", env: env
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/libyaml.rb | config/software/libyaml.rb | #
# Copyright:: Chef Software, 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.
#
name "libyaml"
default_version "0.2.5"
license "MIT"
license_file "LICENSE"
skip_transitive_dependency_licensing true
dependency "config_guess"
# versions_list: https://pyyaml.org/download/libyaml/ filter=*.tar.gz
version("0.2.5") { source sha256: "c642ae9b75fee120b2d96c712538bd2cf283228d2337df2cf2988e3c02678ef4" }
version("0.2.4") { source sha256: "d80aeda8747b7c26fbbfd87ab687786e58394a8435ae3970e79cb97882e30557" }
version("0.1.7") { source sha256: "8088e457264a98ba451a90b8661fcb4f9d6f478f7265d48322a196cec2480729" }
source url: "https://pyyaml.org/download/libyaml/yaml-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/yaml-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "yaml-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
update_config_guess(target: "config")
configure "--enable-shared", env: env
# Windows had worse automake/libtool version issues.
# Just patch the output instead.
if windows? && version.satisfies?("< 0.2.5")
patch source: "windows-configure.patch", plevel: 1, env: env
end
make "-j #{workers}", env: env
make "-j #{workers} install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/mpfr.rb | config/software/mpfr.rb | #
# Copyright 2014-2019 Chef Software, 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.
#
# expeditor/ignore: deprecated 2022-12
name "mpfr"
default_version "4.1.0"
dependency "gmp"
license "LGPL-3.0-or-later"
license_file "COPYING.LESSER"
# version_list: url=https://ftp.gnu.org/gnu/mpfr/ filter=*.tar.gz
version("4.1.0") { source sha256: "3127fe813218f3a1f0adf4e8899de23df33b4cf4b4b3831a5314f78e65ffa2d6" }
version("3.1.6") { source sha256: "569ceb418aa935317a79e93b87eeb3f956cab1a97dfb2f3b5fd8ac2501011d62" }
version("3.1.3") { source sha256: "b87feae279e6da95a0b45eabdb04f3a35422dab0d30113d58a7803c0d73a79dc" }
version("3.1.2") { source sha256: "176043ec07f55cd02e91ee3219db141d87807b322179388413a9523292d2ee85" }
source url: "https://ftp.gnu.org/gnu/mpfr/mpfr-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "mpfr-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
configure_command = ["./configure",
"--prefix=#{install_dir}/embedded"]
command configure_command.join(" "), env: env
make "-j #{workers}", env: env
make "-j #{workers} install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/pkg-config.rb | config/software/pkg-config.rb | #
# Copyright 2013-2014 Chef Software, 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.
#
# expeditor/ignore: deprecated 2021-05
name "pkg-config"
default_version "0.28"
dependency "libiconv"
dependency "config_guess"
# version_list: url=https://pkgconfig.freedesktop.org/releases/ filter=*.tar.gz
version("0.28") { source sha256: "6b6eb31c6ec4421174578652c7e141fdaae2dabad1021f420d8713206ac1f845" }
source url: "https://pkgconfig.freedesktop.org/releases/pkg-config-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "pkg-config-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
update_config_guess
# pkg-config (at least up to 0.28) includes an older version of
# libcharset/lib/config.charset that doesn't know about openbsd
if openbsd?
patch source: "openbsd-charset.patch", plevel: 1, env: env
end
command "./configure" \
" --prefix=#{install_dir}/embedded" \
" --disable-debug" \
" --disable-host-tool" \
" --with-internal-glib" \
" --with-pc-path=#{install_dir}/embedded/bin/pkgconfig", env: env
# #203: pkg-configs internal glib does not provide a way to pass ldflags.
# Only allows GLIB_CFLAGS and GLIB_LIBS.
# These do not serve our purpose, so we must explicitly
# ./configure in the glib dir, with the Omnibus ldflags.
command "./configure" \
" --prefix=#{install_dir}/embedded" \
" --with-libiconv=gnu", env: env, cwd: "#{project_dir}/glib"
make "-j #{workers}", env: env
make "-j #{workers} install", env: env
# ensure charset.alias gets installed on openbsd else pkg-config will
# exit with byte conversion errors.
if openbsd?
copy "#{project_dir}/glib/glib/libcharset/charset.alias", "#{install_dir}/embedded/lib/charset.alias"
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/perl-extutils-makemaker.rb | config/software/perl-extutils-makemaker.rb | #
# Copyright 2014 Chef Software, 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.
#
# expeditor/ignore: deprecated 2021-04
name "perl-extutils-makemaker"
default_version "6.78"
dependency "perl"
version "6.98" do
source md5: "3eb83b59e33159ecc700bf60ac3c357a"
end
version "6.78" do
source md5: "843886bc1060b5e5c619e34029343eba"
end
version "7.10" do
source md5: "2639a21adee5e0a903730c12dcba08ec"
end
source url: "http://search.cpan.org/CPAN/authors/id/B/BI/BINGOS/ExtUtils-MakeMaker-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "ExtUtils-MakeMaker-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path).merge(
"INSTALL_BASE" => "#{install_dir}/embedded"
)
command "#{install_dir}/embedded/bin/perl Makefile.PL", env: env
make env: env
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/xproto.rb | config/software/xproto.rb | #
# Copyright 2014 Chef Software, 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.
#
name "xproto"
default_version "7.0.31"
dependency "config_guess"
# version_list: url=https://www.x.org/releases/individual/proto/ filter=xproto-*.tar.gz
version("7.0.31") { source sha256: "6d755eaae27b45c5cc75529a12855fed5de5969b367ed05003944cf901ed43c7" }
version("7.0.28") { source sha256: "6cabc8ce3fa2b1a2427871167b62c24d5b08a58bd3e81ed7aaf08f2bf6dbcfed" }
version("7.0.25") { source sha256: "e3dc634103f923a2276289745eb7b702b18cfc885ea4b2382bd35a8cc3d935cb" }
source url: "https://www.x.org/releases/individual/proto/xproto-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
license "MIT"
license_file "COPYING"
skip_transitive_dependency_licensing true
relative_path "xproto-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
update_config_guess
command "./configure" \
" --prefix=#{install_dir}/embedded", env: env
make "-j #{workers}", env: env
make "-j #{workers} install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/ffi-yajl.rb | config/software/ffi-yajl.rb | #
# Copyright 2012-2014 Chef Software, 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.
#
# expeditor/ignore: deprecated 2021-04
name "ffi-yajl"
default_version "main"
relative_path "ffi-yajl"
source git: "https://github.com/chef/ffi-yajl.git"
license "MIT"
license_file "LICENSE"
dependency "ruby"
dependency "libyajl2-gem"
build do
env = with_embedded_path
# We should not be installing development dependencies either, but
# this upstream bug causes issues between libyajl2-gem and ffi-yajl
# (specifically, "corrupted Gemfile.lock" failures)
# https://github.com/bundler/bundler/issues/4467
bundle "config set --local without development_extras", env: env
bundle "install", env: env
bundle "exec rake gem", env: env
delete "pkg/*java*"
gem "install pkg/ffi-yajl-*.gem" \
" --no-document", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/bash.rb | config/software/bash.rb | #
# Copyright 2015 Chef Software, 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.
#
name "bash"
default_version "5.2.15"
dependency "libiconv"
dependency "ncurses"
skip_transitive_dependency_licensing true
# version_list: url=https://ftp.gnu.org/gnu/bash/ filter=*.tar.gz
version("5.0") { source sha256: "b4a80f2ac66170b2913efbfb9f2594f1f76c7b1afd11f799e22035d63077fb4d" }
version("5.1") { source sha256: "cc012bc860406dcf42f64431bcd3d2fa7560c02915a601aba9cd597a39329baa" }
version("5.1.8") { source sha256: "0cfb5c9bb1a29f800a97bd242d19511c997a1013815b805e0fdd32214113d6be" }
version("5.1.16") { source sha256: "5bac17218d3911834520dad13cd1f85ab944e1c09ae1aba55906be1f8192f558" }
version("5.2") { source sha256: "a139c166df7ff4471c5e0733051642ee5556c1cc8a4a78f145583c5c81ab32fb" }
version("5.2.9") { source sha256: "68d978264253bc933d692f1de195e2e5b463a3984dfb4e5504b076865f16b6dd" }
version("5.2.15") { source sha256: "13720965b5f4fc3a0d4b61dd37e7565c741da9a5be24edc2ae00182fc1b3588c" }
license "GPL-3.0"
license_file "COPYING"
source url: "https://ftp.gnu.org/gnu/bash/bash-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
# bash builds bash as libraries into a special directory. We need to include
# that directory in lib_dirs so omnibus can sign them during macOS deep signing.
lib_dirs lib_dirs.concat ["#{install_dir}/embedded/lib/bash"]
relative_path "bash-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
# FreeBSD can build bash with this patch but it doesn't work properly
# Things like command substitution will throw syntax errors even though the syntax is correct
if version.satisfies?("< 5.2")
unless freebsd?
# Fix bash race condition
# https://lists.gnu.org/archive/html/bug-bash/2020-12/msg00051.html
patch source: "race-condition.patch", plevel: 1, env: env
end
else
patch source: "updated_race-condition.patch", plevel: 0, env: env
end
configure_command = ["./configure",
"--prefix=#{install_dir}/embedded"]
if freebsd?
# On freebsd, you have to force static linking, otherwise the executable
# will link against the system ncurses instead of ours.
configure_command << "--enable-static-link"
# FreeBSD 12 system files come with mktime but for some reason running "configure"
# doesn't detect this which results in a build failure. Setting this environment variable
# corrects that.
env["ac_cv_func_working_mktime"] = "yes"
end
command configure_command.join(" "), env: env
make "-j #{workers}", env: env
make "-j #{workers} install", env: env
# We do not install bashbug in macos as it fails Notarization
delete "#{install_dir}/embedded/bin/bashbug"
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/gtar.rb | config/software/gtar.rb | #
# Copyright 2016-2019 Chef Software, 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.
#
name "gtar"
default_version "1.34"
# version_list: url=https://ftp.gnu.org/gnu/tar/ filter=*.tar.gz
version("1.35") { source sha256: "14d55e32063ea9526e057fbf35fcabd53378e769787eff7919c3755b02d2b57e" }
version("1.34") { source sha256: "03d908cf5768cfe6b7ad588c921c6ed21acabfb2b79b788d1330453507647aed" }
version("1.33") { source sha256: "7c77c427e8cce274d46a6325d45a55b08e13e2d2d0c9e6c0860a6d2b9589ff0e" }
version("1.32") { source sha256: "b59549594d91d84ee00c99cf2541a3330fed3a42c440503326dab767f2fbb96c" }
version("1.30") { source sha256: "4725cc2c2f5a274b12b39d1f78b3545ec9ebb06a6e48e8845e1995ac8513b088" }
version("1.29") { source sha256: "cae466e6e58c7292355e7080248f244db3a4cf755f33f4fa25ca7f9a7ed09af0" }
license "GPL-3.0"
license_file "COPYING"
source url: "https://ftp.gnu.org/gnu/tar/tar-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/tar-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "tar-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
configure_command = [
"./configure",
"FORCE_UNSAFE_CONFIGURE=1",
"--prefix=#{install_dir}/embedded",
]
# First off let's disable selinux support, as it causes issues on some platforms
# We're not doing it on every platform because this breaks on macOS
unless osx?
configure_command << " --without-selinux"
end
if s390x?
# s390x doesn't support posix acls
configure_command << " --without-posix-acls"
elsif aix? && version.satisfies?("< 1.32")
# xlc doesn't allow duplicate entries in case statements
patch_env = env.dup
patch_env["PATH"] = "/opt/freeware/bin:#{env["PATH"]}"
patch source: "aix_extra_case.patch", plevel: 0, env: patch_env
end
command configure_command.join(" "), env: env
make "-j #{workers}", env: env
make "-j #{workers} install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/gdbm.rb | config/software/gdbm.rb | #
# Copyright 2012-2014 Chef Software, 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.
#
# expeditor/ignore: deprecated 2021-11
#
name "gdbm"
default_version "1.8.3"
dependency "config_guess"
# Version 1.9 and above are GPLv3, do NOT add later versions in
version("1.8.3") { source md5: "1d1b1d5c0245b1c00aff92da751e9aa1" }
source url: "https://ftp.gnu.org/gnu/gdbm/gdbm-#{version}.tar.gz"
relative_path "gdbm-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
if version == "1.8.3"
patch source: "v1.8.3-Makefile.in.patch", plevel: 0, env: env
end
update_config_guess
if freebsd?
command "./configure" \
" --enable-libgdbm-compat" \
" --with-pic" \
" --prefix=#{install_dir}/embedded", env: env
else
command "./configure" \
" --enable-libgdbm-compat" \
" --prefix=#{install_dir}/embedded", env: env
end
make "-j #{workers}", env: env
make "install", env: env
make "install-compat", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/sqitch.rb | config/software/sqitch.rb | #
# Copyright 2014 Chef Software, 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.
#
name "sqitch"
default_version "1.3.1"
license "MIT"
license_file "https://raw.githubusercontent.com/theory/sqitch/master/README.md"
dependency "perl"
dependency "cpanminus"
# install a LGPL-licensed version of libintl-perl:
dependency "libintl-perl"
# version_list: url=https://github.com/theory/#{name}/releases/download/v#{version}/ filter=app-sqitch-*.tar.gz
version("1.4.0") { source sha256: "b0db387031f77562662e003bc55d7a102a26380b4ad7fdb9a8a3bad5769e501c" }
version("1.3.1") { source sha256: "f5e768d298cd4047ee2ae42319782e8c2cda312737bcbdbfaf580bd47efe8b94" }
version("1.3.0") { source sha256: "7d07635ec77a7faf3c50281c76ec833c68702f14470996cb2203a8bc6abc5bf2" }
version("1.2.1") { source sha256: "020835a13429effd8fda12d5627604ecf99293775918f4f8ba9ccc5ed796e5e7" }
version("1.1.0") { source sha256: "ee146cd75d6300837e6ca559bb0bde247d42123c96b2c5d4b2800f38d3e3d1ab" }
version("0.9999") { source sha256: "f5bfa80206738ab8a70358a3b0557661c7459e11ec07dece23ecafa1f34372b3" }
version("0.973") { source sha256: "95fc7f18fff786c5d2579133e2e3ac56779e54bb3a06a1af1117054e9f49ab32" }
if version >= "1.1.0"
source url: "https://github.com/theory/#{name}/releases/download/v#{version}/app-sqitch-v#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/app-sqitch-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "App-Sqitch-v#{version}"
else
source url: "https://github.com/theory/#{name}/releases/download/v#{version}/app-sqitch-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/app-sqitch-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "App-Sqitch-#{version}"
end
# See https://github.com/theory/sqitch for more
build do
env = with_standard_compiler_flags(with_embedded_path)
# Lists-MoreUtils-XS does not build on RHEL 5 or SUSE 11 currently.
# This option is used by the Lists-MoreUtils build configuration to
# decide whether to use the -XS package or a pure perl
# implementation.
env["PERL_MM_OPT"] = "PUREPERL_ONLY=1"
command "perl Build.PL", env: env
command "./Build installdeps --cpan_client 'cpanm -v --notest'", env: env
command "./Build", env: env
command "./Build install", env: env
# Here is another licensing fun. Some of the dependencies of sqitch
# unfortunately have GPL3 and LGPL3 licenses which are requiring us to remove
# them from our packages after installing sqitch. Here we are uninstalling
# them without breaking the licensing information collection.
%w{Test-MockModule}.each do |package_name|
module_name = package_name.gsub("-", "::")
# Here we run cpanm --uninstall with a different PERL_CPANM_HOME. The reason
# for this is to keep the licensing information for sqitch intact. The way
# license_scout works is to look into PERL_CPANM_HOME/latest-build (by
# default ~/.cpanm/latest-build) which contains the modules installed during
# the last install. This directory is a symlink that points to the directory
# contains the information about the latest build. Without changing
# PERL_CPANM_HOME we would overwrite the link and will not be able to
# collect the dependencies installed to our package while doing the actual
# sqitch install.
Dir.mktmpdir do |tmpdir|
command "cpanm --force --uninstall #{module_name}", env: env.merge({
"PERL_CPANM_HOME" => tmpdir,
})
end
# Here we are removing the problematic package from the original
# PERL_CPANM_HOME cache directory. This ensures that we do not add
# licensing information about these components to our package.
cpanm_root = File.expand_path("~/.cpanm/latest-build")
delete "#{cpanm_root}/#{package_name}*"
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/setuptools.rb | config/software/setuptools.rb | #
# Copyright 2013-2014 Chef Software, 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.
#
# expeditor/ignore: deprecated 2021-04
name "setuptools"
default_version "0.7.7"
license "Python Software Foundation"
license_file "https://raw.githubusercontent.com/pypa/setuptools/master/LICENSE"
skip_transitive_dependency_licensing true
dependency "python"
version "0.9.8" do
source md5: "243076241781935f7fcad370195a4291"
end
version "0.7.7" do
source md5: "0d7bc0e1a34b70a97e706ef74aa7f37f"
end
version "20.0" do
source md5: "fb22b2474ca037e0b08f3c3b293e02e6"
end
source url: "https://pypi.python.org/packages/source/s/setuptools/setuptools-#{version}.tar.gz"
relative_path "setuptools-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
command "#{install_dir}/embedded/bin/python setup.py install" \
" --prefix=#{install_dir}/embedded", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/m4.rb | config/software/m4.rb | #
# Copyright:: Chef Software, 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.
#
# expeditor/ignore: deprecated 2021-04
name "m4"
default_version "1.4.18"
license "GPL-3.0"
license_file "COPYING"
skip_transitive_dependency_licensing true
version("1.4.18") { source sha256: "ab2633921a5cd38e48797bf5521ad259bdc4b979078034a3b790d7fec5493fab" }
source url: "https://ftp.gnu.org/gnu/m4/m4-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/m4-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "m4-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
patch source: "m4-1.4.18-glibc-change-work-around.patch", plevel: 1, env: env if version == "1.4.18"
command "./configure --prefix=#{install_dir}/embedded", env: env
make "-j #{workers}", env: env
make "-j #{workers} install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/server-open-jre.rb | config/software/server-open-jre.rb | #
# Copyright:: Chef Software, 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.
#
dependency "zlib"
dependency "patchelf"
name "server-open-jre"
default_version "17.0.9+9"
unless _64_bit?
raise "Server-open-jre can only be installed on x86_64 systems."
end
license "GPL-2.0 (with the Classpath Exception)"
# since the official license url is getting timeout and not reachable from some build nodes.
# using an another reliable source for the license file to avoid external network download issues. see below error
# [Licensing] I | 2025-10-06T14:48:00+00:00 | Retrying failed download due to Net::ReadTimeout (1 retries left)...
# [Licensing] E | 2025-10-06T14:50:05+00:00 | Download failed - Net::ReadTimeout!
# [Licensing] W | 2025-10-06T14:50:05+00:00 | Can not download license file 'https://openjdk.org/legal/gplv2+ce.html' for software 'server-open-jre'.
license_file "https://raw.githubusercontent.com/microsoft/openjdk-jdk17u/main/LICENSE"
skip_transitive_dependency_licensing true
whitelist_file "jre/bin/javaws"
whitelist_file "jre/bin/policytool"
whitelist_file "jre/lib"
whitelist_file "jre/plugin"
whitelist_file "jre/bin/appletviewer"
license_warning = "By including the JRE, you accept the terms of AdoptOpenJRE."
# version_list: url=https://github.com/adoptium/temurin11-binaries/releases filter=*.tar.gz
name_folder = "server-open-jre"
version "17.0.9+9" do
source url: "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.9%2B9/OpenJDK17U-jre_x64_linux_hotspot_17.0.9_9.tar.gz",
sha256: "c37f729200b572884b8f8e157852c739be728d61d9a1da0f920104876d324733",
warning: license_warning,
unsafe: true
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name_folder}/OpenJDK17U-jre_x64_linux_hotspot_17.0.9_9.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
end
version "11.0.28+6" do
source url: "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.28%2B6/OpenJDK11U-jre_x64_linux_hotspot_11.0.28_6.tar.gz",
sha256: "ddbd5d7ef14aa06784fb94d1e0e7177868dfdd0aa216a8a2e654869968ef7392",
warning: license_warning,
unsafe: true
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name_folder}/OpenJDK11U-jre_x64_linux_hotspot_11.0.28_6.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
end
version "11.0.22+7" do
source url: "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.22%2B7/OpenJDK11U-jre_x64_linux_hotspot_11.0.22_7.tar.gz",
sha256: "3a0fec1b9ef38d6abd86cf11f6001772b086096b6ec2588d2a02f1fa86b2b1de",
warning: license_warning,
unsafe: true
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name_folder}/OpenJDK11U-jre_x64_linux_hotspot_11.0.22_7.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
end
version "11.0.21+9" do
source url: "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.21%2B9/OpenJDK11U-jre_x64_linux_hotspot_11.0.21_9.tar.gz",
sha256: "156861bb901ef18759e05f6f008595220c7d1318a46758531b957b0c950ef2c3",
warning: license_warning,
unsafe: true
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name_folder}/OpenJDK11U-jre_x64_linux_hotspot_11.0.21_9.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
end
relative_path "jdk-#{version}-jre"
build do
mkdir "#{install_dir}/embedded/open-jre"
sync "#{project_dir}/", "#{install_dir}/embedded/open-jre"
# Patch RPATH so Java binaries can locate required shared libraries (e.g., libjli.so, libz.so)
# in both the embedded OpenJRE and Omnibus environment.
new_rpath = "#{install_dir}/embedded/open-jre/lib/jli:#{install_dir}/embedded/lib:$ORIGIN/../lib"
Dir.glob("#{install_dir}/embedded/open-jre/bin/**/*").each do |bin|
next unless File.file?(bin) && File.executable?(bin) && !File.symlink?(bin)
file_output = shellout!("file -b #{bin}").stdout
next unless file_output.include?("ELF")
shellout!("#{install_dir}/embedded/bin/patchelf --set-rpath #{new_rpath} #{bin}")
end
end | ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/postgresql.rb | config/software/postgresql.rb | #
# Copyright:: Chef Software, 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.
#
name "postgresql"
default_version "15.1"
license "PostgreSQL"
license_file "COPYRIGHT"
skip_transitive_dependency_licensing true
dependency "zlib"
dependency "openssl"
dependency "libedit"
dependency "ncurses"
dependency "libossp-uuid"
dependency "config_guess"
# version_list: url=https://ftp.postgresql.org/pub/source/v#{version}/ filter=*.tar.bz2
version("15.1") { source sha256: "64fdf23d734afad0dfe4077daca96ac51dcd697e68ae2d3d4ca6c45cb14e21ae" }
version("15.0") { source sha256: "72ec74f4a7c16e684f43ea42e215497fcd4c55d028a68fb72e99e61ff40da4d6" }
version("14.5") { source sha256: "d4f72cb5fb857c9a9f75ec8cf091a1771272802f2178f0b2e65b7b6ff64f4a30" }
version("14.4") { source sha256: "c23b6237c5231c791511bdc79098617d6852e9e3bdf360efd8b5d15a1a3d8f6a" }
version("14.3") { source sha256: "279057368bf59a919c05ada8f95c5e04abb43e74b9a2a69c3d46a20e07a9af38" }
version("14.2") { source sha256: "2cf78b2e468912f8101d695db5340cf313c2e9f68a612fb71427524e8c9a977a" }
version("14.1") { source sha256: "4d3c101ea7ae38982f06bdc73758b53727fb6402ecd9382006fa5ecc7c2ca41f" }
# Version 12.x will EoL November 14, 2024
version("12.7") { source sha256: "8490741f47c88edc8b6624af009ce19fda4dc9b31c4469ce2551d84075d5d995" }
# Version 9.6 will EoL November 11, 2021
version("9.6.22") { source sha256: "3d32cd101025a0556813397c69feff3df3d63736adb8adeaf365c522f39f2930" }
# Version 9.3 was EoL November 8, 2018 (but used in Supermarket as of 6.2021)
version("9.3.25") { source sha256: "e4953e80415d039ccd33d34be74526a090fd585cf93f296cd9c593972504b6db" }
source url: "https://ftp.postgresql.org/pub/source/v#{version}/postgresql-#{version}.tar.bz2"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.bz2",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "postgresql-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
update_config_guess(target: "config")
command "./configure" \
" --prefix=#{install_dir}/embedded" \
" --with-libedit-preferred" \
" --with-openssl" \
" --with-ossp-uuid" \
" --with-includes=#{install_dir}/embedded/include" \
" --with-libraries=#{install_dir}/embedded/lib", env: env
make "world -j #{workers}", env: env
make "install-world", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/libarchive.rb | config/software/libarchive.rb | #
# Copyright 2014-2021 Chef Software, 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.
#
# A requirement for api.berkshelf.com that is used in berkshelf specs
# https://github.com/berkshelf/api.berkshelf.com
name "libarchive"
default_version "3.6.2"
license "BSD-2-Clause"
license_file "COPYING"
skip_transitive_dependency_licensing true
# versions_list: https://github.com/libarchive/libarchive/releases/ filter=*.tar.gz
version("3.8.1") { source sha256: "bde832a5e3344dc723cfe9cc37f8e54bde04565bfe6f136bc1bd31ab352e9fab" }
version("3.7.9") { source sha256: "aa90732c5a6bdda52fda2ad468ac98d75be981c15dde263d7b5cf6af66fd009f" }
version("3.7.5") { source sha256: "37556113fe44d77a7988f1ef88bf86ab68f53d11e85066ffd3c70157cc5110f1" }
version("3.7.4") { source sha256: "7875d49596286055b52439ed42f044bd8ad426aa4cc5aabd96bfe7abb971d5e8" }
version("3.6.2") { source sha256: "ba6d02f15ba04aba9c23fd5f236bb234eab9d5209e95d1c4df85c44d5f19b9b3" }
version("3.6.1") { source sha256: "c676146577d989189940f1959d9e3980d28513d74eedfbc6b7f15ea45fe54ee2" }
version("3.6.0") { source sha256: "a36613695ffa2905fdedc997b6df04a3006ccfd71d747a339b78aa8412c3d852" }
version("3.5.2") { source sha256: "5f245bd5176bc5f67428eb0aa497e09979264a153a074d35416521a5b8e86189" }
version("3.5.1") { source sha256: "9015d109ec00bb9ae1a384b172bf2fc1dff41e2c66e5a9eeddf933af9db37f5a" }
version("3.5.0") { source sha256: "fc4bc301188376adc18780d35602454cc8df6396e1b040fbcbb0d4c0469faf54" }
source url: "https://github.com/libarchive/libarchive/releases/download/v#{version}/libarchive-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "libarchive-#{version}"
dependency "config_guess"
dependency "libxml2"
dependency "bzip2"
dependency "zlib"
dependency "liblzma"
build do
env = with_standard_compiler_flags(with_embedded_path)
update_config_guess(target: "build/autoconf/")
configure_args = [
"--prefix=#{install_dir}/embedded",
"--without-lzo2",
"--without-nettle",
"--without-expat",
"--without-iconv",
"--disable-bsdtar", # tar command line tool
"--disable-bsdcpio", # cpio command line tool
"--disable-bsdcat", # cat w/ decompression command line tool
"--without-openssl",
"--without-zstd",
"--without-lz4",
]
if s390x?
configure_args << "--disable-xattr --disable-acl"
end
configure configure_args.join(" "), env: env
make "-j #{workers}", env: env
make "-j #{workers} install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/keydb.rb | config/software/keydb.rb | #
# Copyright:: Chef Software, 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.
#
name "keydb"
license "BSD-3-Clause"
license_file "COPYING"
skip_transitive_dependency_licensing true
dependency "config_guess"
dependency "openssl"
dependency "libuuid"
dependency "curl"
default_version "6.3.4"
source url: "https://github.com/Snapchat/KeyDB/archive/refs/tags/v#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/v#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "KeyDB-#{version}"
# version_list: url=https://github.com/Snapchat/KeyDB/archive/refs/tags/ filter=*.tar.gz
version("6.3.4") { source sha256: "229190b251f921e05aff7b0d2f04b5676c198131e2abbec1e2cfb2e61215e2f3" }
build do
env = with_standard_compiler_flags(with_embedded_path).merge(
"PREFIX" => "#{install_dir}/embedded"
)
env["CFLAGS"] << " -I#{install_dir}/embedded/include"
env["LDFLAGS"] << " -L#{install_dir}/embedded/lib"
if version.satisfies?(">=6.3.4")
patch source: "remove-libatomic-dep", env: env
end
if suse?
env["CFLAGS"] << " -fno-lto"
env["CXXFLAGS"] << " -fno-lto"
end
update_config_guess
make "-j #{workers}", env: env
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/delivery-cli.rb | config/software/delivery-cli.rb | #
# Copyright 2015 Chef Software, 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.
#
# expeditor/ignore: no version pinning
name "delivery-cli"
# Delivery CLI is only pushed to the main branch of Github after it
# is successfully Delivered. So pulling in the "main" version
# will always give you the latest Delivered version.
default_version "main"
license "Apache-2.0"
license_file "LICENSE"
source git: "https://github.com/chef/delivery-cli.git"
dependency "openssl"
dependency "rust"
build do
env = with_standard_compiler_flags(with_embedded_path)
env["RUST_BACKTRACE"] = "1"
# The rust core libraries are dynamicaly linked
if linux?
env["LD_LIBRARY_PATH"] = "#{install_dir}/embedded/lib"
elsif mac_os_x? &&
platform_version.satisfies?("< 10.13") # Setting DYLD PATH fails builds with library conflicts in 10.13
env["DYLD_FALLBACK_LIBRARY_PATH"] = "#{install_dir}/embedded/lib:"
end
# pass version info into the build
env["DELIV_CLI_VERSION"] = version
env["DELIV_CLI_GIT_SHA"] = Omnibus::Fetcher.resolve_version(version, source)
if windows?
copy "#{install_dir}/embedded/bin/ssleay32.dll", "#{install_dir}/embedded/bin/libssl32.dll"
env["OPENSSL_LIB_DIR"] = "#{install_dir}/embedded/bin"
end
command "cargo build -j #{workers} --release", env: env
mkdir "#{install_dir}/bin"
if windows?
copy "#{project_dir}/target/release/delivery.exe", "#{install_dir}/bin/delivery.exe"
# When using `openssl` dependency, by default it builds the libraries inside
# `embedded/bin/`. We are copying the libs inside `bin/`.
copy "#{install_dir}/embedded/bin/ssleay32.dll", "#{install_dir}/bin/ssleay32.dll"
copy "#{install_dir}/embedded/bin/libeay32.dll", "#{install_dir}/bin/libeay32.dll"
copy "#{install_dir}/embedded/bin/zlib1.dll", "#{install_dir}/bin/zlib1.dll"
# Needed now that we switched to installed version of msys2 and have not figured out how to tell
# it how to statically link yet
dlls = ["libwinpthread-1"]
if windows_arch_i386?
dlls << "libgcc_s_dw2-1"
else
dlls << "libgcc_s_seh-1"
end
dlls.each do |dll|
mingw = ENV["MSYSTEM"].downcase
# Starting omnibus-toolchain version 1.1.115 we do not build msys2 as a part of omnibus-toolchain anymore, but pre install it in image
# so here we set the path to default install of msys2 first and default to OMNIBUS_TOOLCHAIN_INSTALL_DIR for backward compatibility
msys_path = ENV["MSYS2_INSTALL_DIR"] ? "#{ENV["MSYS2_INSTALL_DIR"]}" : "#{ENV["OMNIBUS_TOOLCHAIN_INSTALL_DIR"]}/embedded/bin"
windows_path = "#{msys_path}/#{mingw}/bin/#{dll}.dll"
if File.exist?(windows_path)
copy windows_path, "#{install_dir}/bin/#{dll}.dll"
else
raise "Cannot find required DLL needed for dynamic linking: #{windows_path}"
end
end
else
copy "#{project_dir}/target/release/delivery", "#{install_dir}/bin/delivery"
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/preparation.rb | config/software/preparation.rb | #
# Copyright 2012-2014 Chef Software, 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.
#
# expeditor/ignore: logic only
name "preparation"
description "the steps required to preprare the build"
default_version "1.0.0"
license :project_license
skip_transitive_dependency_licensing true
build do
block do
touch "#{install_dir}/embedded/lib/.gitkeep"
touch "#{install_dir}/embedded/bin/.gitkeep"
touch "#{install_dir}/bin/.gitkeep"
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/gcc.rb | config/software/gcc.rb | #
# Copyright:: Chef Software, 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.
#
# expeditor/ignore: deprecated 2022-03
# do_not_auto_update
name "gcc"
default_version "4.9.2"
dependency "gmp"
dependency "mpfr"
dependency "mpc"
dependency "libiconv"
# version_list: url=https://ftp.gnu.org/gnu/gcc/ filter=*.tar.gz
version("4.9.2") { source sha256: "3e573826ec8b0d62d47821408fbc58721cd020df3e594cd492508de487a43b5e" }
version("4.9.3") { source sha256: "e6c63b40877bc756cc7cfe6ca98013eb15f02ec6c8c2cf68e24533ad1203aaba" }
version("4.9.4") { source sha256: "1680f92781b92cbdb57d7e4f647c650678c594154cb0d707fd9a994424a9860d" }
version("5.3.0") { source sha256: "b7f5f56bd7db6f4fcaa95511dbf69fc596115b976b5352c06531c2fc95ece2f4" }
version("5.5.0") { source sha256: "3aabce75d6dd206876eced17504b28d47a724c2e430dbd2de176beb948708983" }
version("6.5.0") { source sha256: "4eed92b3c24af2e774de94e96993aadbf6761cdf7a0345e59eb826d20a9ebf73" }
version("7.5.0") { source sha256: "4f518f18cfb694ad7975064e99e200fe98af13603b47e67e801ba9580e50a07f" }
version("8.4.0") { source sha256: "41e8b145832fc0b2b34c798ed25fb54a881b0cee4cd581b77c7dc92722c116a8" }
version("9.3.0") { source sha256: "5258a9b6afe9463c2e56b9e8355b1a4bee125ca828b8078f910303bc2ef91fa6" }
version("10.2.0") { source sha256: "27e879dccc639cd7b0cc08ed575c1669492579529b53c9ff27b0b96265fa867d" }
source url: "https://mirrors.kernel.org/gnu/gcc/gcc-#{version}/gcc-#{version}.tar.gz"
relative_path "gcc-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
configure_command = ["./configure",
"--prefix=#{install_dir}/embedded",
"--disable-nls",
"--enable-languages=c,c++",
"--disable-multilib"]
command configure_command.join(" "), env: env
# gcc takes quite a long time to build (over 2 hours) so we're setting the mixlib shellout
# timeout to 4 hours. It's not great but it's required (on solaris at least, need to verify
# on any other platforms we may use this with)
# gcc also has issues on a lot of platforms when running a multithreaded job,
# so unfortunately we have to build with 1 worker :(
make env: env, timeout: 14400
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/binutils.rb | config/software/binutils.rb | #
# Copyright:: Chef Software, 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.
#
# expeditor/ignore: deprecated 2021-04
name "binutils"
default_version "2.26"
version("2.35") { source sha256: "a3ac62bae4f339855b5449cfa9b49df90c635adbd67ecb8a0e7f3ae86a058da6" }
version("2.26") { source sha256: "9615feddaeedc214d1a1ecd77b6697449c952eab69d79ab2125ea050e944bcc1" }
license "GPL-3.0"
license_file "COPYING"
license_file "COPYING.LIB"
source url: "https://ftp.gnu.org/gnu/binutils/binutils-#{version}.tar.gz"
dependency "config_guess"
relative_path "binutils-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
update_config_guess
configure_command = ["./configure",
"--prefix=#{install_dir}/embedded",
"--disable-libquadmath"]
command configure_command.join(" "), env: env
make "-j #{workers}", env: env
make "-j #{workers} install", env: env
end | ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/elasticsearch.rb | config/software/elasticsearch.rb | #
# Copyright 2020 Chef Software, 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.
#
name "elasticsearch"
default_version "5.6.16"
dependency "server-open-jre"
license "Apache-2.0"
license_file "LICENSE.txt"
skip_transitive_dependency_licensing true
source url: "https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "elasticsearch-#{version}"
version "5.6.16" do
source sha256: "6b035a59337d571ab70cea72cc55225c027ad142fbb07fd8984e54261657c77f"
end
version "6.8.22" do
source url: "https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-#{version}.tar.gz",
sha256: "836a50df324a98837dcadbc7d55782cc9525f15cc6a8aa0c657e199667ebb996"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
end
version "6.8.23" do
source url: "https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-#{version}.tar.gz",
sha256: "60e77b5ca3ce11771469bcc2e009c49c8aadb831faebd170e7abcedc16b3e36d"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
end
target_path = "#{install_dir}/embedded/elasticsearch"
build do
mkdir "#{target_path}"
delete "#{project_dir}/lib/sigar/*solaris*"
delete "#{project_dir}/lib/sigar/*sparc*"
delete "#{project_dir}/lib/sigar/*freebsd*"
delete "#{project_dir}/config"
mkdir "#{project_dir}/plugins"
# by default RPMs will not include empty directories in the final packag.e
# ES will fail to start if this dir is not present.
touch "#{project_dir}/plugins/.gitkeep"
sync "#{project_dir}/", "#{target_path}"
# Dropping a VERSION file here allows additional software definitions
# to read it to determine ES plugin compatibility.
command "echo #{version} > #{target_path}/VERSION"
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/libintl-perl.rb | config/software/libintl-perl.rb | #
# Copyright 2016 Chef Software, 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.
#
# ## libintl-perl
# libintl-perl is a localization library. Normally it would be installed
# automatically by `cpanm` when you install whatever application you want, and
# you wouldn't need an explict software definition for it. Unfortunately,
# libintl-perl changed the license from LGPLv2 to GPLv3 in version 1.24, making
# it unusable in products that cannot ship GPLv3 code. By pre-installing
# version 1.23 or earlier, it's possible to workaround the licensing change for
# now.
name "libintl-perl"
default_version "1.23" # see above before setting this to something newer
# See above. If you set the version to something above 1.23, the license data
# here will be wrong.
license "LGPL-2.1"
# This is a (seldom updated) mirror. The primary repo is at
# git://git.guido-flohr.net/perl/libintl-perl.git
license_file "https://raw.githubusercontent.com/theory/libintl-perl/a92bda4e01cdecbf7e40f78c1444a8ca22e6fdfc/COPYING.LESSER"
dependency "perl"
dependency "cpanminus"
# version_list: url=https://cpan.metacpan.org/authors/id/G/GU/GUIDO/ filter=libintl-perl-*.tar.gz
version("1.33") { source sha256: "5126eda9ccd0eeb10db82ddef63cbcaf7dbd771e78cc0fb110cc3b5a6b8679e7" }
version("1.32") { source sha256: "80108298f2564ecbfc7110a3042008e665ed00c2e155b36b0188e6c1135ceba5" }
version("1.23") { source sha256: "60da16356c2fa89a0c542c825d626c8c2811202b6002b56d8574b928a1379ffa" }
source url: "https://search.cpan.org/CPAN/authors/id/G/GU/GUIDO/libintl-perl-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "libintl-perl-#{version}"
# See https://github.com/theory/sqitch for more
build do
env = with_standard_compiler_flags(with_embedded_path)
command "cpanm -v --notest .", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/openresty.rb | config/software/openresty.rb | #
# Copyright:: Chef Software, 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.
#
name "openresty"
license "BSD-2-Clause"
license_file "README.markdown"
skip_transitive_dependency_licensing true
default_version "1.27.1.2"
dependency "pcre"
dependency "openssl"
dependency "zlib"
dependency "lua" if ppc64? || ppc64le? || s390x?
# versions_list: https://openresty.org/download/ filter=*.tar.gz
version("1.27.1.2") { source sha256: "74f076f7e364b2a99a6c5f9bb531c27610c78985abe956b442b192a2295f7548" }
version("1.25.3.1") { source sha256: "32ec1a253a5a13250355a075fe65b7d63ec45c560bbe213350f0992a57cd79df" }
version("1.21.4.2") { source sha256: "5b1eded25c1d4ed76c0336dfae50bd94d187af9c85ead244135dd5ae363b2e2a" }
version("1.21.4.1") { source sha256: "0c5093b64f7821e85065c99e5d4e6cc31820cfd7f37b9a0dec84209d87a2af99" }
version("1.21.4.1rc1") { source sha256: "1cb216bc57a253149cb5c4b815bfe00e1c0713e7355774bbc26cf306d2ff632f" }
version("1.19.9.1") { source sha256: "576ff4e546e3301ce474deef9345522b7ef3a9d172600c62057f182f3a68c1f6" }
version("1.19.3.2") { source sha256: "ce40e764990fbbeb782e496eb63e214bf19b6f301a453d13f70c4f363d1e5bb9" }
version("1.19.3.1") { source sha256: "f36fcd9c51f4f9eb8aaab8c7f9e21018d5ce97694315b19cacd6ccf53ab03d5d" }
version("1.17.8.2") { source sha256: "2f321ab11cb228117c840168f37094ee97f8f0316eac413766305409c7e023a0" }
version("1.15.8.1") { source sha256: "89a1238ca177692d6903c0adbea5bdf2a0b82c383662a73c03ebf5ef9f570842" }
version("1.13.6.2") { source sha256: "946e1958273032db43833982e2cec0766154a9b5cb8e67868944113208ff2942" }
source url: "https://openresty.org/download/openresty-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "openresty-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
env["PATH"] += "#{env["PATH"]}:/usr/sbin:/sbin"
configure = [
"./configure",
"--prefix=#{install_dir}/embedded",
"--sbin-path=#{install_dir}/embedded/sbin/nginx",
"--conf-path=#{install_dir}/embedded/conf/nginx.conf",
"--with-http_ssl_module",
"--with-debug",
"--with-http_stub_status_module",
# Building Nginx with non-system OpenSSL
# http://www.ruby-forum.com/topic/207287#902308
"--with-ld-opt=\"-L#{install_dir}/embedded/lib -Wl,-rpath,#{install_dir}/embedded/lib -lssl -lcrypto -ldl -lz\"",
"--with-cc-opt=\"-L#{install_dir}/embedded/lib -I#{install_dir}/embedded/include\"",
# Options inspired by the OpenResty Cookbook
"--with-md5-asm",
"--with-sha1-asm",
"--with-pcre-jit",
"--without-http_ssi_module",
"--without-mail_smtp_module",
"--without-mail_imap_module",
"--without-mail_pop3_module",
"--with-http_v2_module",
"--with-ipv6",
# AIO support define in Openresty cookbook. Requires Kernel >= 2.6.22
# Ubuntu 10.04 reports: 2.6.32-38-server #83-Ubuntu SMP
# However, they require libatomic-ops-dev and libaio
# '--with-file-aio',
# '--with-libatomic'
]
# Currently LuaJIT doesn't support POWER correctly so use Lua51 there instead
if ppc64? || ppc64le? || s390x?
# 1.13 breaks these; discover a workaround
if version.satisfies?(">= 1.13")
exit("ppc64? || ppc64le? || s390x? unsupported for 1.13 and greater")
else
configure << "--with-lua51=#{install_dir}/embedded/lib"
end
else
configure << "--with-luajit"
end
command configure.join(" "), env: env
make "-j #{workers}", env: env
make "install", env: env
touch "#{install_dir}/embedded/nginx/logs/.gitkeep"
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/stunnel.rb | config/software/stunnel.rb | #
# Copyright:: Chef Software, 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.
#
name "stunnel"
default_version "5.49"
# Pin stunnel to 5.49 as it's the last version that supports FIPS with standard builds.
license "GPL-2.0"
license_file "COPYING"
skip_transitive_dependency_licensing true
dependency "openssl"
# version_list: url=https://www.stunnel.org/downloads/ filter=*.tar.gz
source url: "https://www.stunnel.org/archive/5.x/stunnel-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "stunnel-#{version}"
version("5.71") { source sha256: "f023aae837c2d32deb920831a5ee1081e11c78a5d57340f8e6f0829f031017f5" }
version("5.67") { source sha256: "3086939ee6407516c59b0ba3fbf555338f9d52f459bcab6337c0f00e91ea8456" }
version("5.66") { source sha256: "558178704d1aa5f6883aac6cc5d6bbf2a5714c8a0d2e91da0392468cee9f579c" }
version("5.65") { source sha256: "60c500063bd1feff2877f5726e38278c086f96c178f03f09d264a2012d6bf7fc" }
version("5.64") { source sha256: "eebe53ed116ba43b2e786762b0c2b91511e7b74857ad4765824e7199e6faf883" }
version("5.63") { source sha256: "c74c4e15144a3ae34b8b890bb31c909207301490bd1e51bfaaa5ffeb0a994617" }
version("5.59") { source sha256: "137776df6be8f1701f1cd590b7779932e123479fb91e5192171c16798815ce9f" }
version("5.49") { source sha256: "3d6641213a82175c19f23fde1c3d1c841738385289eb7ca1554f4a58b96d955e" }
version("5.39") { source sha256: "288c087a50465390d05508068ac76c8418a21fae7275febcc63f041ec5b04dee" }
build do
env = with_standard_compiler_flags(with_embedded_path)
# Across different versions the files have been changed and a single patch cannot be applied successfully
# We have two different patches:
# * stunnel-on-windows.patch working from 5.39 to 5.60
# * stunnel-on-windows-new.patch working from 5.61 to the latest for the time being.
#
# TODO: Find a better way to patch by version
patch source: "stunnel-on-windows#{"-new" if version.satisfies?("> 5.60")}.patch", plevel: 1, env: env if windows?
configure_args = [
"--with-ssl=#{install_dir}/embedded",
"--prefix=#{install_dir}/embedded",
]
configure_args << "--enable-fips" if fips_mode?
configure(*configure_args, env: env)
if windows?
# src/mingw.mk hardcodes and assumes SSL is at /opt so we patch and use
# an env variable to redirect it to the correct location
env["WIN32_SSL_DIR_PATCHED"] = "#{install_dir}/embedded"
mingw = ENV["MSYSTEM"].downcase
target = (mingw == "mingw32" ? "mingw" : "mingw64")
# Setting the binary directory as target
bin_dir = target
# After v5.50, the binaries are created on different directory based on arch
# eg: from stunnel-5.50/src/mingw.mk
# win32_arch=win64
# bindir = ../bin/$(win32_arch)
bin_dir = (mingw == "mingw32" ? "win32" : "win64") if version.satisfies?(">= 5.50")
# Starting omnibus-toolchain version 1.1.115 we do not build msys2 as a part of omnibus-toolchain anymore, but pre install it in image
# so here we set the path to default install of msys2 first and default to OMNIBUS_TOOLCHAIN_INSTALL_DIR for backward compatibility
msys_path = ENV["MSYS2_INSTALL_DIR"] ? "#{ENV["MSYS2_INSTALL_DIR"]}" : "#{ENV["OMNIBUS_TOOLCHAIN_INSTALL_DIR"]}/embedded/bin"
make target, env: env, cwd: "#{project_dir}/src"
block "copy required windows files" do
copy_files = %W{
#{project_dir}/bin/#{bin_dir}/stunnel.exe
#{project_dir}/bin/#{bin_dir}/tstunnel.exe
#{msys_path}/#{mingw}/bin/libssp-0.dll}
copy_files.each do |file|
if File.exist?(file)
copy file, "#{install_dir}/embedded/bin/#{File.basename(file)}"
else
raise "Cannot find required file for Windows: #{file}"
end
end
end
else
make env: env
make "install", env: env
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/pg-gem.rb | config/software/pg-gem.rb | #
# Copyright 2014 Chef Software, 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.
#
name "pg-gem"
default_version "0.17.1"
license "BSD-2-Clause"
license_file "https://raw.githubusercontent.com/ged/ruby-pg/master/LICENSE"
license_file "https://raw.githubusercontent.com/ged/ruby-pg/master/BSDL"
# pg gem does not have any dependencies. We only install it from
# rubygems here.
skip_transitive_dependency_licensing true
dependency "ruby"
build do
env = with_standard_compiler_flags(with_embedded_path)
gem "install pg" \
" --version '#{version}'" \
" --bindir '#{install_dir}/embedded/bin'" \
" --no-document", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/cgi.rb | config/software/cgi.rb | #
# Copyright:: Copyright (c) Chef Software 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.
#
name "cgi"
default_version "0.3.7"
license "BSD-2-Clause"
license_file "https://github.com/ruby/cgi/blob/master/BSDL"
license_file "https://github.com/ruby/cgi/blob/master/COPYING"
dependency "ruby"
build do
env = with_standard_compiler_flags(with_embedded_path)
gem "install cgi" \
" --version '#{version}'" \
" --no-document", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/libgcc.rb | config/software/libgcc.rb | #
# Copyright 2012-2014 Chef Software, 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.
#
#
# NOTE: Instead of depending on this software definition, there is no
# reason not to include "-static-libgcc" in your LDFLAGS instead.
# That will probably be the best solution going forwards rather than
# fuss around with the dynamic linking business here.
#
# # Uncomment the following code to throw a warning when someone depends on this
# # software definition.
# Omnibus.logger.deprecated('libgcc') do
# "Please do not use the libgcc dependency, it will be removed in the " \
# "future. Compile with `--static-libgcc' instead!"
# end
# expeditor/ignore: logic only
name "libgcc"
description "On UNIX systems where we bootstrap a compiler, copy the libgcc"
default_version "0.0.1"
build do
libgcc_file = if solaris2?
"/opt/csw/lib/libgcc_s.so.1"
elsif freebsd?
"/lib/libgcc_s.so.1"
else
nil
end
if libgcc_file
if File.exist?(libgcc_file)
copy libgcc_file, "#{install_dir}/embedded/lib/"
else
raise "Cannot find libgcc -- where is your gcc compiler?"
end
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/sequel-gem.rb | config/software/sequel-gem.rb | #
# Copyright 2012-2014 Chef Software, 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.
#
# expeditor/ignore: deprecated 2021-04
name "sequel-gem"
default_version "4.47.0"
license "MIT"
license_file "https://raw.githubusercontent.com/jeremyevans/sequel/master/MIT-LICENSE"
# sequel gem does not have any dependencies. We only install it from
# rubygems here.
skip_transitive_dependency_licensing true
dependency "ruby"
build do
env = with_standard_compiler_flags(with_embedded_path)
gem "install sequel" \
" --version '#{version}'" \
" --bindir '#{install_dir}/embedded/bin'" \
" --no-document", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/ruby.rb | config/software/ruby.rb | #
# Copyright:: Copyright (c) Chef Software 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.
#
# do_not_auto_update
name "ruby"
license "BSD-2-Clause"
license_file "BSDL"
license_file "COPYING"
license_file "LEGAL"
skip_transitive_dependency_licensing true
# the default versions should always be the latest release of ruby
# if you consume this definition it is your responsibility to pin
# to the desired version of ruby. don't count on this not changing.
default_version "3.1.3"
dependency "zlib"
dependency "openssl"
dependency "libffi"
dependency "libyaml"
# we build omnibus packages on freebsd 11 and use the packages on freebsd 11, 12 and 13.
# the ruby executable has been linking to freebsds system's ncurses library files.
# freebsd 13 system's ncurses library files have a different name than freebsd 11 and 12
# which causes the ruby executable to fail.
# adding ncurses as a dependency for freebsd prevents the ruby executable from linking to the
# system's ncurses library files thereby allowing the package built on freebsd 11 to work on freebsd 13.
dependency "ncurses" if freebsd?
# version_list: url=https://cache.ruby-lang.org/pub/ruby/ filter=*.tar.gz
version("3.3.1") { source sha256: "8dc2af2802cc700cd182d5430726388ccf885b3f0a14fcd6a0f21ff249c9aa99" }
version("3.3.0") { source sha256: "96518814d9832bece92a85415a819d4893b307db5921ae1f0f751a9a89a56b7d" }
version("3.2.2") { source sha256: "96c57558871a6748de5bc9f274e93f4b5aad06cd8f37befa0e8d94e7b8a423bc" }
version("3.2.0") { source sha256: "daaa78e1360b2783f98deeceb677ad900f3a36c0ffa6e2b6b19090be77abc272" }
version("3.1.7") { source sha256: "0556acd69f141ddace03fa5dd8d76e7ea0d8f5232edf012429579bcdaab30e7b" }
version("3.1.6") { source sha256: "0d0dafb859e76763432571a3109d1537d976266be3083445651dc68deed25c22" }
version("3.1.5") { source sha256: "3685c51eeee1352c31ea039706d71976f53d00ab6d77312de6aa1abaf5cda2c5" }
version("3.1.4") { source sha256: "a3d55879a0dfab1d7141fdf10d22a07dbf8e5cdc4415da1bde06127d5cc3c7b6" }
version("3.1.3") { source sha256: "5ea498a35f4cd15875200a52dde42b6eb179e1264e17d78732c3a57cd1c6ab9e" }
version("3.1.2") { source sha256: "61843112389f02b735428b53bb64cf988ad9fb81858b8248e22e57336f24a83e" }
version("3.1.1") { source sha256: "fe6e4782de97443978ddba8ba4be38d222aa24dc3e3f02a6a8e7701c0eeb619d" }
version("3.0.6") { source sha256: "6e6cbd490030d7910c0ff20edefab4294dfcd1046f0f8f47f78b597987ac683e" }
version("3.0.5") { source sha256: "9afc6380a027a4fe1ae1a3e2eccb6b497b9c5ac0631c12ca56f9b7beb4848776" }
version("3.0.4") { source sha256: "70b47c207af04bce9acea262308fb42893d3e244f39a4abc586920a1c723722b" }
version("3.0.3") { source sha256: "3586861cb2df56970287f0fd83f274bd92058872d830d15570b36def7f1a92ac" }
version("3.0.2") { source sha256: "5085dee0ad9f06996a8acec7ebea4a8735e6fac22f22e2d98c3f2bc3bef7e6f1" }
version("3.0.1") { source sha256: "369825db2199f6aeef16b408df6a04ebaddb664fb9af0ec8c686b0ce7ab77727" }
source url: "https://cache.ruby-lang.org/pub/ruby/#{version.match(/^(\d+\.\d+)/)[0]}/ruby-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
# In order to pass notarization we need to sign any binaries and libraries included in the package.
# This makes sure we include and bins and libs that are brought in by gems.
semver = Gem::Version.create(version).segments
ruby_mmv = "#{semver[0..1].join(".")}.0"
ruby_dir = "#{install_dir}/embedded/lib/ruby/#{ruby_mmv}"
gem_dir = "#{install_dir}/embedded/lib/ruby/gems/#{ruby_mmv}"
bin_dirs bin_dirs.concat ["#{gem_dir}/gems/*/bin/**"]
lib_dirs ["#{ruby_dir}/**", "#{gem_dir}/extensions/**", "#{gem_dir}/gems/*", "#{gem_dir}/gems/*/lib/**", "#{gem_dir}/gems/*/ext/**"]
relative_path "ruby-#{version}"
env = with_standard_compiler_flags(with_embedded_path)
if mac_os_x?
# -Qunused-arguments suppresses "argument unused during compilation"
# warnings. These can be produced if you compile a program that doesn't
# link to anything in a path given with -Lextra-libs. Normally these
# would be harmless, except that autoconf treats any output to stderr as
# a failure when it makes a test program to check your CFLAGS (regardless
# of the actual exit code from the compiler).
arch = intel? ? "x86_64" : "arm64"
env["CFLAGS"] << " -I#{install_dir}/embedded/include/ncurses -arch #{arch} -m64 -O3 -g -pipe -Qunused-arguments"
env["LDFLAGS"] << " -arch #{arch}"
elsif freebsd?
# Stops "libtinfo.so.5.9: could not read symbols: Bad value" error when
# compiling ext/readline. See the following for more info:
#
# https://lists.freebsd.org/pipermail/freebsd-current/2013-October/045425.html
# http://mailing.freebsd.ports-bugs.narkive.com/kCgK8sNQ/ports-183106-patch-sysutils-libcdio-does-not-build-on-10-0-and-head
#
env["LDFLAGS"] << " -ltinfow"
elsif aix?
# this magic per IBM
env["LDSHARED"] = "xlc -G"
env["CFLAGS"] = "-I#{install_dir}/embedded/include/ncurses -I#{install_dir}/embedded/include"
# this magic per IBM
env["XCFLAGS"] = "-DRUBY_EXPORT"
# need CPPFLAGS set so ruby doesn't try to be too clever
env["CPPFLAGS"] = "-I#{install_dir}/embedded/include/ncurses -I#{install_dir}/embedded/include"
env["SOLIBS"] = "-lm -lc"
# need to use GNU m4, default m4 doesn't work
env["M4"] = "/opt/freeware/bin/m4"
elsif solaris2?
env["CXXFLAGS"] = "#{env["CXXFLAGS"]} -std=c++0x"
elsif windows?
# this forces ruby >= 3.0 to pick up the gcc in the devkit rather than the cc in /opt/omnibus-toolchain
# which is necessary for mkmf.rb to be able to correctly build native gems. in an ideal world the compilation
# environment in omnibus-toolchain would probably need to look a little more identical to the devkit.
env["CC"] = "gcc"
env["CFLAGS"] = "-I#{install_dir}/embedded/include -DFD_SETSIZE=2048"
if windows_arch_i386?
env["CFLAGS"] << " -m32 -march=i686 -O3"
else
env["CFLAGS"] << " -m64 -march=x86-64 -O3"
end
env["CPPFLAGS"] = env["CFLAGS"]
env["CXXFLAGS"] = env["CFLAGS"]
else
# including linux
env["CFLAGS"] << " -O3 -g -pipe"
end
build do
# AIX needs /opt/freeware/bin only for patch
patch_env = env.dup
patch_env["PATH"] = "/opt/freeware/bin:#{env["PATH"]}" if aix?
if version.satisfies?("~> 3.0.0")
case version
when "3.0.1"
patch source: "ruby-3.0.1-configure.patch", plevel: 1, env: patch_env
when "3.0.5", "3.0.6"
patch source: "ruby-3.0.5-configure.patch", plevel: 1, env: patch_env
else
patch source: "ruby-3.0.2-configure.patch", plevel: 1, env: patch_env
end
end
# remove the warning that the win32 api is going away.
if windows? && version.satisfies?("< 3.0")
patch source: "ruby-win32_warning_removal.patch", plevel: 1, env: patch_env
end
# We fixed a bug regarding Windows fqdn resolution in Ohai on the 17-stable branch.
# That Ohai update requires the Resolv class. The 'resolv' class unconditionally
# loads the Win32::Registry class as a dependency.
# Chef Infra already loads Win32::Registry and has a monkeypatch for the export_string method.
# When the Resolv class loads again in Ohai, it overwrites the monkeypatch and that
# leads to registry encoding/decoding errors - Base Ruby classes return text encoded in
# UTF-16LE format and we need UTF-8.
# Here we patch the Ruby Win32/Reolv.rb file to make reloading the Win32::Registry class
# conditional and therefore prevent the monkeypatch from being overwritten.
if windows? && version.satisfies?("~> 3.0.0")
patch source: "ruby-win32_resolv.patch", plevel: 0, env: patch_env
end
# Prior to Chef-18, we had been monkeypatching the registry.rb to solve a registry encoding
# problem. We had to move that patch here. We also patch the resolv class here as insurance.
if windows? && version.satisfies?("~> 3.1")
patch source: "ruby-win32_registry.patch", plevel: 1, env: patch_env
patch source: "ruby-win32_resolv.patch", plevel: 0, env: patch_env
end
if suse? && version.satisfies?("= 3.1.4")
patch source: "ruby-3.1.4-configure.patch", plevel: 1, env: patch_env
end
if suse? && version.satisfies?(">= 3.1.6")
patch source: "ruby-3.1.6-configure.patch", plevel: 1, env: patch_env
end
# RHEL6 has a base compiler that does not support -fstack-protector-strong, but we
# cannot build modern ruby on the RHEL6 base compiler, and the configure script
# determines that it supports that flag and so includes it and then ultimately
# pushes that into native gem compilations which then blows up for end users when
# they try to install native gems. So, we have to hack this up to avoid using
# that flag on RHEL6.
#
if rhel? && platform_version.satisfies?("< 7")
patch source: "ruby-no-stack-protector-strong.patch", plevel: 1, env: patch_env
else
if rhel? && platform_version.satisfies?(">=7")
if version.satisfies?("= 3.1.4")
patch source: "ruby-3.1.4-configure.patch", plevel: 1, env: patch_env
elsif version.satisfies?(">= 3.1.6")
patch source: "ruby-3.1.6-configure.patch", plevel: 1, env: patch_env
end
end
end
# accelerate requires of c-extension.
#
# this would break code which did `require "thing"` and loaded thing.so and
# then fiddled with the libpath and did `require "thing"` and loaded thing.rb
# over the top of it. AFAIK no sane ruby code should need to do that, and the
# cost of this behavior in core ruby is enormous.
#
if version.satisfies?("< 3.1")
patch source: "ruby-fast-load_26.patch", plevel: 1, env: patch_env
else
patch source: "ruby-fast-load_31.patch", plevel: 1, env: patch_env
end
# this removes a checks for windows nano in the win32-ole files.
# windows nano is a dead platform and not supported by chef so we can avoid
# registry lookups by patching away this code
if windows?
patch source: "remove_nano.patch", plevel: 1, env: patch_env
end
# accelerate requires by removing a File.expand_path
#
# the expand_path here seems to be largely useless and produces a large amount
# of lstat(2) calls on unix, and increases the runtime of a chef-client --version
# test by 33% on windows. on modern linuxen that have openat(2) it is totally
# useless. this patch breaks no built-in tests on ruby on old platforms, and
# it is unclear why or if it is necessary (hand crafted tests designed to try to
# abuse it all succeeded after this test).
#
if version.satisfies?("~> 2.6.0")
patch source: "ruby-faster-load_26.patch", plevel: 1, env: patch_env
end
if version.satisfies?(">=3.3")
patch source: "ruby-faster-load_33.patch", plevel: 1, env: patch_env
else
if version.satisfies?(">= 2.7")
patch source: "ruby-faster-load_27.patch", plevel: 1, env: patch_env
end
end
if freebsd? && version.satisfies?("~> 3.0.3")
patch source: "ruby-3.0.3-freebsd_13.patch", plevel: 1, env: patch_env
end
# disable libpath in mkmf across all platforms, it trolls omnibus and
# breaks the postgresql cookbook. i'm not sure why ruby authors decided
# this was a good idea, but it breaks our use case hard. AIX cannot even
# compile without removing it, and it breaks some native gem installs on
# other platforms. generally you need to have a condition where the
# embedded and non-embedded libs get into a fight (libiconv, openssl, etc)
# and ruby trying to set LD_LIBRARY_PATH itself gets it wrong.
#
# Also, fix paths emitted in the makefile on windows on both msys and msys2.
patch source: "ruby-mkmf.patch", plevel: 1, env: patch_env
configure_command = ["--with-out-ext=dbm,readline",
"--enable-shared",
"--disable-install-doc",
"--without-gmp",
"--without-gdbm",
"--without-tk",
"--disable-dtrace",
"--disable-jit-support"]
configure_command << "--with-bundled-md5" if fips_mode?
# resolve C99 code accidentally introduced in Ruby 2.6.7 and it's still in 2.6.8 :(
patch source: "ruby-2.6.7_c99.patch", plevel: 1, env: patch_env if version.satisfies?("~> 2.6.7", "< 2.6.10")
if aix?
# need to patch ruby's configure file so it knows how to find shared libraries
patch source: "ruby-aix-configure_26_and_later.patch", plevel: 1, env: patch_env
# have ruby use zlib on AIX correctly
patch source: "ruby_aix_openssl.patch", plevel: 1, env: patch_env
# AIX has issues with ssl retries, need to patch to have it retry
patch source: "ruby_aix_ssl_EAGAIN.patch", plevel: 1, env: patch_env
# the next two patches are because xlc doesn't deal with long vs int types well
patch source: "ruby-aix-atomic.patch", plevel: 1, env: patch_env if version.satisfies?("< 3.0")
patch source: "ruby-aix-vm-core.patch", plevel: 1, env: patch_env if version.satisfies?("< 3.0")
# per IBM, just enable pthread
configure_command << "--enable-pthread"
elsif freebsd?
# Disable optional support C level backtrace support. This requires the
# optional devel/libexecinfo port to be installed.
configure_command << "ac_cv_header_execinfo_h=no"
configure_command << "--with-opt-dir=#{install_dir}/embedded"
elsif smartos?
# Patches taken from RVM.
# http://bugs.ruby-lang.org/issues/5384
# https://www.illumos.org/issues/1587
# https://github.com/wayneeseguin/rvm/issues/719
patch source: "rvm-cflags.patch", plevel: 1, env: patch_env
# From RVM forum
# https://github.com/wayneeseguin/rvm/commit/86766534fcc26f4582f23842a4d3789707ce6b96
configure_command << "ac_cv_func_dl_iterate_phdr=no"
configure_command << "--with-opt-dir=#{install_dir}/embedded"
elsif solaris2?
# In ruby-2.5.0 on Solaris 11 Random.urandom defaults to arc4random_buf() as
# its implementation which is buggy and returns nothing but zeros. We therefore
# force that API off.
configure_command << "ac_cv_func_arc4random_buf=no"
elsif windows?
configure_command << "debugflags=-g"
configure_command << "--with-winnt-ver=0x0602" # the default is 0x0600 which is Vista. 602 is Windows 8 (2012)
else
configure_command << "--with-opt-dir=#{install_dir}/embedded"
end
# Remove this if clause once Ruby < 3.1 is not supported in combination with
# OpenSSL >= 3.0
# if (version.satisfies?("< 3.1") || fips_mode?) &&
if version.satisfies?("< 3.1") &&
project.overrides[:openssl] &&
ChefUtils::VersionString.new(project.overrides[:openssl][:version]).satisfies?(">= 3.0")
configure_command << "--without-openssl --with-openssl-dir=#{install_dir}/embedded"
end
# FFS: works around a bug that infects AIX when it picks up our pkg-config
# AFAIK, ruby does not need or use this pkg-config it just causes the build to fail.
# The alternative would be to patch configure to remove all the pkg-config garbage entirely
env["PKG_CONFIG"] = "/bin/true" if aix?
configure(*configure_command, env: env)
make "-j #{workers}", env: env
make "-j #{workers} install", env: env
# set this here because two different clauses might use it
openssl_gem_version = project.overrides.dig(:ruby, :openssl_gem) || "3.3.0"
# Remove this if clause once Ruby < 3.1 is not supported in combination with
# OpenSSL >= 3.0
if (version.satisfies?("< 3.1") || fips_mode?) &&
project.overrides[:openssl] &&
ChefUtils::VersionString.new(project.overrides[:openssl][:version]).satisfies?(">= 3.0")
# use the same version as ruby 3.1.2 version has as default, so that the chef gemfile inclusion of the
# same openssl gem version is redundant for ruby 3.1[.2] projects
command "curl https://rubygems.org/downloads/openssl-#{openssl_gem_version}.gem --output openssl-#{openssl_gem_version}.gem"
# add OPENSSL_FIPS to the environment _if_ fips is active
fips_env = fips_mode? ? env.merge({ "OPENSSL_FIPS" => "1" }) : env
command "git clone https://github.com/ruby/openssl.git", cwd: "#{install_dir}"
# Checkout the specific tag for version 3.3.0
command "cd #{install_dir}/openssl && git checkout tags/v3.3.0"
command "gem build openssl.gemspec", cwd: "#{install_dir}/openssl"
command "gem install openssl-#{openssl_gem_version}.gem --no-document -- --with-openssl-dir=#{install_dir}/embedded", env: fips_env, cwd: "#{install_dir}/openssl"
command "#{install_dir}/embedded/bin/gem info openssl"
end
(project.overrides.dig(:ruby, :unbundle_gems) || []).each do |gem|
command "#{install_dir}/embedded/bin/gem uninstall --force -x --all #{gem}", returns: [0, 1]
end
if windows?
# Needed now that we switched to msys2 and have not figured out how to tell
# it how to statically link yet
dlls = [
"libwinpthread-1",
"libstdc++-6",
"libssp-0",
]
if windows_arch_i386?
dlls << "libgcc_s_dw2-1"
else
dlls << "libgcc_s_seh-1"
end
dlls.each do |dll|
mingw = ENV["MSYSTEM"].downcase
# Starting omnibus-toolchain version 1.1.115 we do not build msys2 as a part of omnibus-toolchain anymore, but pre install it in image
# so here we set the path to default install of msys2 first and default to OMNIBUS_TOOLCHAIN_INSTALL_DIR for backward compatibility
msys_path = ENV["MSYS2_INSTALL_DIR"] ? "#{ENV["MSYS2_INSTALL_DIR"]}" : "#{ENV["OMNIBUS_TOOLCHAIN_INSTALL_DIR"]}/embedded/bin"
windows_path = "#{msys_path}/#{mingw}/bin/#{dll}.dll"
if File.exist?(windows_path)
copy windows_path, "#{install_dir}/embedded/bin/#{dll}.dll"
else
raise "Cannot find required DLL needed for dynamic linking: #{windows_path}"
end
end
%w{ erb gem irb rdoc ri bundle }.each do |cmd|
copy "#{project_dir}/bin/#{cmd}", "#{install_dir}/embedded/bin/#{cmd}"
end
# Ruby seems to mark rake.bat as read-only.
# Mark it as writable so that we can install other version of rake without
# running into permission errors.
command "attrib -r #{install_dir}/embedded/bin/rake.bat"
end
if fips_mode?
puts "Validating FIPS_MODE build"
if windows?
puts "Finding all the rubies installed and checking their fips_mode status"
find_command = %{
Get-ChildItem c:/opscode -include 'ruby.exe' -recurse | ForEach-Object {
& $_ -e "require 'openssl'; puts OpenSSL::OPENSSL_VERSION_NUMBER.to_s(16); puts OpenSSL::OPENSSL_LIBRARY_VERSION; OpenSSL.fips_mode = 1; puts 'FIPS mode successfully activated for Ruby' + RUBY_VERSION"
}
Write-Output "done looking at rubies"
}
else
find_command = %{
find /opt -name 'ruby' | grep 'bin/ruby' | while read ruby; do
echo "Checking $ruby"
sum $ruby
$ruby -v -e "require 'openssl'; puts OpenSSL::OPENSSL_VERSION_NUMBER.to_s(16); puts OpenSSL::OPENSSL_LIBRARY_VERSION; OpenSSL.fips_mode = 1; puts 'FIPS mode successfully activated for Ruby '+ RUBY_VERSION"
done
echo "done looking at rubies"
}
end
command find_command
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/perl_pg_driver.rb | config/software/perl_pg_driver.rb | #
# Copyright 2014 Chef Software, 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.
#
name "perl_pg_driver"
default_version "3.16.0"
dependency "perl"
dependency "cpanminus"
dependency "postgresql"
license "Artistic"
license_file "README"
license_file "LICENSES/artistic.txt"
# version_list: url=https://cpan.metacpan.org/authors/id/T/TU/TURNSTEP/ filter=*.tar.gz
version("3.17.0") { source sha256: "8d900d4c0e749f37218752a6661fb0d3557ab1fccc8dea384cb587c382de219b" }
version("3.16.0") { source sha256: "2c31163d8bdaaf8beaef9c97b8f260432d67a534bc7b69e7265c21cb841432b8" }
version("3.15.1") { source sha256: "13c7543b545c9a5253c86550ccd9204d06fe5f34a7dc51769d3dd665563fc17e" }
version("3.15.0") { source sha256: "69cc19870f9d935f16530be39d0ed60afadc5e560e29c3a17af4498e7e3082d9" }
version("3.14.2") { source sha256: "c973e98458960a78ec54032a71b3840f178418dd7e69d063e462a0f10ec68e4d" }
version("3.5.3") { source sha256: "7e98a9b975256a4733db1c0e974cad5ad5cb821489323e395ed97bd058e0a90e" }
version("3.3.0") { source sha256: "52f43de5b2d916d447d7ed252b127f728b226dc88db57d4fe9712e21d3586ffe" }
source url: "https://search.cpan.org/CPAN/authors/id/T/TU/TURNSTEP/DBD-Pg-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "DBD-Pg-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
command "cpanm -v --notest .", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/libxcrypt.rb | config/software/libxcrypt.rb | #
# Copyright:: Chef Software, 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.
#
name "libxcrypt"
default_version "4.4.38" # Updated for modern .so.2 implementation
license "LGPL-2.1"
license_file "COPYING.LIB"
skip_transitive_dependency_licensing true
version("4.4.38") { source sha256: "80304b9c306ea799327f01d9a7549bdb28317789182631f1b54f4511b4206dd6" }
version("4.4.36") { source sha256: "e5e1f4caee0a01de2aee26e3138807d6d3ca2b8e67287966d1fefd65e1fd8943" }
source url: "https://github.com/besser82/libxcrypt/releases/download/v#{version}/libxcrypt-#{version}.tar.xz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.xz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "libxcrypt-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
configure_command = [
"./configure",
"--prefix=#{install_dir}/embedded",
"--disable-werror",
"--enable-obsolete-api=no",
"--disable-static",
"--with-pic",
]
command configure_command.join(" "), env: env
make "-j #{workers}", env: env
make "install", env: env
# Post-install verification
command "readelf -d #{install_dir}/embedded/lib/libcrypt.so | grep 'SONAME.*libcrypt.so.2'", env: env
# command "objdump -T #{install_dir}/embedded/lib/libcrypt.so | grep 'GLIBC_2.2.5.*crypt_r'", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/nodejs-binary.rb | config/software/nodejs-binary.rb | #
# Copyright 2016 Chef Software, 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.
#
#
# nodejs-binary provides nodejs using the binary packages provided by
# the upstream. It does not install it into any of our standard
# paths, so builds that require nodejs need to add embedded/nodejs/bin
# to their path.
#
# Since nodejs is often a build-time-only dependency, it can then be
# easily removed with remove-nodejs.
#
name "nodejs-binary"
default_version "6.7.0"
license "MIT"
license_file "LICENSE"
skip_transitive_dependency_licensing true
version "6.7.0" do
source_hash = if ppc64le?
"de8e4ca71caa8be6eaf80e65b89de2a6d152fa4ce08efcbc90ce7e1bfdf130e7"
elsif ppc64?
"e8ce540b592d337304a10f4eb19bb4efee889c6676c5f188d072bfb2a8089927"
elsif s390x?
"e0f2616b4beb4c2505edb19e3cbedbf3d1c958441517cc9a1e918f6feaa4b95b"
else
"abe81b4150917cdbbeebc6c6b85003b80c972d32c8f5dfd2970d32e52a6877af"
end
source sha256: source_hash
end
# These are the last versions of their series that provide both ppc64 and ppc64le versions
version "8.9.1" do
source_hash = if ppc64le?
"d3e11a9ef301afdecb10ed26470492fd03402b86bf9efc3f89a9aef541bf9a2c"
elsif ppc64?
"7ab8c4bf36364624b6bc7610319f1e2c32a7c882aa6392ce285faaee39597dce"
elsif s390x?
"48160ddaa7397cf85ca0cf333cc87dc3485956c75a3cdf98f04735bb81b37da6"
else # x64
"0e49da19cdf4c89b52656e858346775af21f1953c308efbc803b665d6069c15c"
end
source sha256: source_hash
end
# These are the last versions of their series that provide both ppc64 and ppc64le versions
version "9.2.0" do
source_hash = if ppc64le?
"9a173db0c0b88dcddf08542736c597c87bf86d536df8fa65a4fdff75e7bb4243"
elsif ppc64?
"34b3d6d7e6036e38aacab6754f55711ac9582a3d963a06f5f75e07e2d986d2a2"
elsif s390x?
"c5f6315da901bbb54ffa0b23b58cd0b46f0ebfbe2a4f1847ec1d330602000bfd"
else # x64
"36ef2b3d1a99555390835d6fd4ad194a769df6841cbcc46cba0dffbaf6e6aa34"
end
source sha256: source_hash
end
arch_ext = if ppc64le?
"ppc64le"
elsif ppc64?
"ppc64"
elsif s390x?
"s390x"
else
"x64"
end
source url: "https://nodejs.org/dist/v#{version}/node-v#{version}-linux-#{arch_ext}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "node-v#{version}-linux-#{arch_ext}"
build do
mkdir "#{install_dir}/embedded/nodejs"
sync "#{project_dir}/", "#{install_dir}/embedded/nodejs"
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/rabbitmq.rb | config/software/rabbitmq.rb | #
# Copyright 2012-2014 Chef Software, 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.
#
# expeditor/ignore: deprecated 2021-04
name "rabbitmq"
default_version "3.6.6"
license "MPL-2.0"
license_file "LICENSE"
skip_transitive_dependency_licensing true
dependency "erlang"
version("3.7.6") { source md5: "d8db2d979a66e520b23be29d9b43af70" }
version("3.6.15") { source md5: "1dd9a5d000e11064efec23c1a76e5d5c" }
version("3.6.0") { source md5: "61a3822f3af0aaa30da7230dccb17067" }
version("3.3.4") { source md5: "61a3822f3af0aaa30da7230dccb17067" }
version("2.8.7") { source md5: "35e8d78f8d7ae4372db23fe50db82c64" }
version("2.7.1") { source md5: "34a5f9fb6f22e6681092443fcc80324f" }
version("3.7.6") do
source(sha256: "23e61ec405fea9903c2de9532013feb124a5bc667a43a010c949276eda17e1d4",
url: "https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.6/rabbitmq-server-generic-unix-3.7.6.tar.xz" )
end
version("3.6.15") do
source(sha256: "04e6a291642f80e87fc892d5e8ea309fb3fab85ebb64a79a70dfe6c6cfde36fb",
url: "https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.15/rabbitmq-server-generic-unix-3.6.15.tar.xz" )
end
version("3.6.6") do
source(sha256: "781d17a6c8bbfbcd749d23913218de38e692a5e3093cf47eecf499532ac25d61",
url: "http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.6/rabbitmq-server-generic-unix-3.6.6.tar.xz" )
end
relative_path "rabbitmq_server-#{version}"
build do
mkdir "#{install_dir}/embedded/service/rabbitmq"
sync "#{project_dir}/", "#{install_dir}/embedded/service/rabbitmq/"
%w{rabbitmqctl rabbitmq-env rabbitmq-server}.each do |bin|
link "#{install_dir}/embedded/service/rabbitmq/sbin/#{bin}", "#{install_dir}/embedded/bin/#{bin}"
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/libyajl2-gem.rb | config/software/libyajl2-gem.rb | #
# Copyright 2012-2014 Chef Software, 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.
#
# expeditor/ignore: deprecated 2021-04
name "libyajl2-gem"
default_version "main"
relative_path "libyajl2-gem"
source git: "https://github.com/chef/libyajl2-gem.git"
license "Apache-2.0"
license_file "LICENSE"
dependency "ruby"
build do
env = with_embedded_path
command "git submodule init", env: env
command "git submodule update", env: env
bundle "config set --local without development_extras", env: env
bundle "install", env: env
bundle "exec rake prep", env: env
bundle "exec rake gem", env: env
delete "pkg/*java*"
gem "install pkg/libyajl2-*.gem" \
" --no-document", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/cpanminus.rb | config/software/cpanminus.rb | #
# Copyright 2014 Chef Software, 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.
#
name "cpanminus"
default_version "1.7046"
license "Artistic-2.0"
license_file "http://dev.perl.org/licenses/artistic.html"
skip_transitive_dependency_licensing true
dependency "perl"
# version_list: url=https://metacpan.org/pod/App::cpanminus filter=*.tar.gz
version("1.7046") { source sha256: "cefc58349f9f741aba82b8ed3d672265b53ca4e4183f72613fce06d6ab97d30c" }
version("1.7045") { source sha256: "f2ab7e18a695960ac07f072b369c1bf113ae278bf81aa807b3f4bdaf098df34d" }
version("1.7040") { source sha256: "48a747c040689445f7db0edd169da0abd709a37cfece3ceecff0816c09beab0e" }
version("1.7004") { source sha256: "5cef499d12418a877c68070fc14193bd700d47a286d95e16c517f9673493af79" }
source url: "https://github.com/miyagawa/cpanminus/archive/#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "cpanminus-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
command "cat cpanm | perl - App::cpanminus", env: env
end
# Perl after 5.18 does not come with this by default
build do
env = with_standard_compiler_flags(with_embedded_path)
command "cpanm Module::Build", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/rb-readline.rb | config/software/rb-readline.rb | #
# Copyright 2012-2016 Chef Software, 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.
#
# expeditor/ignore: deprecated 2021-04
name "rb-readline"
default_version "master"
license "BSD-3-Clause"
license_file "LICENSE"
skip_transitive_dependency_licensing true
dependency "ruby"
source git: "https://github.com/ConnorAtherton/rb-readline.git"
build do
env = with_embedded_path
ruby "setup.rb", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/rust.rb | config/software/rust.rb | #
# Copyright 2016-2019 Chef Software, 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.
#
# expeditor/ignore: deprecated 2022-02
name "rust"
default_version "1.37.0"
license "Apache-2.0"
license_file "LICENSE-APACHE"
# Nightly releases use a slighty different URL and TARBALL naming convention
if version =~ /\d{4}-\d{2}-\d{2}/
relative_path_template = "rust-nightly-%{arch}-%{host_triple}"
url_template = "https://static.rust-lang.org/dist/#{version}/rust-nightly-%{arch}-%{host_triple}.tar.gz"
else
relative_path_template = "rust-#{version}-%{arch}-%{host_triple}"
url_template = "https://static.rust-lang.org/dist/rust-#{version}-%{arch}-%{host_triple}.tar.gz"
end
# Default architecture is x86_64
arch = "x86_64"
if windows?
host_triple = "pc-windows-gnu"
if windows_arch_i386?
arch = "i686"
version "1.37.0" do
source sha256: "52ad8448fd612b50ade0dd2a957115a2e386d1f34a81341b787018f26df0c307",
url: url_template % { host_triple: host_triple, arch: arch }
end
version "1.32.0" do
source sha256: "226b00e61095fe1b8a7f1f186087731a294235b4da53601b709517ca9dc624f0",
url: url_template % { host_triple: host_triple, arch: arch }
end
else
version "1.37.0" do
source sha256: "607ecc8c1f9886956ca694a65fcc096bfe00c7776a5e88bb947786e941752e68",
url: url_template % { host_triple: host_triple, arch: arch }
end
version "1.32.0" do
source sha256: "358e1435347c67dbf33aa9cad6fe501a833d6633ed5d5aa1863d5dffa0349be9",
url: url_template % { host_triple: host_triple, arch: arch }
end
end
elsif mac_os_x?
host_triple = "apple-darwin"
version "1.37.0" do
source sha256: "b2310c97ffb964f253c4088c8d29865f876a49da2a45305493af5b5c7a3ca73d",
url: url_template % { host_triple: host_triple, arch: arch }
end
version "1.32.0" do
source sha256: "f0dfba507192f9b5c330b5984ba71d57d434475f3d62bd44a39201e36fa76304",
url: url_template % { host_triple: host_triple, arch: arch }
end
else
host_triple = "unknown-linux-gnu"
version "1.37.0" do
source sha256: "cb573229bfd32928177c3835fdeb62d52da64806b844bc1095c6225b0665a1cb",
url: url_template % { host_triple: host_triple, arch: arch }
end
version "1.32.0" do
source sha256: "e024698320d76b74daf0e6e71be3681a1e7923122e3ebd03673fcac3ecc23810",
url: url_template % { host_triple: host_triple, arch: arch }
end
end
relative_path relative_path_template % { host_triple: host_triple, arch: arch }
build do
env = with_standard_compiler_flags(with_embedded_path)
command "sh install.sh" \
" --prefix=#{install_dir}/embedded" \
" --verbose", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/zlib.rb | config/software/zlib.rb | #
# Copyright 2012-2018 Chef Software, 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.
#
name "zlib"
default_version "1.2.13"
# version_list: url=https://zlib.net/fossils/ filter=*.tar.gz
version("1.3.1") { source sha256: "9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23" }
version("1.3") { source sha256: "ff0ba4c292013dbc27530b3a81e1f9a813cd39de01ca5e0f8bf355702efa593e" }
version("1.2.13") { source sha256: "b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30" }
version("1.2.12") { source sha256: "91844808532e5ce316b3c010929493c0244f3d37593afd6de04f71821d5136d9" }
version("1.2.11") { source sha256: "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1" }
version("1.2.8") { source sha256: "36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d" }
version("1.2.6") { source sha256: "21235e08552e6feba09ea5e8d750805b3391c62fb81c71a235c0044dc7a8a61b" }
source url: "https://zlib.net/fossils/zlib-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
license "Zlib"
license_file "README"
skip_transitive_dependency_licensing true
relative_path "zlib-#{version}"
build do
if windows?
env = with_standard_compiler_flags(with_embedded_path)
patch source: "zlib-windows-relocate.patch", env: env
# We can't use the top-level Makefile. Instead, the developers have made
# an organic, artisanal, hand-crafted Makefile.gcc for us which takes a few
# variables.
env["BINARY_PATH"] = "/bin"
env["LIBRARY_PATH"] = "/lib"
env["INCLUDE_PATH"] = "/include"
env["DESTDIR"] = "#{install_dir}/embedded"
make_args = [
"-fwin32/Makefile.gcc",
"SHARED_MODE=1",
"CFLAGS=\"#{env["CFLAGS"]} -Wall\"",
"ASFLAGS=\"#{env["CFLAGS"]} -Wall\"",
"LDFLAGS=\"#{env["LDFLAGS"]}\"",
# The win32 makefile for zlib does not handle parallel make correctly.
# In particular, see its rule for IMPLIB and SHAREDLIB. The ld step in
# SHAREDLIB will generate both the dll and the dll.a files. The step to
# strip the dll occurs next but since the dll.a file is already present,
# make will attempt to link example_d.exe and minigzip_d.exe in parallel
# with the strip step - causing gcc to freak out when a source file is
# rewritten part way through the linking stage.
# "-j #{workers}",
]
make(*make_args, env: env)
make("install", *make_args, env: env)
else
# We omit the omnibus path here because it breaks mac_os_x builds by picking
# up the embedded libtool instead of the system libtool which the zlib
# configure script cannot handle.
# TODO: Do other OSes need this? Is this strictly a mac thing?
env = with_standard_compiler_flags
if freebsd? || solaris2?
# FreeBSD 10+ gets cranky if zlib is not compiled in a
# position-independent way.
# zlib 1.2.12 introduced the same problem on Solaris.
env["CFLAGS"] << " -fPIC"
end
configure env: env
make "-j #{workers}", env: env
make "-j #{workers} install", env: env
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/openssl-fips.rb | config/software/openssl-fips.rb | #
# Copyright 2014-2019 Chef Software, 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.
#
name "openssl-fips"
default_version "2.0.16"
license "OpenSSL"
license_file "https://www.openssl.org/source/license.html"
skip_transitive_dependency_licensing true
# HAHAHA According to the FIPS manual, you need to "securely" fetch the source
# such as asking some humans to mail you a CD-ROM or something.
# You are then supposed to manually verify the PGP signatures.
# When making an "official" build - make sure you go do that...
source url: "https://www.openssl.org/source/old/fips/openssl-fips-#{version}.tar.gz", extract: :lax_tar
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz", extract: :lax_tar,
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
version("2.0.16") {
source sha256: "a3cd13d0521d22dd939063d3b4a0d4ce24494374b91408a05bdaca8b681c63d4", \
url: "https://www.openssl.org/source/openssl-fips-#{version}.tar.gz", extract: :lax_tar
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz", extract: :lax_tar,
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
}
version("2.0.14") { source sha256: "8ea069ec39f9c49d85b9831b16daa29936b4527446998336cf93e575f07626c0" }
version("2.0.11") { source sha256: "a6532875956d357a05838ca2c9865b8eecac211543e4246512684b17acbbdfac" }
version("2.0.10") { source sha256: "a42ccf5f08a8b510c0c78da1ba889532a0ce24e772b576604faf09b4d6a0f771" }
version("2.0.9") { source md5: "c8256051d7a76471c6ad4fb771404e60" }
relative_path "openssl-fips-#{version}"
build do
# According to the FIPS manual, this is the only environment you are allowed
# to build it in, to ensure security.
env = {}
env["FIPSDIR"] = "#{install_dir}/embedded"
if windows?
default_env = with_standard_compiler_flags(with_embedded_path)
if windows_arch_i386?
# Patch Makefile.org to update the compiler flags/options table for mingw.
patch source: "openssl-fips-fix-compiler-flags-table-for-msys.patch", env: default_env
platform = "mingw"
else
platform = "mingw64"
end
configure_command = ["perl.exe ./Configure #{platform}"]
configure_command << "--prefix=#{install_dir}/embedded"
elsif ppc64? && rhel?
# you have to specify on el ppc64 (big-endian only) otherwise it has won't
# compile
configure_command = ["perl ./Configure linux-ppc64"]
configure_command << "--prefix=#{install_dir}/embedded"
elsif s390x?
configure_command = ["perl ./Configure linux64-s390x"]
configure_command << "--prefix=#{install_dir}/embedded"
# Unfortunately openssl-fips is not supported on s390x, so we have to tell it to
# compile solely in C
configure_command << "no-asm"
else
configure_command = ["./config"]
end
command configure_command.join(" "), env: env, in_msys_bash: true
# Cannot use -j with openssl :(.
make env: env
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/postgresql13.rb | config/software/postgresql13.rb | #
# Copyright:: Chef Software, 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.
#
name "postgresql13"
default_version "13.22"
license "PostgreSQL"
license_file "COPYRIGHT"
skip_transitive_dependency_licensing true
dependency "zlib"
dependency "openssl"
dependency "libedit"
dependency "ncurses"
dependency "libossp-uuid"
dependency "config_guess"
source url: "https://ftp.postgresql.org/pub/source/v#{version}/postgresql-#{version}.tar.bz2"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.bz2",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
version("13.22") { source sha256: "d36d83dc89e625502cf6fb1d0529642ba1266bd614b4e4a41cefd1dddcf09080" }
version("13.21") { source sha256: "dcda1294df45f033b0656cf7a8e4afbbc624c25e1b144aec79530f74d7ef4ab4" }
version("13.18") { source sha256: "ceea92abee2a8c19408d278b68de6a78b6bd3dbb4fa2d653fa7ca745d666aab1" }
version("13.4") { source sha256: "ea93e10390245f1ce461a54eb5f99a48d8cabd3a08ce4d652ec2169a357bc0cd" }
relative_path "postgresql-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
# short_version = version.gsub(/^([0-9]+).([0-9]+).[0-9]+$/, '\1.\2')
# We need to consider only the major version for postgres 13
short_version = version.match(/^([0-9]+)/).to_s
update_config_guess(target: "config")
command "./configure" \
" --prefix=#{install_dir}/embedded/postgresql/#{short_version}" \
" --with-libedit-preferred" \
" --with-openssl" \
" --with-ossp-uuid" \
" --with-includes=#{install_dir}/embedded/include" \
" --with-libraries=#{install_dir}/embedded/lib", env: env
make "world -j #{workers}", env: env
make "install-world -j #{workers}", env: env
block do
Dir.glob("#{install_dir}/embedded/postgresql/#{short_version}/bin/*").sort.each do |bin|
link bin, "#{install_dir}/embedded/bin/#{File.basename(bin)}"
end
delete "#{install_dir}/embedded/postgresql/#{short_version}/share/doc"
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/git.rb | config/software/git.rb | #
# Copyright:: Chef Software, 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.
#
name "git"
default_version "2.39.0"
license "LGPL-2.1"
license_file "LGPL-2.1"
skip_transitive_dependency_licensing true
dependency "curl"
dependency "zlib"
dependency "openssl"
dependency "pcre"
dependency "libiconv" # FIXME: can we figure out how to remove this?
dependency "expat"
relative_path "git-#{version}"
# version_list: url=https://www.kernel.org/pub/software/scm/git/ filter=*.tar.gz
version("2.39.3") { source sha256: "2f9aa93c548941cc5aff641cedc24add15b912ad8c9b36ff5a41b1a9dcad783e" }
version("2.39.0") { source sha256: "d929fe67cef7ac3ca709d2b56a9920f17112d5a524bf8112af37ec045a7a5109" }
version("2.37.3") { source sha256: "181f65587155ea48c682f63135678ec53055adf1532428752912d356e46b64a8" }
version("2.37.2") { source sha256: "4c428908e3a2dca4174df6ef49acc995a4fdb1b45205a2c79794487a33bc06e5" }
version("2.37.1") { source sha256: "7dded96a52e7996ce90dd74a187aec175737f680dc063f3f33c8932cf5c8d809" }
version("2.37.0") { source sha256: "fc3ffe6c65c1f7c681a1ce6bb91703866e432c762731d4b57c566d696f6d62c3" }
version("2.36.1") { source sha256: "37d936fd17c81aa9ddd3dba4e56e88a45fa534ad0ba946454e8ce818760c6a2c" }
version("2.36.0") { source sha256: "9785f8c99daea037b8443d2f7397ac6aafbf8d5ff21fbfe2e5c0d443d126e211" }
version("2.35.3") { source sha256: "cad708072d5c0b390c71651f5edb44143f00b357766973470bf9adebc0944c03" }
# we need to keep 2.24.1 until we can remove the version pin in omnibus-toolchain Solaris builds
version("2.24.1") { source sha256: "ad5334956301c86841eb1e5b1bb20884a6bad89a10a6762c958220c7cf64da02" }
source url: "https://www.kernel.org/pub/software/scm/git/git-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
# git builds git-core as binaries into a special directory. We need to include
# that directory in bin_dirs so omnibus can sign them during macOS deep signing.
bin_dirs bin_dirs.concat ["#{install_dir}/embedded/libexec/git-core"]
build do
env = with_standard_compiler_flags(with_embedded_path)
# We do a distclean so we ensure that the autoconf files are not trying to be
# clever.
make "distclean"
# In 2.13.1 they introduced some sha code that wasn't super good at endianness
if aix?
# AIX needs /opt/freeware/bin only for patch
patch_env = env.dup
patch_env["PATH"] = "/opt/freeware/bin:#{env["PATH"]}"
patch source: "aix-endian-fix.patch", plevel: 0, env: patch_env
end
config_hash = {
# Universal options
NO_GETTEXT: "YesPlease",
NEEDS_LIBICONV: "YesPlease",
NO_INSTALL_HARDLINKS: "YesPlease",
NO_PERL: "YesPlease",
NO_PYTHON: "YesPlease",
NO_TCLTK: "YesPlease",
}
if freebsd?
config_hash["CHARSET_LIB"] = "-lcharset"
config_hash["FREAD_READS_DIRECTORIES"] = "UnfortunatelyYes"
config_hash["HAVE_CLOCK_GETTIME"] = "YesPlease"
config_hash["HAVE_CLOCK_MONOTONIC"] = "YesPlease"
config_hash["HAVE_GETDELIM"] = "YesPlease"
config_hash["HAVE_PATHS_H"] = "YesPlease"
config_hash["HAVE_STRINGS_H"] = "YesPlease"
config_hash["PTHREAD_LIBS"] = "-pthread"
config_hash["USE_ST_TIMESPEC"] = "YesPlease"
config_hash["HAVE_BSD_SYSCTL"] = "YesPlease"
config_hash["NO_R_TO_GCC_LINKER"] = "YesPlease"
elsif aix?
env["CC"] = "xlc_r"
env["INSTALL"] = "/opt/freeware/bin/install"
env["CFLAGS"] = "-q64 -qmaxmem=-1 -I#{install_dir}/embedded/include -D_LARGE_FILES -O2"
env["CPPFLAGS"] = "-q64 -qmaxmem=-1 -I#{install_dir}/embedded/include -D_LARGE_FILES -O2"
env["LDFLAGS"] = "-q64 -L#{install_dir}/embedded/lib -lcurl -lssl -lcrypto -lz -Wl,-blibpath:#{install_dir}/embedded/lib:/usr/lib:/lib"
# xlc doesn't understand the '-Wl,-rpath' syntax at all so... we don't enable
# the NO_R_TO_GCC_LINKER flag. This means that it will try to use the
# old style -R for libraries and as a result, xlc will ignore it. In this case, we
# we want that to happen because we explicitly set the libpath with the correct
# command line argument in omnibus itself.
config_hash["CC_LD_DYNPATH"] = "-R"
config_hash["AR"] = "ar -X64"
config_hash["NO_REGEX"] = "YesPlease"
else
# Linux things!
config_hash["HAVE_PATHS_H"] = "YesPlease"
config_hash["NO_R_TO_GCC_LINKER"] = "YesPlease"
end
# ensure that header files in git's source code are found first before looking in other directories
# this solves an issue that occurs when libarchive has been built and installed and its archive.h header
# file in #{install_dir}/embedded/include is accidentally picked up when compiling git
env["CFLAGS"] = "-I. #{env["CFLAGS"]}"
env["CPPFLAGS"] = "-I. #{env["CPPFLAGS"]}"
env["CXXFLAGS"] = "-I. #{env["CXXFLAGS"]}"
env["CFLAGS"] = "-std=c99 #{env["CFLAGS"]}"
erb source: "config.mak.erb",
dest: "#{project_dir}/config.mak",
mode: 0755,
vars: {
cc: env["CC"],
ld: env["LD"],
cflags: env["CFLAGS"],
cppflags: env["CPPFLAGS"],
install: env["INSTALL"],
install_dir: install_dir,
ldflags: env["LDFLAGS"],
shell_path: env["SHELL_PATH"],
config_hash: config_hash,
}
#
# NOTE - If you run ./configure the environment variables set above will not be
# used and only the command line args will be used. The issue with this is you
# cannot specify everything on the command line that you can with the env vars.
make "prefix=#{install_dir}/embedded -j #{workers}", env: env
make "prefix=#{install_dir}/embedded install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/lua.rb | config/software/lua.rb | #
# Copyright 2016 Chef Software, 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.
#
name "lua"
default_version "5.4.6"
# versions_list: https://www.lua.org/ftp/ filter=*.tar.gz
version("5.4.6") { source sha256: "7d5ea1b9cb6aa0b59ca3dde1c6adcb57ef83a1ba8e5432c0ecd06bf439b3ad88" }
version("5.4.4") { source sha256: "164c7849653b80ae67bec4b7473b884bf5cc8d2dca05653475ec2ed27b9ebf61" }
version("5.4.3") { source sha256: "f8612276169e3bfcbcfb8f226195bfc6e466fe13042f1076cbde92b7ec96bbfb" }
version("5.4.2") { source sha256: "11570d97e9d7303c0a59567ed1ac7c648340cd0db10d5fd594c09223ef2f524f" }
version("5.3.3") { source sha256: "5113c06884f7de453ce57702abaac1d618307f33f6789fa870e87a59d772aca2" }
version("5.2.4") { source sha256: "b9e2e4aad6789b3b63a056d442f7b39f0ecfca3ae0f1fc0ae4e9614401b69f4b" }
license "MIT"
license_file "https://www.lua.org/license.html"
skip_transitive_dependency_licensing true
source url: "https://www.lua.org/ftp/lua-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "lua-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
# lua compiles in a slightly interesting way, it has minimal configuration options
# and only provides a makefile. We can't use use `-DLUA_USE_LINUX` or the `make linux`
# methods because they make the assumption that the readline package has been installed.
mycflags = "-I#{install_dir}/embedded/include -O2 -DLUA_USE_POSIX -DLUA_USE_DLOPEN"
myldflags = "-Wl,-rpath,#{install_dir}/embedded/lib -L#{install_dir}/embedded/lib"
mylibs = "-ldl"
make "all MYCFLAGS='#{mycflags}' MYLDFLAGS='#{myldflags}' MYLIBS='#{mylibs}'", env: env, cwd: "#{project_dir}/src"
make "-j #{workers} install INSTALL_TOP=#{install_dir}/embedded", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/liblzma.rb | config/software/liblzma.rb | #
# Copyright 2014-2018 Chef Software, 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.
#
name "liblzma"
default_version "5.2.10"
license "Public-Domain"
license_file "COPYING"
skip_transitive_dependency_licensing true
# version_list: url=http://tukaani.org/xz/ filer=*.tar.gz
version("5.2.10") { source sha256: "eb7a3b2623c9d0135da70ca12808a214be9c019132baaa61c9e1d198d1d9ded3" }
version("5.2.7") { source sha256: "06327c2ddc81e126a6d9a78b0be5014b976a2c0832f492dcfc4755d7facf6d33" }
version("5.2.6") { source sha256: "a2105abee17bcd2ebd15ced31b4f5eda6e17efd6b10f921a01cda4a44c91b3a0" }
version("5.2.5") { source sha256: "f6f4910fd033078738bd82bfba4f49219d03b17eb0794eb91efbae419f4aba10" }
version("5.2.4") { source sha256: "b512f3b726d3b37b6dc4c8570e137b9311e7552e8ccbab4d39d47ce5f4177145" }
version("5.2.3") { source sha256: "71928b357d0a09a12a4b4c5fafca8c31c19b0e7d3b8ebb19622e96f26dbf28cb" }
version("5.2.2") { source sha256: "73df4d5d34f0468bd57d09f2d8af363e95ed6cc3a4a86129d2f2c366259902a2" }
source url: "https://tukaani.org/xz/xz-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/xz-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "xz-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
# liblzma properly uses CFLAGS for C compilation and CPPFLAGS for common
# flags used across tools such as windres. Don't put anything in it
# that can be misinterpreted by windres.
env["CPPFLAGS"] = "-I#{install_dir}/embedded/include" if windows?
config_command = [
"--disable-debug",
"--disable-dependency-tracking",
"--disable-doc",
"--disable-scripts",
"--disable-lzma-links",
"--disable-lzmainfo",
"--disable-lzmadec",
"--disable-xzdec",
"--disable-xz",
]
config_command << "--disable-nls" if windows?
configure(*config_command, env: env)
make "install", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/nginx.rb | config/software/nginx.rb | #
# Copyright 2012-2016 Chef Software, 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.
#
## expeditor/ignore: deprecated 2022 03
name "nginx"
default_version "1.21.4"
dependency "pcre"
dependency "openssl"
dependency "zlib"
license "BSD-2-Clause"
license_file "LICENSE"
source url: "https://nginx.org/download/nginx-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
# versions_list: https://nginx.org/download/ filter=*.tar.gz
version("1.21.4") { source sha256: "d1f72f474e71bcaaf465dcc7e6f7b6a4705e4b1ed95c581af31df697551f3bfe" }
version("1.20.1") { source sha256: "e462e11533d5c30baa05df7652160ff5979591d291736cfa5edb9fd2edb48c49" }
version("1.19.9") { source sha256: "2e35dff06a9826e8aca940e9e8be46b7e4b12c19a48d55bfc2dc28fc9cc7d841" }
version("1.19.8") { source sha256: "308919b1a1359315a8066578472f998f14cb32af8de605a3743acca834348b05" }
relative_path "nginx-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
command "./configure" \
" --prefix=#{install_dir}/embedded" \
" --with-http_ssl_module" \
" --with-http_stub_status_module" \
" --with-ipv6" \
" --with-debug" \
" --with-cc-opt=\"-L#{install_dir}/embedded/lib -I#{install_dir}/embedded/include\"" \
" --with-ld-opt=-L#{install_dir}/embedded/lib", env: env
make "-j #{workers}", env: env
make "install", env: env
# Ensure the logs directory is available on rebuild from git cache
touch "#{install_dir}/embedded/logs/.gitkeep"
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/bundler.rb | config/software/bundler.rb | #
# Copyright 2012-2019, Chef Software 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.
#
# expeditor/ignore: deprecated 2021-04
name "bundler"
license "MIT"
license_file "https://raw.githubusercontent.com/bundler/bundler/master/LICENSE.md"
skip_transitive_dependency_licensing true
dependency "rubygems"
build do
env = with_standard_compiler_flags(with_embedded_path)
v_opts = "--version '#{version}'" unless version.nil?
gem [
"install bundler",
v_opts,
"--no-document --force",
].compact.join(" "), env: env
# confirm the install was successful
command "bundle version", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/version-manifest.rb | config/software/version-manifest.rb | #
# Copyright 2012-2014 Chef Software, 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.
#
# expeditor/ignore: logic only
name "version-manifest"
description "generates a version manifest file"
default_version "0.0.1"
license :project_license
skip_transitive_dependency_licensing true
build do
block do
File.open("#{install_dir}/version-manifest.txt", "w") do |f|
f.puts "#{project.name} #{project.build_version}"
f.puts ""
f.puts Omnibus::Reports.pretty_version_map(project)
end
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/runit.rb | config/software/runit.rb | #
# Copyright 2012-2014 Chef Software, 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.
#
name "runit"
default_version "2.1.2"
license "BSD-3-Clause"
license_file "../package/COPYING"
skip_transitive_dependency_licensing true
# version_list: url=http://smarden.org/runit/ filter=*.tar.gz
version("2.1.2") { source sha256: "6fd0160cb0cf1207de4e66754b6d39750cff14bb0aa66ab49490992c0c47ba18" }
version("2.1.1") { source sha256: "ffcf2d27b32f59ac14f2d4b0772a3eb80d9342685a2042b7fbbc472c07cf2a2c" }
source url: "http://smarden.org/runit/runit-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "admin/runit-#{version}/src"
build do
env = with_standard_compiler_flags(with_embedded_path)
# Put runit where we want it, not where they tell us to
command 'sed -i -e "s/^char\ \*varservice\ \=\"\/service\/\";$/char\ \*varservice\ \=\"' + install_dir.gsub("/", "\\/") + '\/service\/\";/" sv.c', env: env
# TODO: the following is not idempotent
command "sed -i -e s:-static:: Makefile", env: env
# Build it
make env: env
make "check", env: env
# Move it
mkdir "#{install_dir}/embedded/bin"
copy "#{project_dir}/chpst", "#{install_dir}/embedded/bin"
copy "#{project_dir}/runit", "#{install_dir}/embedded/bin"
copy "#{project_dir}/runit-init", "#{install_dir}/embedded/bin"
copy "#{project_dir}/runsv", "#{install_dir}/embedded/bin"
copy "#{project_dir}/runsvchdir", "#{install_dir}/embedded/bin"
copy "#{project_dir}/runsvdir", "#{install_dir}/embedded/bin"
copy "#{project_dir}/sv", "#{install_dir}/embedded/bin"
copy "#{project_dir}/svlogd", "#{install_dir}/embedded/bin"
copy "#{project_dir}/utmpset", "#{install_dir}/embedded/bin"
erb source: "runsvdir-start.erb",
dest: "#{install_dir}/embedded/bin/runsvdir-start",
mode: 0755,
vars: { install_dir: install_dir }
# Setup service directories
touch "#{install_dir}/service/.gitkeep"
touch "#{install_dir}/sv/.gitkeep"
touch "#{install_dir}/init/.gitkeep"
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/openssl-customization.rb | config/software/openssl-customization.rb | #
# Copyright:: Copyright (c) 2014-2017, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# 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.
#
# This software makes sure that SSL_CERT_FILE environment variable is pointed
# to the bundled CA certificates that ship with omnibus. With this, Chef
# tools can be used with https URLs out of the box.
# expeditor/ignore: logic only
name "openssl-customization"
license :project_license
skip_transitive_dependency_licensing true
source path: "#{project.files_path}/#{name}"
dependency "ruby"
build do
block "Add OpenSSL customization file" do
# gets directories for RbConfig::CONFIG and sanitizes them.
def get_sanitized_rbconfig(config)
ruby = windows_safe_path("#{install_dir}/embedded/bin/ruby")
config_dir = Bundler.with_clean_env do
command_output = `#{ruby} -rrbconfig -e "puts RbConfig::CONFIG['#{config}']"`.strip
windows_safe_path(command_output)
end
if config_dir.nil? || config_dir.empty?
raise "could not determine embedded ruby's RbConfig::CONFIG['#{config}']"
end
config_dir
end
embedded_ruby_lib_dir = get_sanitized_rbconfig("rubylibdir")
# use the value from the else clause here and remove the if/else once Ruby < 3.1
# is not supported in combination with OpenSSL >= 3.0
source_openssl_rb = if project.overrides[:openssl] && project.overrides[:ruby] &&
ChefUtils::VersionString.new(project.overrides[:ruby][:version]).satisfies?("< 3.1") &&
ChefUtils::VersionString.new(project.overrides[:openssl][:version]).satisfies?(">= 3.0")
# ruby 3.0 by default is built with < OpenSSL 3.0, and we'll
# have an openssl gem separately installed as part of this
Dir["#{install_dir}/**/openssl-*/lib/openssl.rb"].last
else
File.join(embedded_ruby_lib_dir, "openssl.rb")
end
if windows?
embedded_ruby_site_dir = get_sanitized_rbconfig("sitelibdir")
source_ssl_env_hack = File.join(project_dir, "windows", "ssl_env_hack.rb")
destination_ssl_env_hack = File.join(embedded_ruby_site_dir, "ssl_env_hack.rb")
create_directory(embedded_ruby_site_dir)
copy(source_ssl_env_hack, destination_ssl_env_hack)
# Unfortunately there is no patch on windows, but luckily we only need to append a line to the openssl.rb
# to pick up our script which find the CA bundle in omnibus installations and points SSL_CERT_FILE to it
# if it's not already set
File.open(source_openssl_rb, "r+") do |f|
unpatched_openssl_rb = f.read
f.rewind
f.write("\nrequire 'ssl_env_hack'\n")
f.write(unpatched_openssl_rb)
end
else
File.open(source_openssl_rb, "r+") do |f|
unpatched_openssl_rb = f.read
f.rewind
f.write(unpatched_openssl_rb)
end
end
end
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
chef/omnibus-software | https://github.com/chef/omnibus-software/blob/d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f/config/software/libiconv.rb | config/software/libiconv.rb | #
# Copyright:: Chef Software, 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.
#
# CAUTION - although its not used, external libraries such as nokogiri may pick up an optional dep on
# libiconv such that removal of libiconv will break those libraries on upgrade. With an better story around
# external gem handling when chef-client is upgraded libconv could be dropped.
#
name "libiconv"
default_version "1.17"
license "LGPL-2.1"
license_file "COPYING.LIB"
skip_transitive_dependency_licensing true
dependency "config_guess"
# versions_list: https://ftp.gnu.org/pub/gnu/libiconv/ filter=*.tar.gz
version("1.17") { source sha256: "8f74213b56238c85a50a5329f77e06198771e70dd9a739779f4c02f65d971313" }
version("1.16") { source sha256: "e6a1b1b589654277ee790cce3734f07876ac4ccfaecbee8afa0b649cf529cc04" }
version("1.15") { source sha256: "ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc8913178" }
source url: "https://ftp.gnu.org/pub/gnu/libiconv/libiconv-#{version}.tar.gz"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/#{name}-#{version}.tar.gz",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
relative_path "libiconv-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
# freebsd 10 needs to be build PIC
env["CFLAGS"] << " -fPIC" if freebsd?
update_config_guess(target: "build-aux")
update_config_guess(target: "libcharset/build-aux")
configure(env: env)
pmake = "-j #{workers}"
make "#{pmake}", env: env
make "#{pmake} install-lib" \
" libdir=#{install_dir}/embedded/lib" \
" includedir=#{install_dir}/embedded/include", env: env
end
| ruby | Apache-2.0 | d6fce7b6c5e6a9ba1f3a21eef2b2be8ee778391f | 2026-01-04T17:47:07.582014Z | false |
airbnb/optica | https://github.com/airbnb/optica/blob/3af123cfa896838cde60a6e9a88384f9ffcee06d/events_rmq.rb | events_rmq.rb | require 'stomp'
require 'oj'
class EventsRabbitMQ
def initialize(opts)
@log = opts['log']
%w{rabbit_host rabbit_port}.each do |req|
raise ArgumentError, "missing required argument '#{req}'" unless opts[req]
end
@connect_hash = {
:hosts => [{
:host => opts['rabbit_host'],
:port => opts['rabbit_port'],
:login => opts['rabbit_user'] || 'guest',
:passcode => opts['rabbit_pass'] || 'guest',
}],
:reliable => true,
:autoflush => true,
:connect_timeout => 10,
:logger => @log,
}
@exchange_name = opts['exchange_name'] || 'ops'
@routing = opts['routing'] || 'events.node.converged'
@health_routing = opts['health_routing'] || 'checks.optica'
end
def name
'rabbitmq'
end
def start
@client = Stomp::Client.new(@connect_hash)
end
def send(data)
@client.publish("/exchange/#{@exchange_name}/#{@routing}", Oj.dump(data), {:persistent => true})
rescue Exception => e
@log.error "unexpected error publishing to rabbitmq: #{e.inspect}"
raise e
else
@log.debug "published an event to #{@routing}"
end
def healthy?
@client.publish("/exchange/#{@exchange_name}/#{@health_routing}", '')
rescue StandardError => e
@log.error "events interface failed health check: #{e.inspect}"
false
else
@log.debug "events interface for RabbitMQ healthy"
true
end
def stop
@log.warn "stopping the events interface"
Process.kill("TERM", Process.pid) unless $EXIT
@client.close if @client
end
end
| ruby | MIT | 3af123cfa896838cde60a6e9a88384f9ffcee06d | 2026-01-04T17:47:25.662787Z | false |
airbnb/optica | https://github.com/airbnb/optica/blob/3af123cfa896838cde60a6e9a88384f9ffcee06d/store.rb | store.rb | require 'zk'
require 'oj'
require 'hash_deep_merge'
require 'open-uri'
class Store
attr_reader :ips
DEFAULT_CACHE_STALE_AGE = 0
DEFAULT_SPLIT_MODE = "disabled"
DEFAULT_STORE_PORT = 8001
DEFAULT_HTTP_TIMEOUT = 30
DEFAULT_HTTP_RETRY_DELAY = 5
def initialize(opts)
@log = opts['log']
@index_fields = opts['index_fields'].to_s.split(/,\s*/)
@opts = {
'split_mode' => DEFAULT_SPLIT_MODE,
'split_mode_store_port' => DEFAULT_STORE_PORT,
'split_mode_retry_delay' => DEFAULT_HTTP_RETRY_DELAY,
'split_mode_http_timeout' => DEFAULT_HTTP_TIMEOUT,
}.merge(opts)
unless opts['zk_path']
raise ArgumentError, "missing required argument 'zk_path'"
else
@path = opts['zk_path']
end
@zk = nil
setup_cache(opts)
end
def setup_cache(opts)
# We use a daemon that refreshes cache every N (tunable)
# seconds. In addition, we subscript to all children joining/leaving
# events. This is less frequent because normally no one would constantly
# add/remove machines. So whenever a join/leave event happens, we immediately
# refresh cache. This way we guarantee that whenever we add/remove
# machines, cache will always have the right set of machines.
@cache_enabled = !!opts['cache_enabled']
@cache_stale_age = opts['cache_stale_age'] || DEFAULT_CACHE_STALE_AGE
# zk watcher for node joins/leaves
@cache_root_watcher = nil
# mutex for atomically updating cached results
@cache_results_serialized = nil
@cache_results = {}
@cache_indices = {}
@cache_mutex = Mutex.new
# daemon that'll fetch from zk periodically
@cache_fetch_thread = nil
# flag that controls if fetch daemon should run
@cache_fetch_thread_should_run = false
# how long we serve cached data
@cache_fetch_base_interval = (opts['cache_fetch_interval'] || 20).to_i
@cache_fetch_interval = @cache_fetch_base_interval
# timestamp that prevents setting cache result with stale data
@cache_results_last_fetched_time = 0
end
def start()
@log.info "waiting to connect to zookeeper at #{@path}"
@zk = ZK.new(@path)
@zk.on_state_change do |event|
@log.info "zk state changed, state=#{@zk.state}, session_id=#{session_id}"
end
@zk.ping?
@log.info "ZK connection established successfully. session_id=#{session_id}"
# We have to readd all watchers and refresh cache if we reconnect to a new server.
@zk.on_connected do |event|
@log.info "ZK connection re-established. session_id=#{session_id}"
if @cache_enabled
@log.info "Resetting watchers and re-syncing cache. session_id=#{session_id}"
setup_watchers
reload_instances
end
end
if @cache_enabled
setup_watchers
reload_instances
start_fetch_thread
end
end
def session_id
'0x%x' % @zk.session_id rescue nil
end
def stop_cache_related()
@cache_root_watcher.unsubscribe if @cache_root_watcher
@cache_root_watcher = nil
@cache_fetch_thread_should_run = false
@cache_fetch_thread.join if @cache_fetch_thread
@cache_fetch_thread = nil
end
def stop()
@log.warn "stopping the store"
stop_cache_related
@zk.close() if @zk
@zk = nil
end
# get instances for a given service
def nodes()
STATSD.time('optica.store.get_nodes') do
unless @cache_enabled
inst, idx = load_instances_from_zk
return inst
end
check_cache_age
@cache_results
end
end
def nodes_serialized
@cache_results_serialized
end
def lookup(params)
if @opts['split_mode'] != 'server' || !@cache_enabled
return nodes
end
STATSD.time('optica.store.lookup') do
# Find all suitable indices and their cardinalities
cardinalities = params.reduce({}) do |res, (key, _)|
res[key] = @cache_indices[key].length if @cache_indices.key? key
res
end
unless cardinalities.empty?
# Find best suitable index
best_key = cardinalities.sort_by {|k,v| v}.first.first
best_idx = @cache_indices.fetch(best_key, {})
# Check if index saves enough cycles, otherwise fall back to full cache
if @cache_results.length > 0 && best_idx.length.to_f / @cache_results.length.to_f > 0.5
return nodes
end
return nodes_from_index(best_idx, params[best_key])
end
return nodes
end
end
def load_instances
STATSD.time('optica.store.load_instances') do
@opts['split_mode'] == 'server' ?
load_instances_from_leader :
load_instances_from_zk
end
end
def load_instances_from_leader
begin
uri = "http://localhost:%d/store" % @opts['split_mode_store_port']
res = open(uri, :read_timeout => @opts['split_mode_http_timeout'])
remote_store = Oj.safe_load(res.read)
[ remote_store['inst'], remote_store['idx'] ]
rescue OpenURI::HTTPError, Errno::ECONNREFUSED, Net::ReadTimeout => e
@log.error "Error loading store from #{uri}: #{e.inspect}; will retry after #{@opts['split_mode_retry_delay']}"
sleep @opts['split_mode_retry_delay']
retry
end
end
def load_instances_from_zk()
@log.info "Reading instances from zk:"
inst = {}
idx = {}
begin
@zk.children('/', :watch => true).each do |child|
node = get_node("/#{child}")
update_nodes child, node, inst, idx
end
rescue Exception => e
# ZK client library caches DNS names of ZK nodes and it resets the
# cache only when the client object is initialized, or set_servers
# method is called. Set_servers is not exposed in ruby library, so
# we force re-init the underlying client object here to make sure
# we always connect to the current IP addresses.
@zk.reopen
@log.error "unexpected error reading from zk! #{e.inspect}"
raise e
end
[inst, idx]
end
def add(node, data)
child = "/#{node}"
# deep-merge the old and new data
prev_data = get_node(child)
new_data = prev_data.deep_merge(data)
json_data = Oj.dump(new_data)
@log.debug "writing to zk at #{child} with #{json_data}"
begin
STATSD.time('optica.zookeeper.set') do
@zk.set(child, json_data)
end
new_data
rescue ZK::Exceptions::NoNode => e
STATSD.time('optica.zookeeper.create') do
@zk.create(child, :data => json_data)
end
new_data
rescue Exception => e
@zk.reopen
@log.error "unexpected error writing to zk! #{e.inspect}"
raise e
end
end
def delete(node)
@log.info "deleting node #{node}"
begin
STATSD.time('optica.zookeeper.delete') do
@zk.delete("/" + node, :ignore => :no_node)
end
rescue Exception => e
@zk.reopen
@log.error "unexpected error deleting nodes in zk! #{e.inspect}"
raise e
end
end
def healthy?()
healthy = true
if $EXIT
@log.warn 'not healthy because stopping...'
healthy = false
elsif not @zk
@log.warn 'not healthy because no zookeeper...'
healthy = false
elsif not @zk.connected?
@log.warn 'not healthy because zookeeper not connected...'
healthy = false
end
return healthy
end
private
def nodes_from_index(idx, values)
matching_keys = []
# To preserve original optica behavior we have to validate all keys
# against standard rules
values.each do |val|
keys = idx.keys.select do |key|
matched = true
if key.is_a? String
matched = false unless key.match val
elsif key.is_a? Array
matched = false unless key.include? val
elsif key.class == TrueClass
matched = false unless ['true', 'True', '1'].include? val
elsif key.class == FalseClass
matched = false unless ['false', 'False', '0'].include? val
end
matched
end
matching_keys << keys
end
if matching_keys.length == 1
matching_keys = matching_keys.first
elsif matching_keys.length > 1
matching_keys = matching_keys.inject(:&)
end
matching_keys.reduce({}) do |res, key|
res.merge idx.fetch(key, {})
end
end
def update_nodes(node_name, node, inst, idx)
inst[node_name] = node
@index_fields.each do |key|
if node.key?(key) && !node[key].nil?
val = node[key]
idx[key] ||= {}
idx[key][val] ||= {}
idx[key][val][node_name] = node
end
end
end
def get_node(node)
begin
data, stat = STATSD.time('optica.zookeeper.get') do
@zk.get(node)
end
STATSD.time('optica.json.parse') do
Oj.safe_load(data)
end
rescue ZK::Exceptions::NoNode
@log.info "node #{node} disappeared"
{}
rescue Oj::ParseError
@log.warn "removing invalid node #{node}: data failed to parse (#{data.inspect})"
delete(node)
{}
rescue Exception => e
@zk.reopen
@log.error "unexpected error reading from zk! #{e.inspect}"
raise e
end
end
# immediately update cache if node joins/leaves
def setup_watchers
return if @zk.nil? || @opts['split_mode'] == 'server'
@cache_root_watcher = @zk.register("/", :only => :child) do |event|
@log.info "Children added/deleted"
reload_instances
end
end
def check_cache_age
return unless @cache_enabled
cache_age = Time.new.to_i - @cache_results_last_fetched_time.to_i
STATSD.gauge 'optica.store.cache.age', cache_age
if @cache_stale_age > 0 && cache_age > @cache_stale_age
msg = "cache age exceeds threshold: #{cache_age} > #{@cache_stale_age}"
@log.error msg
raise msg
end
end
def reload_instances()
return unless @cache_mutex.try_lock
begin
now = Time.now.to_i
if now > @cache_results_last_fetched_time + @cache_fetch_interval
inst, idx = load_instances
@cache_results = inst.freeze
@cache_indices = idx.freeze
case @opts['split_mode']
when 'store'
new_store = {
'inst' => @cache_results,
'idx' => @cache_indices,
}
@cache_results_serialized = Oj.dump new_store
when 'server'
new_store = {
'examined' => 0,
'returned' => @cache_results.length,
'nodes' => @cache_results,
}
@cache_results_serialized = Oj.dump new_store
end
@cache_results_last_fetched_time = now
update_cache_fetch_interval
@log.info "reloaded cache. new reload interval = #{@cache_fetch_interval}"
end
ensure
@cache_mutex.unlock
end
end
def update_cache_fetch_interval
@cache_fetch_interval = @cache_fetch_base_interval + rand(0..20)
end
def start_fetch_thread()
@cache_fetch_thread_should_run = true
@cache_fetch_thread = Thread.new do
while @cache_fetch_thread_should_run do
begin
sleep(@cache_fetch_interval) rescue nil
source = @opts['split_mode'] == 'server' ? 'remote store' : 'zookeeper'
@log.info "Cache fetch thread now fetches from #{source}..."
reload_instances rescue nil
check_cache_age
rescue => ex
@log.warn "Caught exception in cache fetch thread: #{ex} #{ex.backtrace}"
end
end
end
end
end
| ruby | MIT | 3af123cfa896838cde60a6e9a88384f9ffcee06d | 2026-01-04T17:47:25.662787Z | false |
airbnb/optica | https://github.com/airbnb/optica/blob/3af123cfa896838cde60a6e9a88384f9ffcee06d/optica.rb | optica.rb | require 'sinatra/base'
require 'cgi'
require 'oj'
class Optica < Sinatra::Base
before do
env['rack.logger'] = settings.logger
end
configure :production, :development do
enable :logging
end
get '/' do
return get_nodes(request)
end
# endpoint for fab usage
get '/roles' do
fields_to_include = ['role', 'id', 'hostname']
params = CGI::parse(request.query_string)
if params['_extra_fields']
values = params['_extra_fields']
# accept both _additional_fields[] and _additional_fields=1,2 syntax
values.each do |value|
fields_to_include += value.split(',')
end
end
return get_nodes(request, fields_to_include)
end
get '/store' do
content_type 'application/octet-stream'
return settings.store.nodes_serialized
end
def get_nodes(request, fields_to_include=nil)
params = CGI::parse(request.query_string).reject { |p| p[0] == '_' }
# Optimization for some of the most expensive requests
if fields_to_include.nil? && params.empty? && settings.split_mode == 'server'
content_type 'application/json', :charset => 'utf-8'
return settings.store.nodes_serialized
end
# include only those nodes that match passed-in parameters
examined = 0
to_return = {}
begin
nodes = settings.store.lookup(params)
rescue
halt(503)
end
nodes.each do |node, properties|
examined += 1
included = true
params.each do |param, values|
values.each do |value|
if not properties.include? param
included = false
elsif properties[param].nil?
included = false
elsif properties[param].is_a? String
included = false unless properties[param].match value
elsif properties[param].is_a? Array
included = false unless properties[param].include? value
elsif properties[param].class == TrueClass
included = false unless ['true', 'True', '1'].include? value
elsif properties[param].class == FalseClass
included = false unless ['false', 'False', '0'].include? value
end
end
end
if included
# return full list if fields_to_include is nil. Otherwise return only keys
# listed in fields_to_include. Not using slice because not a rails app.
to_return[node] = fields_to_include.nil? ? properties : properties
.select { |key, _value| fields_to_include.include? key }
end
end
content_type 'application/json', :charset => 'utf-8'
result = {'examined'=>examined, 'returned'=>to_return.count, 'nodes'=>to_return}
return Oj.dump(result)
end
post '/' do
begin
data = Oj.safe_load(request.body.read)
rescue Oj::ParseError
halt(400, 'invalid request payload')
end
ip = data['ip']
# check the node ip? disabled by false and nil
case settings.ip_check
when :direct
halt(403) unless ip == request.ip
when :forwarded_for
header = env['HTTP_X_FORWARDED_FOR']
halt(500) unless header
halt(403) unless ip == header.split(',').first
end
# update main store
begin
merged_data = settings.store.add(ip, data)
rescue
halt(500)
end
# publish update event
message = 'stored'
begin
tags = []
event = merged_data.merge('event' => data)
settings.events.each do |events|
tags = ["events_queue:#{events.name}"]
events.send(event)
STATSD.increment('optica.events', :tags => tags + ['status:success'])
end
rescue => e
STATSD.increment('optica.events', :tags => tags + ['status:failed']) unless tags.empty?
# If event publishing failed, we treat it as a warning rather than an error.
message += " -- [warning] failed to publish event: #{e.to_s}"
end
content_type 'text/plain', :charset => 'utf-8'
return message
end
delete '/:id' do |id|
matching = settings.store.nodes.select{ |k,v| v['id'] == id }
if matching.length == 0
return 204
elsif matching.length == 1
begin
settings.store.delete(matching.flatten[1]['ip'])
rescue
halt(500)
else
return "deleted"
end
else
return [409, "found multiple entries matching id #{id}"]
end
end
get '/health' do
if settings.store.healthy? and settings.events.all? { |events| events.healthy? }
content_type 'text/plain', :charset => 'utf-8'
return "OK"
else
return [503, 'not healthy!']
end
end
get '/ping' do
content_type 'text/plain', :charset => 'utf-8'
return "PONG"
end
end
| ruby | MIT | 3af123cfa896838cde60a6e9a88384f9ffcee06d | 2026-01-04T17:47:25.662787Z | false |
airbnb/optica | https://github.com/airbnb/optica/blob/3af123cfa896838cde60a6e9a88384f9ffcee06d/events_sqs.rb | events_sqs.rb | require 'aws-sdk-sqs'
require 'oj'
class EventsSQS
def initialize(opts)
@log = opts['log']
%w{sqs_region sqs_queue}.each do |req|
raise ArgumentError, "missing required argument '#{req}'" unless opts[req]
end
@opts = {
:region => opts['sqs_region'],
:queue => opts['sqs_queue'],
:logger => @log,
}
@message_group_id = opts['routing'] || 'events.node.converged'
@health_message_group_id = opts['health_routing'] || 'checks.optica'
end
def name
'sqs'
end
def start
@sqs = Aws::SQS::Client.new(region: @opts[:region], logger: @opts[:logger])
resp = @sqs.get_queue_url(queue_name: @opts[:queue])
@opts[:queue_url] = resp.queue_url
end
def send(data)
@sqs.send_message(queue_url: @opts[:queue_url],
message_group_id: @message_group_id, message_body: Oj.dump(data))
@log.debug "published an event to #{@opts[:queue]}"
rescue StandardError => e
@log.error "unexpected error publishing to SQS: #{e.inspect}"
raise e
end
def healthy?
@sqs.send_message(queue_url: @opts[:queue_url],
message_group_id: @health_message_group_id, message_body: '{}')
@log.debug "events interface for SQS is healthy"
true
rescue StandardError => e
@log.error "events interface for SQS failed health check: #{e.inspect}"
false
end
def stop
end
end
| ruby | MIT | 3af123cfa896838cde60a6e9a88384f9ffcee06d | 2026-01-04T17:47:25.662787Z | false |
airbnb/optica | https://github.com/airbnb/optica/blob/3af123cfa896838cde60a6e9a88384f9ffcee06d/tools/copy.rb | tools/copy.rb | #!/usr/bin/ruby
# this script might come in handy for moving optica data
# from one ZK cluster to another
require 'zk'
dest_zk = 'new-zk:2181/optica'
source_zk = 'old-zk:2181/optica'
puts "connecting to dest"
dest = ZK.new(dest_zk)
dest.ping?
puts "connecting to source"
source = ZK.new(source_zk)
source.ping?
source.children('/').each do |child|
child = "/#{child}"
puts "reading #{child}"
data, stat = source.get(child)
begin
dest.set(child, data)
rescue ZK::Exceptions::NoNode => e
dest.create(child, :data => data)
end
puts "wrote #{child}"
end
| ruby | MIT | 3af123cfa896838cde60a6e9a88384f9ffcee06d | 2026-01-04T17:47:25.662787Z | false |
airbnb/optica | https://github.com/airbnb/optica/blob/3af123cfa896838cde60a6e9a88384f9ffcee06d/tools/reporter.rb | tools/reporter.rb |
require 'chef/handler'
require 'net/http'
require 'fileutils'
require 'json'
require 'tempfile'
module Optica
class Reporter < Chef::Handler
MAX_TRIES = 4
SAVED_REPORTS_DIR = '/tmp/failed_optica_reports'
SAVED_REPORTS_PREFIX = 'optica_report'
def report
data = {}
# include self-reported attributes if present
report = safe_node_attr(['optica', 'report'])
report.each do |k, v|
data[k] = v
end if report
# include run info
data['failed'] = run_status.failed?
data['last_start'] = run_status.start_time
data['last_reported'] = Time.now
# include some node data (but fail gracefully)
data['branch'] = safe_node_attr(['branch'])
data['roles'] = safe_node_attr(['roles'])
data['recipes'] = safe_node_attr(['recipes'])
data['synapse_services'] = safe_node_attr(['synapse', 'enabled_services'])
data['nerve_services'] = safe_node_attr(['nerve', 'enabled_services'])
data['ownership'] = safe_node_attr(['ownership'])
# ip is needed by optica for all reports
data['ip'] = safe_node_attr(['ipaddress'])
data['environment'] = safe_node_attr(['env'])
data['role'] = safe_node_attr(['role'])
data['id'] = safe_node_attr(['ec2', 'instance_id'])
data['hostname'] = safe_node_attr(['hostname'])
data['uptime'] = safe_node_attr(['uptime_seconds'])
data['public_hostname'] = safe_node_attr(['ec2', 'public_hostname'])
data['public_ip'] = safe_node_attr(['ec2', 'public_ipv4'])
data['az'] = safe_node_attr(['ec2', 'placement_availability_zone'])
data['security_groups'] = safe_node_attr(['ec2', 'security_groups'])
data['instance_type'] = safe_node_attr(['ec2', 'instance_type'])
data['ami_id'] = safe_node_attr(['ec2', 'ami_id'])
data['intended_branch'] = File.read('/etc/chef/branch').strip
converge_reason = ENV['CONVERGE_REASON']
data['converge_reason'] = converge_reason unless converge_reason.nil?
converger = ENV['IDENTITY']
data['converger'] = converger unless converger.nil?
# report the data
Chef::Log.info "Sending run data to optica"
tries = 0
begin
tries += 1
connection = Net::HTTP.new('optica.d.musta.ch', 443)
connection.use_ssl = true
result = connection.post('/', data.to_json)
if result.code.to_i >= 200 and result.code.to_i < 300
Chef::Log.info "SUCCESS: optica replied: '#{result.body}'"
else
raise StandardError.new("optica replied with: #{result.code}:#{result.body}")
end
rescue => e
if tries < MAX_TRIES
Chef::Log.info "FAILED: error reporting to optica from #{data['hostname']} (#{e.message}); trying again..."
sleep 2 ** tries
retry
end
Chef::Log.error "FAILED: error reporting to optica from #{data['hostname']}: #{e.message} #{e.backtrace}"
save_report(data)
else
delete_old_reports
end
end
def safe_node_attr(attr_list)
return nil unless attr_list.is_a? Array
obj = run_status.node
processed = ['node']
attr_list.each do |a|
begin
obj = obj[a]
rescue
Chef::Log.info "Failed to get attribute #{a} from #{processed.join('.')}"
return nil
else
processed << a
end
end
return obj
end
def save_report(data)
FileUtils.mkdir_p(SAVED_REPORTS_DIR)
filename = File.join(SAVED_REPORTS_DIR, SAVED_REPORTS_PREFIX + Time.now.to_i.to_s)
File.open(filename, 'w') do |sr|
sr.write(data.to_json)
end
Chef::Log.info "Optica backup report written to #{filename}"
end
def delete_old_reports
to_delete = Dir.glob(File.join(SAVED_REPORTS_DIR, SAVED_REPORTS_PREFIX + "*"))
unless to_delete.length == 0
Chef::Log.info "Deleting #{to_delete.length} unsent optica reports"
to_delete.each { |old_report| File.delete(old_report) }
end
end
end
end
| ruby | MIT | 3af123cfa896838cde60a6e9a88384f9ffcee06d | 2026-01-04T17:47:25.662787Z | false |
airbnb/optica | https://github.com/airbnb/optica/blob/3af123cfa896838cde60a6e9a88384f9ffcee06d/spec/optica_spec.rb | spec/optica_spec.rb | require 'spec_helper'
require './optica.rb'
RSpec.describe Optica do
def app
Optica
end
before(:all) do
Optica.set :logger, double('TestLogger')
end
describe '/ping' do
it 'returns PONG' do
get '/ping'
expect(last_response.status).to eq(200)
expect(last_response.body).to eq('PONG')
end
end
describe '/' do
let(:data) {
{
'ip' => '127.0.0.1',
'id' => 'test',
'environment' => 'development',
}
}
let(:object_data) {
{
'ip' => '127.0.0.1',
'test' => Object.new,
}
}
before(:all) do
Optica.set :ip_check, :test
end
before(:each) do
Optica.set :store, double('TestStore')
event = double('TestEvent')
allow(event).to receive(:name).and_return('TestEvent')
Optica.set :events, [event]
statsd = double('TestStatsd')
allow(statsd).to receive(:increment)
stub_const('STATSD', statsd)
end
it 'can post data' do
expect(Optica.store).to receive(:add).with(data['ip'], data).and_return(data)
expect(Optica.events.first).to receive(:send)
post('/', Oj.dump(data), 'CONTENT_TYPE' => 'application/json')
expect(last_response.status).to eq(200)
expect(last_response.body).to eq('stored')
end
it 'does not load objects' do
loaded_data = nil
allow(Optica.store).to receive(:add) do |ip, data|
loaded_data = data
end
post('/', Oj.dump(object_data), 'CONTENT_TYPE' => 'application/json')
expect(loaded_data).not_to be_nil
expect(loaded_data['test']).to be_a(Hash)
end
it 'rejects invalid JSON data' do
post('/', '{', 'CONTENT_TYPE' => 'application/json')
expect(last_response.status).to eq(400)
end
end
end
| ruby | MIT | 3af123cfa896838cde60a6e9a88384f9ffcee06d | 2026-01-04T17:47:25.662787Z | false |
airbnb/optica | https://github.com/airbnb/optica/blob/3af123cfa896838cde60a6e9a88384f9ffcee06d/spec/spec_helper.rb | spec/spec_helper.rb | # This file was generated by the `rspec --init` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# The generated `.rspec` file contains `--require spec_helper` which will cause
# this file to always be loaded, without a need to explicitly require it in any
# files.
#
# Given that it is always loaded, you are encouraged to keep this file as
# light-weight as possible. Requiring heavyweight dependencies from this file
# will add to the boot time of your test suite on EVERY test run, even for an
# individual file that may not need all of that loaded. Instead, consider making
# a separate helper file that requires the additional dependencies and performs
# the additional setup, and require it from the spec files that actually need
# it.
#
# See https://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
require 'rspec'
require 'rack/test'
RSpec.configure do |config|
# rspec-expectations config goes here. You can use an alternate
# assertion/expectation library such as wrong or the stdlib/minitest
# assertions if you prefer.
config.expect_with :rspec do |expectations|
# This option will default to `true` in RSpec 4. It makes the `description`
# and `failure_message` of custom matchers include text for helper methods
# defined using `chain`, e.g.:
# be_bigger_than(2).and_smaller_than(4).description
# # => "be bigger than 2 and smaller than 4"
# ...rather than:
# # => "be bigger than 2"
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end
# rspec-mocks config goes here. You can use an alternate test double
# library (such as bogus or mocha) by changing the `mock_with` option here.
config.mock_with :rspec do |mocks|
# Prevents you from mocking or stubbing a method that does not exist on
# a real object. This is generally recommended, and will default to
# `true` in RSpec 4.
mocks.verify_partial_doubles = true
end
# This option will default to `:apply_to_host_groups` in RSpec 4 (and will
# have no way to turn it off -- the option exists only for backwards
# compatibility in RSpec 3). It causes shared context metadata to be
# inherited by the metadata hash of host groups and examples, rather than
# triggering implicit auto-inclusion in groups with matching metadata.
config.shared_context_metadata_behavior = :apply_to_host_groups
# This allows you to limit a spec run to individual examples or groups
# you care about by tagging them with `:focus` metadata. When nothing
# is tagged with `:focus`, all examples get run. RSpec also provides
# aliases for `it`, `describe`, and `context` that include `:focus`
# metadata: `fit`, `fdescribe` and `fcontext`, respectively.
config.filter_run_when_matching :focus
# Allows RSpec to persist some state between runs in order to support
# the `--only-failures` and `--next-failure` CLI options. We recommend
# you configure your source control system to ignore this file.
config.example_status_persistence_file_path = "spec/examples.txt"
# Limits the available syntax to the non-monkey patched syntax that is
# recommended. For more details, see:
# https://relishapp.com/rspec/rspec-core/docs/configuration/zero-monkey-patching-mode
config.disable_monkey_patching!
# This setting enables warnings. It's recommended, but in some cases may
# be too noisy due to issues in dependencies.
config.warnings = true
# Many RSpec users commonly either run the entire suite or an individual
# file, and it's useful to allow more verbose output when running an
# individual spec file.
if config.files_to_run.one?
# Use the documentation formatter for detailed output,
# unless a formatter has already been configured
# (e.g. via a command-line flag).
config.default_formatter = "doc"
end
# Print the 10 slowest examples and example groups at the
# end of the spec run, to help surface which specs are running
# particularly slow.
config.profile_examples = 10
# Run specs in random order to surface order dependencies. If you find an
# order dependency and want to debug it, you can fix the order by providing
# the seed, which is printed after each run.
# --seed 1234
config.order = :random
# Seed global randomization in this process using the `--seed` CLI option.
# Setting this allows you to use `--seed` to deterministically reproduce
# test failures related to randomization by passing the same `--seed` value
# as the one that triggered the failure.
Kernel.srand config.seed
# Include testing API for Rack apps.
config.include Rack::Test::Methods
end
| ruby | MIT | 3af123cfa896838cde60a6e9a88384f9ffcee06d | 2026-01-04T17:47:25.662787Z | false |
auth0/omniauth-auth0 | https://github.com/auth0/omniauth-auth0/blob/9410989f01ecba40f8dd823847bacc66222b7b27/spec/spec_helper.rb | spec/spec_helper.rb | $LOAD_PATH.unshift File.expand_path(__dir__)
$LOAD_PATH.unshift File.expand_path('../lib', __dir__)
require 'multi_json'
require 'simplecov'
SimpleCov.start
if ENV['CI'] == 'true'
require 'simplecov-cobertura'
SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
end
require 'rspec'
require 'rack/test'
require 'webmock/rspec'
require 'omniauth'
require 'omniauth-auth0'
require 'sinatra'
WebMock.disable_net_connect!
RSpec.configure do |config|
config.include WebMock::API
config.include Rack::Test::Methods
config.extend OmniAuth::Test::StrategyMacros, type: :strategy
config.filter_run focus: true
config.run_all_when_everything_filtered = true
def app
@app || make_application
end
def make_application(options = {})
client_id = 'CLIENT_ID'
secret = 'CLIENT_SECRET'
domain = 'samples.auth0.com'
client_id = options.delete(:client_id) if options.key?(:client_id)
secret = options.delete(:client_secret) if options.key?(:client_secret)
domain = options.delete(:domain) if options.key?(:domain)
Sinatra.new do
configure do
enable :sessions
set :show_exceptions, false
set :session_secret, '9771aff2c634257053c62ba072c54754bd2cc92739b37e81c3eda505da48c2ec'
set :session_store, Rack::Session::Cookie
end
use OmniAuth::Builder do
provider :auth0, client_id, secret, domain, options
end
get '/auth/auth0/callback' do
MultiJson.encode(env['omniauth.auth'])
end
end
end
end
OmniAuth.config.logger = Logger.new('/dev/null')
| ruby | MIT | 9410989f01ecba40f8dd823847bacc66222b7b27 | 2026-01-04T17:47:30.179020Z | false |
auth0/omniauth-auth0 | https://github.com/auth0/omniauth-auth0/blob/9410989f01ecba40f8dd823847bacc66222b7b27/spec/omniauth/auth0/telemetry_spec.rb | spec/omniauth/auth0/telemetry_spec.rb | require 'spec_helper'
require 'json'
describe OmniAuth::Auth0::Telemetry do
let(:test_class) { Class.new.extend(OmniAuth::Auth0::Telemetry) }
describe 'telemetry' do
it 'should have the correct SDK name' do
expect(test_class.telemetry).to have_key(:name)
expect(test_class.telemetry[:name]).to eq('omniauth-auth0')
end
it 'should have the correct SDK version' do
expect(test_class.telemetry).to have_key(:version)
expect(test_class.telemetry[:version]).to eq(OmniAuth::Auth0::VERSION)
end
it 'should include the Ruby version' do
expect(test_class.telemetry).to have_key(:env)
expect(test_class.telemetry[:env]).to have_key(:ruby)
expect(test_class.telemetry[:env][:ruby]).to eq(RUBY_VERSION)
end
end
end
| ruby | MIT | 9410989f01ecba40f8dd823847bacc66222b7b27 | 2026-01-04T17:47:30.179020Z | false |
auth0/omniauth-auth0 | https://github.com/auth0/omniauth-auth0/blob/9410989f01ecba40f8dd823847bacc66222b7b27/spec/omniauth/auth0/jwt_validator_spec.rb | spec/omniauth/auth0/jwt_validator_spec.rb | require 'spec_helper'
require 'json'
require 'jwt'
describe OmniAuth::Auth0::JWTValidator do
#
# Reused data
#
let(:client_id) { 'CLIENT_ID' }
let(:client_secret) { 'CLIENT_SECRET' }
let(:domain) { 'samples.auth0.com' }
let(:future_timecode) { 32_503_680_000 }
let(:past_timecode) { 303_912_000 }
let(:valid_jwks_kid) { 'NkJCQzIyQzRBMEU4NjhGNUU4MzU4RkY0M0ZDQzkwOUQ0Q0VGNUMwQg' }
let(:rsa_private_key) do
OpenSSL::PKey::RSA.generate 2048
end
let(:valid_jwks) do
{
keys: [
{
kid: valid_jwks_kid,
x5c: [Base64.encode64(make_cert(rsa_private_key).to_der)]
}
]
}.to_json
end
let(:jwks) do
current_dir = File.dirname(__FILE__)
jwks_file = File.read("#{current_dir}/../../resources/jwks.json")
JSON.parse(jwks_file, symbolize_names: true)
end
#
# Specs
#
describe 'JWT verifier default values' do
let(:jwt_validator) do
make_jwt_validator
end
it 'should have the correct issuer' do
expect(jwt_validator.issuer).to eq('https://samples.auth0.com/')
end
end
describe 'JWT verifier token_head' do
let(:jwt_validator) do
make_jwt_validator
end
it 'should parse the head of a valid JWT' do
expect(jwt_validator.token_head(make_hs256_token)[:alg]).to eq('HS256')
end
it 'should fail parsing the head of a blank JWT' do
expect(jwt_validator.token_head('')).to eq({})
end
it 'should fail parsing the head of an invalid JWT' do
expect(jwt_validator.token_head('.')).to eq({})
end
it 'should throw an exception for invalid JSON' do
expect do
jwt_validator.token_head('QXV0aDA=')
end.to raise_error(JSON::ParserError)
end
end
describe 'JWT verifier jwks_public_cert' do
let(:jwt_validator) do
make_jwt_validator
end
it 'should return a public_key' do
x5c = jwks[:keys].first[:x5c].first
public_cert = jwt_validator.jwks_public_cert(x5c)
expect(public_cert.instance_of?(OpenSSL::PKey::RSA)).to eq(true)
end
it 'should fail with an invalid x5c' do
expect do
jwt_validator.jwks_public_cert('QXV0aDA=')
end.to raise_error(OpenSSL::X509::CertificateError)
end
end
describe 'JWT verifier jwks key parsing' do
let(:jwt_validator) do
make_jwt_validator
end
before do
stub_complete_jwks
end
it 'should return a key' do
expect(jwt_validator.jwks_key(:alg, valid_jwks_kid)).to eq('RS256')
end
it 'should return an x5c key' do
expect(jwt_validator.jwks_key(:x5c, valid_jwks_kid).length).to eq(1)
end
it 'should return nil if there is not key' do
expect(jwt_validator.jwks_key(:auth0, valid_jwks_kid)).to eq(nil)
end
it 'should return nil if the key ID is invalid' do
expect(jwt_validator.jwks_key(:alg, "#{valid_jwks_kid}_invalid")).to eq(nil)
end
end
describe 'JWT verifier custom issuer' do
context 'same as domain' do
let(:jwt_validator) do
make_jwt_validator(opt_issuer: domain)
end
it 'should have the correct issuer' do
expect(jwt_validator.issuer).to eq('https://samples.auth0.com/')
end
it 'should have the correct domain' do
expect(jwt_validator.issuer).to eq('https://samples.auth0.com/')
end
end
context 'different from domain' do
shared_examples_for 'has correct issuer and domain' do
let(:jwt_validator) { make_jwt_validator(opt_issuer: opt_issuer) }
it 'should have the correct issuer' do
expect(jwt_validator.issuer).to eq('https://different.auth0.com/')
end
it 'should have the correct domain' do
expect(jwt_validator.domain).to eq('https://samples.auth0.com/')
end
end
context 'without protocol and trailing slash' do
let(:opt_issuer) { 'different.auth0.com' }
it_behaves_like 'has correct issuer and domain'
end
context 'with protocol and trailing slash' do
let(:opt_issuer) { 'https://different.auth0.com/' }
it_behaves_like 'has correct issuer and domain'
end
end
end
describe 'JWT verifier verify' do
let(:jwt_validator) do
make_jwt_validator
end
before do
stub_complete_jwks
stub_expected_jwks
end
it 'should fail when JWT is nil' do
expect do
jwt_validator.verify(nil)
end.to raise_error(an_instance_of(OmniAuth::Auth0::TokenValidationError).and having_attributes({
message: "ID token is required but missing"
}))
end
it 'should fail when JWT is not well-formed' do
expect do
jwt_validator.verify('abc.123')
end.to raise_error(an_instance_of(OmniAuth::Auth0::TokenValidationError).and having_attributes({
message: "ID token could not be decoded"
}))
end
it 'should fail with missing issuer' do
expect do
jwt_validator.verify(make_hs256_token)
end.to raise_error(an_instance_of(OmniAuth::Auth0::TokenValidationError).and having_attributes({
message: "Issuer (iss) claim must be a string present in the ID token"
}))
end
it 'should fail with invalid issuer' do
payload = {
iss: 'https://auth0.com/'
}
token = make_hs256_token(payload)
expect do
jwt_validator.verify(token)
end.to raise_error(an_instance_of(OmniAuth::Auth0::TokenValidationError).and having_attributes({
message: "Issuer (iss) claim mismatch in the ID token, expected (https://samples.auth0.com/), found (https://auth0.com/)"
}))
end
it 'should fail when subject is missing' do
payload = {
iss: "https://#{domain}/",
sub: ''
}
token = make_hs256_token(payload)
expect do
jwt_validator.verify(token)
end.to raise_error(an_instance_of(OmniAuth::Auth0::TokenValidationError).and having_attributes({
message: "Subject (sub) claim must be a string present in the ID token"
}))
end
it 'should fail with missing audience' do
payload = {
iss: "https://#{domain}/",
sub: 'sub'
}
token = make_hs256_token(payload)
expect do
jwt_validator.verify(token)
end.to raise_error(an_instance_of(OmniAuth::Auth0::TokenValidationError).and having_attributes({
message: "Audience (aud) claim must be a string or array of strings present in the ID token"
}))
end
it 'should fail with invalid audience' do
payload = {
iss: "https://#{domain}/",
sub: 'sub',
aud: 'Auth0'
}
token = make_hs256_token(payload)
expect do
jwt_validator.verify(token)
end.to raise_error(an_instance_of(OmniAuth::Auth0::TokenValidationError).and having_attributes({
message: "Audience (aud) claim mismatch in the ID token; expected #{client_id} but found Auth0"
}))
end
it 'should fail when missing expiration' do
payload = {
iss: "https://#{domain}/",
sub: 'sub',
aud: client_id
}
token = make_hs256_token(payload)
expect do
jwt_validator.verify(token)
end.to raise_error(an_instance_of(OmniAuth::Auth0::TokenValidationError).and having_attributes({
message: "Expiration time (exp) claim must be a number present in the ID token"
}))
end
it 'should fail when past expiration' do
payload = {
iss: "https://#{domain}/",
sub: 'sub',
aud: client_id,
exp: past_timecode
}
token = make_hs256_token(payload)
expect do
jwt_validator.verify(token)
end.to raise_error(an_instance_of(OmniAuth::Auth0::TokenValidationError).and having_attributes({
message: "Expiration time (exp) claim error in the ID token; current time (#{Time.now}) is after expiration time (#{Time.at(past_timecode + 60)})"
}))
end
it 'should pass when past expiration but within default leeway' do
exp = Time.now.to_i - 59
payload = {
iss: "https://#{domain}/",
sub: 'sub',
aud: client_id,
exp: exp,
iat: past_timecode
}
token = make_hs256_token(payload)
id_token = jwt_validator.verify(token)
expect(id_token['exp']).to eq(exp)
end
it 'should fail when past expiration and outside default leeway' do
exp = Time.now.to_i - 61
payload = {
iss: "https://#{domain}/",
sub: 'sub',
aud: client_id,
exp: exp,
iat: past_timecode
}
token = make_hs256_token(payload)
expect do
jwt_validator.verify(token)
end.to raise_error(an_instance_of(OmniAuth::Auth0::TokenValidationError).and having_attributes({
message: "Expiration time (exp) claim error in the ID token; current time (#{Time.now}) is after expiration time (#{Time.at(exp + 60)})"
}))
end
it 'should fail when missing iat' do
payload = {
iss: "https://#{domain}/",
sub: 'sub',
aud: client_id,
exp: future_timecode
}
token = make_hs256_token(payload)
expect do
jwt_validator.verify(token)
end.to raise_error(an_instance_of(OmniAuth::Auth0::TokenValidationError).and having_attributes({
message: "Issued At (iat) claim must be a number present in the ID token"
}))
end
it 'should fail when authorize params has nonce but nonce is missing in the token' do
payload = {
iss: "https://#{domain}/",
sub: 'sub',
aud: client_id,
exp: future_timecode,
iat: past_timecode
}
token = make_hs256_token(payload)
expect do
jwt_validator.verify(token, { nonce: 'noncey' })
end.to raise_error(an_instance_of(OmniAuth::Auth0::TokenValidationError).and having_attributes({
message: "Nonce (nonce) claim must be a string present in the ID token"
}))
end
it 'should fail when authorize params has nonce but token nonce does not match' do
payload = {
iss: "https://#{domain}/",
sub: 'sub',
aud: client_id,
exp: future_timecode,
iat: past_timecode,
nonce: 'mismatch'
}
token = make_hs256_token(payload)
expect do
jwt_validator.verify(token, { nonce: 'noncey' })
end.to raise_error(an_instance_of(OmniAuth::Auth0::TokenValidationError).and having_attributes({
message: "Nonce (nonce) claim value mismatch in the ID token; expected (noncey), found (mismatch)"
}))
end
it 'should fail when “aud” is an array of strings and azp claim is not present' do
aud = [
client_id,
"https://#{domain}/userinfo"
]
payload = {
iss: "https://#{domain}/",
sub: 'sub',
aud: aud,
exp: future_timecode,
iat: past_timecode
}
token = make_hs256_token(payload)
expect do
jwt_validator.verify(token)
end.to raise_error(an_instance_of(OmniAuth::Auth0::TokenValidationError).and having_attributes({
message: "Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values"
}))
end
it 'should fail when "azp" claim doesnt match the expected aud' do
aud = [
client_id,
"https://#{domain}/userinfo"
]
payload = {
iss: "https://#{domain}/",
sub: 'sub',
aud: aud,
exp: future_timecode,
iat: past_timecode,
azp: 'not_expected'
}
token = make_hs256_token(payload)
expect do
jwt_validator.verify(token)
end.to raise_error(an_instance_of(OmniAuth::Auth0::TokenValidationError).and having_attributes({
message: "Authorized Party (azp) claim mismatch in the ID token; expected (#{client_id}), found (not_expected)"
}))
end
it 'should fail when “max_age” sent on the authentication request and this claim is not present' do
payload = {
iss: "https://#{domain}/",
sub: 'sub',
aud: client_id,
exp: future_timecode,
iat: past_timecode
}
token = make_hs256_token(payload)
expect do
jwt_validator.verify(token, { max_age: 60 })
end.to raise_error(an_instance_of(OmniAuth::Auth0::TokenValidationError).and having_attributes({
message: "Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified"
}))
end
it 'should fail when “max_age” sent on the authentication request and this claim added the “max_age” value doesn’t represent a date in the future' do
payload = {
iss: "https://#{domain}/",
sub: 'sub',
aud: client_id,
exp: future_timecode,
iat: past_timecode,
auth_time: past_timecode
}
token = make_hs256_token(payload)
expect do
jwt_validator.verify(token, { max_age: 60 })
end.to raise_error(an_instance_of(OmniAuth::Auth0::TokenValidationError).and having_attributes({
message: "Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (#{Time.now}) is after last auth time (#{Time.at(past_timecode + 60 + 60)})"
}))
end
it 'should fail when “max_age” sent on the authentication request and this claim added the “max_age” value doesn’t represent a date in the future, outside the default leeway' do
now = Time.now.to_i
auth_time = now - 121
max_age = 60
payload = {
iss: "https://#{domain}/",
sub: 'sub',
aud: client_id,
exp: future_timecode,
iat: past_timecode,
auth_time: auth_time
}
token = make_hs256_token(payload)
expect do
jwt_validator.verify(token, { max_age: max_age })
# Time.at(auth_time + max_age + leeway
end.to raise_error(an_instance_of(OmniAuth::Auth0::TokenValidationError).and having_attributes({
message: "Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (#{Time.now}) is after last auth time (#{Time.at(auth_time + max_age + 60)})"
}))
end
it 'should verify when “max_age” sent on the authentication request and this claim added the “max_age” value doesn’t represent a date in the future, outside the default leeway' do
now = Time.now.to_i
auth_time = now - 119
max_age = 60
payload = {
iss: "https://#{domain}/",
sub: 'sub',
aud: client_id,
exp: future_timecode,
iat: past_timecode,
auth_time: auth_time
}
token = make_hs256_token(payload)
id_token = jwt_validator.verify(token, { max_age: max_age })
expect(id_token['auth_time']).to eq(auth_time)
end
context 'Organization claim validation' do
it 'should fail when authorize params has organization but org_id is missing in the token' do
payload = {
iss: "https://#{domain}/",
sub: 'sub',
aud: client_id,
exp: future_timecode,
iat: past_timecode
}
token = make_hs256_token(payload)
expect do
jwt_validator.verify(token, { organization: 'org_123' })
end.to raise_error(an_instance_of(OmniAuth::Auth0::TokenValidationError).and having_attributes({
message: "Organization Id (org_id) claim must be a string present in the ID token"
}))
end
it 'should fail when authorize params has organization but org_name is missing in the token' do
payload = {
iss: "https://#{domain}/",
sub: 'sub',
aud: client_id,
exp: future_timecode,
iat: past_timecode
}
token = make_hs256_token(payload)
expect do
jwt_validator.verify(token, { organization: 'my-organization' })
end.to raise_error(an_instance_of(OmniAuth::Auth0::TokenValidationError).and(having_attributes({
message: 'Organization Name (org_name) claim must be a string present in the ID token'
})))
end
it 'should fail when authorize params has organization but token org_id does not match' do
payload = {
iss: "https://#{domain}/",
sub: 'sub',
aud: client_id,
exp: future_timecode,
iat: past_timecode,
org_id: 'org_5678'
}
token = make_hs256_token(payload)
expect do
jwt_validator.verify(token, { organization: 'org_1234' })
end.to raise_error(an_instance_of(OmniAuth::Auth0::TokenValidationError).and(having_attributes({
message: "Organization Id (org_id) claim value mismatch in the ID token; expected 'org_1234', found 'org_5678'"
})))
end
it 'should fail when authorize params has organization but token org_name does not match' do
payload = {
iss: "https://#{domain}/",
sub: 'sub',
aud: client_id,
exp: future_timecode,
iat: past_timecode,
org_name: 'another-organization'
}
token = make_hs256_token(payload)
expect do
jwt_validator.verify(token, { organization: 'my-organization' })
end.to raise_error(an_instance_of(OmniAuth::Auth0::TokenValidationError).and(having_attributes({
message: "Organization Name (org_name) claim value mismatch in the ID token; expected 'my-organization', found 'another-organization'"
})))
end
it 'should not fail when correctly given an organization ID' do
payload = {
iss: "https://#{domain}/",
sub: 'sub',
aud: client_id,
exp: future_timecode,
iat: past_timecode,
org_id: 'org_1234'
}
token = make_hs256_token(payload)
jwt_validator.verify(token, { organization: 'org_1234' })
end
it 'should not fail when correctly given an organization name' do
payload = {
iss: "https://#{domain}/",
sub: 'sub',
aud: client_id,
exp: future_timecode,
iat: past_timecode,
org_name: 'my-organization'
}
token = make_hs256_token(payload)
jwt_validator.verify(token, { organization: 'my-organization' })
end
it 'should not fail when given an organization name in a different casing' do
payload = {
iss: "https://#{domain}/",
sub: 'sub',
aud: client_id,
exp: future_timecode,
iat: past_timecode,
org_name: 'my-organization'
}
token = make_hs256_token(payload)
jwt_validator.verify(token, { organization: 'MY-ORGANIZATION' })
end
end
it 'should fail for RS256 token when kid is incorrect' do
domain = 'example.org'
sub = 'abc123'
payload = {
sub: sub,
exp: future_timecode,
iss: "https://#{domain}/",
iat: past_timecode,
aud: client_id
}
invalid_kid = 'invalid-kid'
token = make_rs256_token(payload, invalid_kid)
expect do
verified_token = make_jwt_validator(opt_domain: domain).verify(token)
end.to raise_error(an_instance_of(OmniAuth::Auth0::TokenValidationError).and having_attributes({
message: "Could not find a public key for Key ID (kid) 'invalid-kid'"
}))
end
it 'should fail when RS256 token has invalid signature' do
domain = 'example.org'
sub = 'abc123'
payload = {
sub: sub,
exp: future_timecode,
iss: "https://#{domain}/",
iat: past_timecode,
aud: client_id
}
token = make_rs256_token(payload) + 'bad'
expect do
verified_token = make_jwt_validator(opt_domain: domain).verify(token)
end.to raise_error(an_instance_of(JWT::VerificationError).and having_attributes({
message: "Signature verification failed"
}))
end
it 'should fail when algorithm is not RS256 or HS256' do
payload = {
iss: "https://#{domain}/",
sub: 'abc123',
aud: client_id,
exp: future_timecode,
iat: past_timecode
}
token = JWT.encode payload, 'secret', 'HS384'
expect do
jwt_validator.verify(token)
end.to raise_error(an_instance_of(OmniAuth::Auth0::TokenValidationError).and having_attributes({
message: "Signature algorithm of HS384 is not supported. Expected the ID token to be signed with RS256 or HS256"
}))
end
it 'should fail when HS256 token has invalid signature' do
payload = {
iss: "https://#{domain}/",
sub: 'abc123',
aud: client_id,
exp: future_timecode,
iat: past_timecode
}
token = make_hs256_token(payload, 'bad_secret')
expect do
# validator is configured to use "CLIENT_SECRET" by default
jwt_validator.verify(token)
end.to raise_error(an_instance_of(JWT::VerificationError))
end
it 'should verify a valid HS256 token with multiple audiences' do
audience = [
client_id,
"https://#{domain}/userinfo"
]
payload = {
iss: "https://#{domain}/",
sub: 'sub',
aud: audience,
exp: future_timecode,
iat: past_timecode,
azp: client_id
}
token = make_hs256_token(payload)
id_token = jwt_validator.verify(token)
expect(id_token['aud']).to eq(audience)
end
it 'should verify a standard HS256 token' do
sub = 'abc123'
payload = {
iss: "https://#{domain}/",
sub: sub,
aud: client_id,
exp: future_timecode,
iat: past_timecode
}
token = make_hs256_token(payload)
verified_token = jwt_validator.verify(token)
expect(verified_token['sub']).to eq(sub)
end
it 'should verify a standard RS256 token' do
domain = 'example.org'
sub = 'abc123'
payload = {
sub: sub,
exp: future_timecode,
iss: "https://#{domain}/",
iat: past_timecode,
aud: client_id
}
token = make_rs256_token(payload)
verified_token = make_jwt_validator(opt_domain: domain).verify(token)
expect(verified_token['sub']).to eq(sub)
end
it 'should verify a HS256 JWT signature when calling verify signature directly' do
sub = 'abc123'
payload = {
iss: "https://#{domain}/",
sub: sub,
aud: client_id,
exp: future_timecode,
iat: past_timecode
}
token = make_hs256_token(payload)
verified_token_signature = jwt_validator.verify_signature(token)
expect(verified_token_signature[0]).to eq('CLIENT_SECRET')
expect(verified_token_signature[1]).to eq('HS256')
end
it 'should verify a RS256 JWT signature verify signature directly' do
domain = 'example.org'
sub = 'abc123'
payload = {
sub: sub,
exp: future_timecode,
iss: "https://#{domain}/",
iat: past_timecode,
aud: client_id
}
token = make_rs256_token(payload)
verified_token_signature = make_jwt_validator(opt_domain: domain).verify_signature(token)
expect(verified_token_signature.length).to be(2)
expect(verified_token_signature[0]).to be_a(OpenSSL::PKey::RSA)
expect(verified_token_signature[1]).to eq('RS256')
end
end
private
def make_jwt_validator(opt_domain: domain, opt_issuer: nil)
opts = OpenStruct.new(
domain: opt_domain,
client_id: client_id,
client_secret: client_secret
)
opts[:issuer] = opt_issuer unless opt_issuer.nil?
OmniAuth::Auth0::JWTValidator.new(opts)
end
def make_hs256_token(payload = nil, secret = nil)
payload = { sub: 'abc123' } if payload.nil?
secret = client_secret if secret.nil?
JWT.encode payload, secret, 'HS256'
end
def make_rs256_token(payload = nil, kid = nil)
payload = { sub: 'abc123' } if payload.nil?
kid = valid_jwks_kid if kid.nil?
JWT.encode payload, rsa_private_key, 'RS256', kid: kid
end
def make_cert(private_key)
cert = OpenSSL::X509::Certificate.new
cert.issuer = OpenSSL::X509::Name.parse('/C=BE/O=Auth0/OU=Auth0/CN=Auth0')
cert.subject = cert.issuer
cert.not_before = Time.now
cert.not_after = Time.now + 365 * 24 * 60 * 60
cert.public_key = private_key.public_key
cert.serial = 0x0
cert.version = 2
ef = OpenSSL::X509::ExtensionFactory.new
ef.subject_certificate = cert
ef.issuer_certificate = cert
cert.extensions = [
ef.create_extension('basicConstraints', 'CA:TRUE', true),
ef.create_extension('subjectKeyIdentifier', 'hash')
]
cert.add_extension ef.create_extension(
'authorityKeyIdentifier',
'keyid:always,issuer:always'
)
cert.sign private_key, OpenSSL::Digest::SHA1.new
end
def stub_complete_jwks
stub_request(:get, 'https://samples.auth0.com/.well-known/jwks.json')
.to_return(
headers: { 'Content-Type' => 'application/json' },
body: jwks.to_json,
status: 200
)
end
def stub_expected_jwks
stub_request(:get, 'https://example.org/.well-known/jwks.json')
.to_return(
headers: { 'Content-Type' => 'application/json' },
body: valid_jwks,
status: 200
)
end
end
| ruby | MIT | 9410989f01ecba40f8dd823847bacc66222b7b27 | 2026-01-04T17:47:30.179020Z | false |
auth0/omniauth-auth0 | https://github.com/auth0/omniauth-auth0/blob/9410989f01ecba40f8dd823847bacc66222b7b27/spec/omniauth/strategies/auth0_spec.rb | spec/omniauth/strategies/auth0_spec.rb | # frozen_string_literal: true
require 'spec_helper'
require 'jwt'
require 'multi_json'
OmniAuth.config.allowed_request_methods = [:get, :post]
RSpec.shared_examples 'site has valid domain url' do |url|
it { expect(subject.site).to eq(url) }
end
describe OmniAuth::Strategies::Auth0 do
let(:client_id) { 'CLIENT_ID' }
let(:client_secret) { 'CLIENT_SECRET' }
let(:domain_url) { 'https://samples.auth0.com' }
let(:application) do
lambda do
[200, {}, ['Hello.']]
end
end
let(:auth0) do
OmniAuth::Strategies::Auth0.new(
application,
client_id,
client_secret,
domain_url
)
end
describe 'client_options' do
let(:subject) { OmniAuth::Strategies::Auth0.new(
application,
client_id,
client_secret,
domain_url
).client }
context 'domain with https' do
let(:domain_url) { 'https://samples.auth0.com' }
it_behaves_like 'site has valid domain url', 'https://samples.auth0.com'
end
context 'domain with http' do
let(:domain_url) { 'http://mydomain.com' }
it_behaves_like 'site has valid domain url', 'http://mydomain.com'
end
context 'domain with host only' do
let(:domain_url) { 'samples.auth0.com' }
it_behaves_like 'site has valid domain url', 'https://samples.auth0.com'
end
it 'should have correct authorize path' do
expect(subject.options[:authorize_url]).to eq('/authorize')
end
it 'should have the correct userinfo path' do
expect(subject.options[:userinfo_url]).to eq('/userinfo')
end
it 'should have the correct token path' do
expect(subject.options[:token_url]).to eq('/oauth/token')
end
end
describe 'options' do
let(:subject) { auth0.options }
it 'should have the correct client_id' do
expect(subject[:client_id]).to eq(client_id)
end
it 'should have the correct client secret' do
expect(subject[:client_secret]).to eq(client_secret)
end
it 'should have correct domain' do
expect(subject[:domain]).to eq(domain_url)
end
end
describe 'oauth' do
it 'redirects to hosted login page' do
get 'auth/auth0'
expect(last_response.status).to eq(302)
redirect_url = last_response.headers['Location']
expect(redirect_url).to start_with('https://samples.auth0.com/authorize')
expect(redirect_url).to have_query('response_type', 'code')
expect(redirect_url).to have_query('state')
expect(redirect_url).to have_query('client_id')
expect(redirect_url).to have_query('redirect_uri')
expect(redirect_url).not_to have_query('auth0Client')
expect(redirect_url).not_to have_query('connection')
expect(redirect_url).not_to have_query('connection_scope')
expect(redirect_url).not_to have_query('prompt')
expect(redirect_url).not_to have_query('screen_hint')
expect(redirect_url).not_to have_query('login_hint')
expect(redirect_url).not_to have_query('organization')
expect(redirect_url).not_to have_query('invitation')
end
it 'redirects to hosted login page' do
get 'auth/auth0?connection=abcd'
expect(last_response.status).to eq(302)
redirect_url = last_response.headers['Location']
expect(redirect_url).to start_with('https://samples.auth0.com/authorize')
expect(redirect_url).to have_query('response_type', 'code')
expect(redirect_url).to have_query('state')
expect(redirect_url).to have_query('client_id')
expect(redirect_url).to have_query('redirect_uri')
expect(redirect_url).to have_query('connection', 'abcd')
expect(redirect_url).not_to have_query('auth0Client')
expect(redirect_url).not_to have_query('connection_scope')
expect(redirect_url).not_to have_query('prompt')
expect(redirect_url).not_to have_query('screen_hint')
expect(redirect_url).not_to have_query('login_hint')
expect(redirect_url).not_to have_query('organization')
expect(redirect_url).not_to have_query('invitation')
end
it 'redirects to the hosted login page with connection_scope' do
get 'auth/auth0?connection_scope=identity_provider_scope'
expect(last_response.status).to eq(302)
redirect_url = last_response.headers['Location']
expect(redirect_url).to start_with('https://samples.auth0.com/authorize')
expect(redirect_url)
.to have_query('connection_scope', 'identity_provider_scope')
end
it 'redirects to hosted login page with prompt=login' do
get 'auth/auth0?prompt=login'
expect(last_response.status).to eq(302)
redirect_url = last_response.headers['Location']
expect(redirect_url).to start_with('https://samples.auth0.com/authorize')
expect(redirect_url).to have_query('response_type', 'code')
expect(redirect_url).to have_query('state')
expect(redirect_url).to have_query('client_id')
expect(redirect_url).to have_query('redirect_uri')
expect(redirect_url).to have_query('prompt', 'login')
expect(redirect_url).not_to have_query('auth0Client')
expect(redirect_url).not_to have_query('connection')
expect(redirect_url).not_to have_query('login_hint')
expect(redirect_url).not_to have_query('organization')
expect(redirect_url).not_to have_query('invitation')
end
it 'redirects to hosted login page with screen_hint=signup' do
get 'auth/auth0?screen_hint=signup'
expect(last_response.status).to eq(302)
redirect_url = last_response.headers['Location']
expect(redirect_url).to start_with('https://samples.auth0.com/authorize')
expect(redirect_url).to have_query('response_type', 'code')
expect(redirect_url).to have_query('state')
expect(redirect_url).to have_query('client_id')
expect(redirect_url).to have_query('redirect_uri')
expect(redirect_url).to have_query('screen_hint', 'signup')
expect(redirect_url).not_to have_query('auth0Client')
expect(redirect_url).not_to have_query('connection')
expect(redirect_url).not_to have_query('login_hint')
expect(redirect_url).not_to have_query('organization')
expect(redirect_url).not_to have_query('invitation')
end
it 'redirects to hosted login page with organization=TestOrg and invitation=TestInvite' do
get 'auth/auth0?organization=TestOrg&invitation=TestInvite'
expect(last_response.status).to eq(302)
redirect_url = last_response.headers['Location']
expect(redirect_url).to start_with('https://samples.auth0.com/authorize')
expect(redirect_url).to have_query('response_type', 'code')
expect(redirect_url).to have_query('state')
expect(redirect_url).to have_query('client_id')
expect(redirect_url).to have_query('redirect_uri')
expect(redirect_url).to have_query('organization', 'TestOrg')
expect(redirect_url).to have_query('invitation', 'TestInvite')
expect(redirect_url).not_to have_query('auth0Client')
expect(redirect_url).not_to have_query('connection')
expect(redirect_url).not_to have_query('connection_scope')
expect(redirect_url).not_to have_query('prompt')
expect(redirect_url).not_to have_query('screen_hint')
expect(redirect_url).not_to have_query('login_hint')
end
it 'redirects to hosted login page with login_hint=example@mail.com' do
get 'auth/auth0?login_hint=example@mail.com'
expect(last_response.status).to eq(302)
redirect_url = last_response.headers['Location']
expect(redirect_url).to start_with('https://samples.auth0.com/authorize')
expect(redirect_url).to have_query('response_type', 'code')
expect(redirect_url).to have_query('state')
expect(redirect_url).to have_query('client_id')
expect(redirect_url).to have_query('redirect_uri')
expect(redirect_url).to have_query('login_hint', 'example@mail.com')
expect(redirect_url).not_to have_query('auth0Client')
expect(redirect_url).not_to have_query('connection')
expect(redirect_url).not_to have_query('connection_scope')
expect(redirect_url).not_to have_query('prompt')
expect(redirect_url).not_to have_query('screen_hint')
expect(redirect_url).not_to have_query('organization')
expect(redirect_url).not_to have_query('invitation')
end
def session
session_cookie = last_response.cookies['rack.session'].first
session_data, _, _ = session_cookie.rpartition('--')
decoded_session_data = Base64.decode64(session_data)
Marshal.load(decoded_session_data)
end
it "stores session['authorize_params'] as a plain Ruby Hash" do
get '/auth/auth0'
expect(session['authorize_params'].class).to eq(::Hash)
end
describe 'callback' do
let(:access_token) { 'access token' }
let(:expires_in) { 2000 }
let(:token_type) { 'bearer' }
let(:refresh_token) { 'refresh token' }
let(:telemetry_value) { Class.new.extend(OmniAuth::Auth0::Telemetry).telemetry_encoded }
let(:user_id) { 'user identifier' }
let(:state) { SecureRandom.hex(8) }
let(:name) { 'John' }
let(:nickname) { 'J' }
let(:picture) { 'some picture url' }
let(:email) { 'mail@mail.com' }
let(:email_verified) { true }
let(:id_token) do
payload = {}
payload['sub'] = user_id
payload['iss'] = "#{domain_url}/"
payload['aud'] = client_id
payload['name'] = name
payload['nickname'] = nickname
payload['picture'] = picture
payload['email'] = email
payload['email_verified'] = email_verified
JWT.encode payload, client_secret, 'HS256'
end
let(:oauth_response) do
{
access_token: access_token,
expires_in: expires_in,
token_type: token_type
}
end
let(:oidc_response) do
{
id_token: id_token,
access_token: access_token,
expires_in: expires_in,
token_type: token_type
}
end
let(:basic_user_info) { { "sub" => user_id, "name" => name } }
def stub_auth(body)
stub_request(:post, 'https://samples.auth0.com/oauth/token')
.with(headers: { 'Auth0-Client' => telemetry_value })
.to_return(
headers: { 'Content-Type' => 'application/json' },
body: MultiJson.encode(body)
)
end
def stub_userinfo(body)
stub_request(:get, 'https://samples.auth0.com/userinfo')
.to_return(
headers: { 'Content-Type' => 'application/json' },
body: MultiJson.encode(body)
)
end
def trigger_callback
get '/auth/auth0/callback', { 'state' => state },
'rack.session' => { 'omniauth.state' => state }
end
before(:each) do
WebMock.reset!
end
let(:subject) do
MultiJson.decode(last_response.body)
end
context 'basic oauth' do
before do
stub_auth(oauth_response)
stub_userinfo(basic_user_info)
trigger_callback
end
it 'to succeed' do
expect(last_response.status).to eq(200)
end
it 'has credentials' do
expect(subject['credentials']['token']).to eq(access_token)
expect(subject['credentials']['expires']).to be true
expect(subject['credentials']['expires_at']).to_not be_nil
end
it 'has basic values' do
expect(subject['provider']).to eq('auth0')
expect(subject['uid']).to eq(user_id)
expect(subject['info']['name']).to eq(name)
end
it 'should use the user info endpoint' do
expect(subject['extra']['raw_info']).to eq(basic_user_info)
end
end
context 'basic oauth w/refresh token' do
before do
stub_auth(oauth_response.merge(refresh_token: refresh_token))
stub_userinfo(basic_user_info)
trigger_callback
end
it 'to succeed' do
expect(last_response.status).to eq(200)
end
it 'has credentials' do
expect(subject['credentials']['token']).to eq(access_token)
expect(subject['credentials']['refresh_token']).to eq(refresh_token)
expect(subject['credentials']['expires']).to be true
expect(subject['credentials']['expires_at']).to_not be_nil
end
end
context 'oidc' do
before do
stub_auth(oidc_response)
trigger_callback
end
it 'to succeed' do
expect(last_response.status).to eq(200)
end
it 'has credentials' do
expect(subject['credentials']['token']).to eq(access_token)
expect(subject['credentials']['expires']).to be true
expect(subject['credentials']['expires_at']).to_not be_nil
expect(subject['credentials']['id_token']).to eq(id_token)
end
it 'has basic values' do
expect(subject['provider']).to eq('auth0')
expect(subject['uid']).to eq(user_id)
end
it 'has info' do
expect(subject['info']['name']).to eq(name)
expect(subject['info']['nickname']).to eq(nickname)
expect(subject['info']['image']).to eq(picture)
expect(subject['info']['email']).to eq(email)
end
it 'has extra' do
expect(subject['extra']['raw_info']['email_verified']).to be true
end
end
end
end
describe 'error_handling' do
it 'fails when missing client_id' do
@app = make_application(client_id: nil)
get 'auth/auth0'
expect(last_response.status).to eq(302)
redirect_url = last_response.headers['Location']
expect(redirect_url).to fail_auth_with('missing_client_id')
end
it 'fails when missing client_secret' do
@app = make_application(client_secret: nil)
get 'auth/auth0'
expect(last_response.status).to eq(302)
redirect_url = last_response.headers['Location']
expect(redirect_url).to fail_auth_with('missing_client_secret')
end
it 'fails when missing domain' do
@app = make_application(domain: nil)
get 'auth/auth0'
expect(last_response.status).to eq(302)
redirect_url = last_response.headers['Location']
expect(redirect_url).to fail_auth_with('missing_domain')
end
end
end
RSpec::Matchers.define :fail_auth_with do |message|
match do |actual|
uri = URI(actual)
query = CGI.parse(uri.query)
(uri.path == '/auth/failure') &&
(query['message'] == [message]) &&
(query['strategy'] == ['auth0'])
end
end
RSpec::Matchers.define :have_query do |key, value|
match do |actual|
uri = redirect_uri(actual)
query = query(uri)
if value.nil?
query.key?(key)
else
query[key] == [value]
end
end
def redirect_uri(string)
URI(string)
end
def query(uri)
CGI.parse(uri.query)
end
end
| ruby | MIT | 9410989f01ecba40f8dd823847bacc66222b7b27 | 2026-01-04T17:47:30.179020Z | false |
auth0/omniauth-auth0 | https://github.com/auth0/omniauth-auth0/blob/9410989f01ecba40f8dd823847bacc66222b7b27/examples/sinatra/app.rb | examples/sinatra/app.rb | require 'sinatra'
require 'omniauth-auth0'
require 'dotenv/load'
use OmniAuth::Builder do
provider :auth0, ENV['CLIENT_ID'], ENV['CLIENT_SECRET'], ENV['DOMAIN']
end
enable :sessions
set :session_secret, ENV['SESSION_SECRET']
get '/' do
'Auth0 OmniAuth Example for Sinatra'
end
| ruby | MIT | 9410989f01ecba40f8dd823847bacc66222b7b27 | 2026-01-04T17:47:30.179020Z | false |
auth0/omniauth-auth0 | https://github.com/auth0/omniauth-auth0/blob/9410989f01ecba40f8dd823847bacc66222b7b27/lib/omniauth-auth0.rb | lib/omniauth-auth0.rb | require 'omniauth-auth0/version'
require 'omniauth/strategies/auth0'
| ruby | MIT | 9410989f01ecba40f8dd823847bacc66222b7b27 | 2026-01-04T17:47:30.179020Z | false |
auth0/omniauth-auth0 | https://github.com/auth0/omniauth-auth0/blob/9410989f01ecba40f8dd823847bacc66222b7b27/lib/omniauth-auth0/version.rb | lib/omniauth-auth0/version.rb | module OmniAuth
module Auth0
VERSION = '3.1.1'.freeze
end
end
| ruby | MIT | 9410989f01ecba40f8dd823847bacc66222b7b27 | 2026-01-04T17:47:30.179020Z | false |
auth0/omniauth-auth0 | https://github.com/auth0/omniauth-auth0/blob/9410989f01ecba40f8dd823847bacc66222b7b27/lib/omniauth/auth0/errors.rb | lib/omniauth/auth0/errors.rb | module OmniAuth
module Auth0
class TokenValidationError < StandardError
attr_reader :error_reason
def initialize(msg)
@error_reason = msg
super(msg)
end
end
end
end | ruby | MIT | 9410989f01ecba40f8dd823847bacc66222b7b27 | 2026-01-04T17:47:30.179020Z | false |
auth0/omniauth-auth0 | https://github.com/auth0/omniauth-auth0/blob/9410989f01ecba40f8dd823847bacc66222b7b27/lib/omniauth/auth0/jwt_validator.rb | lib/omniauth/auth0/jwt_validator.rb | require 'base64'
require 'uri'
require 'json'
require 'omniauth'
require 'omniauth/auth0/errors'
module OmniAuth
module Auth0
# JWT Validator class
# rubocop:disable Metrics/
class JWTValidator
attr_accessor :issuer, :domain
# Initializer
# @param options object
# options.domain - Application domain.
# options.issuer - Application issuer (optional).
# options.client_id - Application Client ID.
# options.client_secret - Application Client Secret.
def initialize(options, authorize_params = {})
@domain = uri_string(options.domain)
# Use custom issuer if provided, otherwise use domain
@issuer = @domain
@issuer = uri_string(options.issuer) if options.respond_to?(:issuer)
@client_id = options.client_id
@client_secret = options.client_secret
end
# Verify a token's signature. Only tokens signed with the RS256 or HS256 signatures are supported.
# Deprecated: Please use `decode` instead
# @return array - The token's key and signing algorithm
def verify_signature(jwt)
head = token_head(jwt)
key, alg = extract_key(head)
# Call decode to verify the signature
JWT.decode(jwt, key, true, decode_opts(alg))
return key, alg
end
# Decodes a JWT and verifies it's signature. Only tokens signed with the RS256 or HS256 signatures are supported.
# @param jwt string - JWT to verify.
# @return hash - The decoded token, if there were no exceptions.
# @see https://github.com/jwt/ruby-jwt
def decode(jwt)
head = token_head(jwt)
key, alg = extract_key(head)
# Call decode to verify the signature
JWT.decode(jwt, key, true, decode_opts(alg))
end
# Verify a JWT.
# @param jwt string - JWT to verify.
# @param authorize_params hash - Authorization params to verify on the JWT
# @return hash - The verified token payload, if there were no exceptions.
def verify(jwt, authorize_params = {})
if !jwt
raise OmniAuth::Auth0::TokenValidationError.new('ID token is required but missing')
end
parts = jwt.split('.')
if parts.length != 3
raise OmniAuth::Auth0::TokenValidationError.new('ID token could not be decoded')
end
id_token, header = decode(jwt)
verify_claims(id_token, authorize_params)
return id_token
end
# Get the decoded head segment from a JWT.
# @return hash - The parsed head of the JWT passed, empty hash if not.
def token_head(jwt)
jwt_parts = jwt.split('.')
return {} if blank?(jwt_parts) || blank?(jwt_parts[0])
json_parse(Base64.decode64(jwt_parts[0]))
end
# Get the JWKS from the issuer and return a public key.
# @param x5c string - X.509 certificate chain from a JWKS.
# @return key - The X.509 certificate public key.
def jwks_public_cert(x5c)
x5c = Base64.decode64(x5c)
# https://docs.ruby-lang.org/en/2.4.0/OpenSSL/X509/Certificate.html
OpenSSL::X509::Certificate.new(x5c).public_key
end
# Return a specific key from a JWKS object.
# @param key string - Key to find in the JWKS.
# @param kid string - Key ID to identify the right JWK.
# @return nil|string
def jwks_key(key, kid)
return nil if blank?(jwks[:keys])
matching_jwk = jwks[:keys].find { |jwk| jwk[:kid] == kid }
matching_jwk[key] if matching_jwk
end
private
# Get the JWT decode options. We disable the claim checks since we perform our claim validation logic
# Docs: https://github.com/jwt/ruby-jwt
# @return hash
def decode_opts(alg)
{
algorithm: alg,
verify_expiration: false,
verify_iat: false,
verify_iss: false,
verify_aud: false,
verify_jti: false,
verify_subj: false,
verify_not_before: false
}
end
def extract_key(head)
if head[:alg] == 'RS256'
key, alg = [rs256_decode_key(head[:kid]), head[:alg]]
elsif head[:alg] == 'HS256'
key, alg = [@client_secret, head[:alg]]
else
raise OmniAuth::Auth0::TokenValidationError.new("Signature algorithm of #{head[:alg]} is not supported. Expected the ID token to be signed with RS256 or HS256")
end
end
def rs256_decode_key(kid)
jwks_x5c = jwks_key(:x5c, kid)
if jwks_x5c.nil?
raise OmniAuth::Auth0::TokenValidationError.new("Could not find a public key for Key ID (kid) '#{kid}'")
end
jwks_public_cert(jwks_x5c.first)
end
# Get a JWKS from the domain
# @return void
def jwks
jwks_uri = URI(@domain + '.well-known/jwks.json')
@jwks ||= json_parse(Net::HTTP.get(jwks_uri))
end
# Rails Active Support blank method.
# @param obj object - Object to check for blankness.
# @return boolean
def blank?(obj)
obj.respond_to?(:empty?) ? obj.empty? : !obj
end
# Parse JSON with symbolized names.
# @param json string - JSON to parse.
# @return hash
def json_parse(json)
JSON.parse(json, symbolize_names: true)
end
# Parse a URI into the desired string format
# @param uri - the URI to parse
# @return string
def uri_string(uri)
temp_domain = URI(uri)
temp_domain = URI("https://#{uri}") unless temp_domain.scheme
temp_domain = temp_domain.to_s
temp_domain.end_with?('/') ? temp_domain : "#{temp_domain}/"
end
def verify_claims(id_token, authorize_params)
leeway = authorize_params[:leeway] || 60
max_age = authorize_params[:max_age]
nonce = authorize_params[:nonce]
organization = authorize_params[:organization]
verify_iss(id_token)
verify_sub(id_token)
verify_aud(id_token)
verify_expiration(id_token, leeway)
verify_iat(id_token)
verify_nonce(id_token, nonce)
verify_azp(id_token)
verify_auth_time(id_token, leeway, max_age)
verify_org(id_token, organization)
end
def verify_iss(id_token)
issuer = id_token['iss']
if !issuer
raise OmniAuth::Auth0::TokenValidationError.new("Issuer (iss) claim must be a string present in the ID token")
elsif @issuer != issuer
raise OmniAuth::Auth0::TokenValidationError.new("Issuer (iss) claim mismatch in the ID token, expected (#{@issuer}), found (#{id_token['iss']})")
end
end
def verify_sub(id_token)
subject = id_token['sub']
if !subject || !subject.is_a?(String) || subject.empty?
raise OmniAuth::Auth0::TokenValidationError.new('Subject (sub) claim must be a string present in the ID token')
end
end
def verify_aud(id_token)
audience = id_token['aud']
if !audience || !(audience.is_a?(String) || audience.is_a?(Array))
raise OmniAuth::Auth0::TokenValidationError.new("Audience (aud) claim must be a string or array of strings present in the ID token")
elsif audience.is_a?(Array) && !audience.include?(@client_id)
raise OmniAuth::Auth0::TokenValidationError.new("Audience (aud) claim mismatch in the ID token; expected #{@client_id} but was not one of #{audience.join(', ')}")
elsif audience.is_a?(String) && audience != @client_id
raise OmniAuth::Auth0::TokenValidationError.new("Audience (aud) claim mismatch in the ID token; expected #{@client_id} but found #{audience}")
end
end
def verify_expiration(id_token, leeway)
expiration = id_token['exp']
if !expiration || !expiration.is_a?(Integer)
raise OmniAuth::Auth0::TokenValidationError.new("Expiration time (exp) claim must be a number present in the ID token")
elsif expiration <= Time.now.to_i - leeway
raise OmniAuth::Auth0::TokenValidationError.new("Expiration time (exp) claim error in the ID token; current time (#{Time.now}) is after expiration time (#{Time.at(expiration + leeway)})")
end
end
def verify_iat(id_token)
if !id_token['iat']
raise OmniAuth::Auth0::TokenValidationError.new("Issued At (iat) claim must be a number present in the ID token")
end
end
def verify_nonce(id_token, nonce)
if nonce
received_nonce = id_token['nonce']
if !received_nonce
raise OmniAuth::Auth0::TokenValidationError.new("Nonce (nonce) claim must be a string present in the ID token")
elsif nonce != received_nonce
raise OmniAuth::Auth0::TokenValidationError.new("Nonce (nonce) claim value mismatch in the ID token; expected (#{nonce}), found (#{received_nonce})")
end
end
end
def verify_azp(id_token)
audience = id_token['aud']
if audience.is_a?(Array) && audience.length > 1
azp = id_token['azp']
if !azp || !azp.is_a?(String)
raise OmniAuth::Auth0::TokenValidationError.new("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values")
elsif azp != @client_id
raise OmniAuth::Auth0::TokenValidationError.new("Authorized Party (azp) claim mismatch in the ID token; expected (#{@client_id}), found (#{azp})")
end
end
end
def verify_auth_time(id_token, leeway, max_age)
if max_age
auth_time = id_token['auth_time']
if !auth_time || !auth_time.is_a?(Integer)
raise OmniAuth::Auth0::TokenValidationError.new("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified")
elsif Time.now.to_i > auth_time + max_age + leeway;
raise OmniAuth::Auth0::TokenValidationError.new("Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (#{Time.now}) is after last auth time (#{Time.at(auth_time + max_age + leeway)})")
end
end
end
def verify_org(id_token, organization)
return unless organization
validate_as_id = organization.start_with? 'org_'
if validate_as_id
org_id = id_token['org_id']
if !org_id || !org_id.is_a?(String)
raise OmniAuth::Auth0::TokenValidationError,
'Organization Id (org_id) claim must be a string present in the ID token'
elsif org_id != organization
raise OmniAuth::Auth0::TokenValidationError,
"Organization Id (org_id) claim value mismatch in the ID token; expected '#{organization}', found '#{org_id}'"
end
else
org_name = id_token['org_name']
if !org_name || !org_name.is_a?(String)
raise OmniAuth::Auth0::TokenValidationError,
'Organization Name (org_name) claim must be a string present in the ID token'
elsif org_name != organization.downcase
raise OmniAuth::Auth0::TokenValidationError,
"Organization Name (org_name) claim value mismatch in the ID token; expected '#{organization}', found '#{org_name}'"
end
end
end
end
end
end
| ruby | MIT | 9410989f01ecba40f8dd823847bacc66222b7b27 | 2026-01-04T17:47:30.179020Z | false |
auth0/omniauth-auth0 | https://github.com/auth0/omniauth-auth0/blob/9410989f01ecba40f8dd823847bacc66222b7b27/lib/omniauth/auth0/telemetry.rb | lib/omniauth/auth0/telemetry.rb | require 'json'
module OmniAuth
module Auth0
# Module to provide necessary telemetry for API requests.
module Telemetry
# Return a telemetry hash to be encoded and sent to Auth0.
# @return hash
def telemetry
telemetry = {
name: 'omniauth-auth0',
version: OmniAuth::Auth0::VERSION,
env: {
ruby: RUBY_VERSION
}
}
add_rails_version telemetry
end
# JSON-ify and base64 encode the current telemetry.
# @return string
def telemetry_encoded
Base64.urlsafe_encode64(JSON.dump(telemetry))
end
private
def add_rails_version(telemetry)
return telemetry unless Gem.loaded_specs['rails'].respond_to? :version
telemetry[:env][:rails] = Gem.loaded_specs['rails'].version.to_s
telemetry
end
end
end
end
| ruby | MIT | 9410989f01ecba40f8dd823847bacc66222b7b27 | 2026-01-04T17:47:30.179020Z | false |
auth0/omniauth-auth0 | https://github.com/auth0/omniauth-auth0/blob/9410989f01ecba40f8dd823847bacc66222b7b27/lib/omniauth/strategies/auth0.rb | lib/omniauth/strategies/auth0.rb | # frozen_string_literal: true
require 'base64'
require 'uri'
require 'securerandom'
require 'omniauth-oauth2'
require 'omniauth/auth0/jwt_validator'
require 'omniauth/auth0/telemetry'
require 'omniauth/auth0/errors'
module OmniAuth
module Strategies
# Auth0 OmniAuth strategy
class Auth0 < OmniAuth::Strategies::OAuth2
include OmniAuth::Auth0::Telemetry
option :name, 'auth0'
args %i[
client_id
client_secret
domain
]
# Setup client URLs used during authentication
def client
options.client_options.site = domain_url
options.client_options.authorize_url = '/authorize'
options.client_options.token_url = '/oauth/token'
options.client_options.userinfo_url = '/userinfo'
super
end
# Use the "sub" key of the userinfo returned
# as the uid (globally unique string identifier).
uid { raw_info['sub'] }
# Build the API credentials hash with returned auth data.
credentials do
credentials = {
'token' => access_token.token,
'expires' => true
}
if access_token.params
credentials.merge!(
'id_token' => access_token.params['id_token'],
'token_type' => access_token.params['token_type'],
'refresh_token' => access_token.refresh_token
)
end
# Retrieve and remove authorization params from the session
session_authorize_params = session['authorize_params'] || {}
session.delete('authorize_params')
auth_scope = session_authorize_params[:scope]
if auth_scope.respond_to?(:include?) && auth_scope.include?('openid')
# Make sure the ID token can be verified and decoded.
jwt_validator.verify(credentials['id_token'], session_authorize_params)
end
credentials
end
# Store all raw information for use in the session.
extra do
{
raw_info: raw_info
}
end
# Build a hash of information about the user
# with keys taken from the Auth Hash Schema.
info do
{
name: raw_info['name'] || raw_info['sub'],
nickname: raw_info['nickname'],
email: raw_info['email'],
image: raw_info['picture']
}
end
# Define the parameters used for the /authorize endpoint
def authorize_params
params = super
%w[connection connection_scope prompt screen_hint login_hint organization invitation ui_locales].each do |key|
params[key] = request.params[key] if request.params.key?(key)
end
# Generate nonce
params[:nonce] = SecureRandom.hex
# Generate leeway if none exists
params[:leeway] = 60 unless params[:leeway]
# Store authorize params in the session for token verification
session['authorize_params'] = params.to_hash
params
end
def build_access_token
options.token_params[:headers] = { 'Auth0-Client' => telemetry_encoded }
super
end
# Declarative override for the request phase of authentication
def request_phase
if no_client_id?
# Do we have a client_id for this Application?
fail!(:missing_client_id)
elsif no_client_secret?
# Do we have a client_secret for this Application?
fail!(:missing_client_secret)
elsif no_domain?
# Do we have a domain for this Application?
fail!(:missing_domain)
else
# All checks pass, run the Oauth2 request_phase method.
super
end
end
def callback_phase
super
rescue OmniAuth::Auth0::TokenValidationError => e
fail!(:token_validation_error, e)
end
private
def jwt_validator
@jwt_validator ||= OmniAuth::Auth0::JWTValidator.new(options)
end
# Parse the raw user info.
def raw_info
return @raw_info if @raw_info
if access_token["id_token"]
claims, header = jwt_validator.decode(access_token["id_token"])
@raw_info = claims
else
userinfo_url = options.client_options.userinfo_url
@raw_info = access_token.get(userinfo_url).parsed
end
return @raw_info
end
# Check if the options include a client_id
def no_client_id?
['', nil].include?(options.client_id)
end
# Check if the options include a client_secret
def no_client_secret?
['', nil].include?(options.client_secret)
end
# Check if the options include a domain
def no_domain?
['', nil].include?(options.domain)
end
# Normalize a domain to a URL.
def domain_url
domain_url = URI(options.domain)
domain_url = URI("https://#{domain_url}") if domain_url.scheme.nil?
domain_url.to_s
end
end
end
end
| ruby | MIT | 9410989f01ecba40f8dd823847bacc66222b7b27 | 2026-01-04T17:47:30.179020Z | false |
agoragames/activity_feed | https://github.com/agoragames/activity_feed/blob/4f93a29b69b70d6ae1dbbdb7ce3da83d4f413aa5/spec/version_spec.rb | spec/version_spec.rb | require 'spec_helper'
describe 'ActivityFeed::VERSION' do
it 'should be the correct version' do
expect(ActivityFeed::VERSION).to eq('3.1.0')
end
end | ruby | MIT | 4f93a29b69b70d6ae1dbbdb7ce3da83d4f413aa5 | 2026-01-04T17:47:31.631220Z | false |
agoragames/activity_feed | https://github.com/agoragames/activity_feed/blob/4f93a29b69b70d6ae1dbbdb7ce3da83d4f413aa5/spec/spec_helper.rb | spec/spec_helper.rb | require 'activity_feed'
require 'timecop'
require 'database_cleaner'
require 'support/mongoid'
require 'support/active_record'
RSpec.configure do |config|
config.mock_with :rspec
config.before(:all) do
DatabaseCleaner.strategy = :truncation
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.start
DatabaseCleaner.clean
ActivityFeed.configure do |configuration|
configuration.items_loader = nil
configuration.aggregate = false
configuration.redis = Redis.new(:db => 15)
end
ActivityFeed.redis.flushdb
end
config.after(:each) do
DatabaseCleaner.clean
ActivityFeed.redis.quit
end
# Helper method to add items to a given feed.
#
# @param items_to_add [int] Number of items to add to the feed.
def add_items_to_feed(user_id, items_to_add = 5, aggregate = ActivityFeed.aggregate)
1.upto(items_to_add) do |index|
ActivityFeed.update_item(user_id, index, Time.now.to_i, aggregate)
Timecop.travel(Time.now + 10)
end
Timecop.return
end
end | ruby | MIT | 4f93a29b69b70d6ae1dbbdb7ce3da83d4f413aa5 | 2026-01-04T17:47:31.631220Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.