Commit edb06ab2 authored by 徐豪's avatar 徐豪
Browse files

init

parents

Too many changes to show.

To preserve performance only 532 of 532+ files are displayed.
#
# 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.
#
# Install bzip2 and its shared library, libbz2.so
# This library object is required for building Python with the bz2 module,
# and should be picked up automatically when building Python.
name 'bzip2'
default_version '1.0.8'
license 'BSD-2-Clause'
license_file 'LICENSE'
skip_transitive_dependency_licensing true
dependency 'zlib'
dependency 'openssl' unless Build::Check.use_system_ssl?
version '1.0.8' do
source sha512: '083f5e675d73f3233c7930ebe20425a533feedeaaa9d8cc86831312a6581cefbe6ed0d08d2fa89be81082f2a5abdabca8b3c080bf97218a1bd59dc118a30b9f3'
end
source url: "https://sourceware.org/pub/bzip2/#{name}-#{version}.tar.gz"
relative_path "#{name}-#{version}"
build do
env = with_standard_compiler_flags(with_embedded_path)
# Avoid warning where .rodata cannot be used when making a shared object
env['CFLAGS'] << ' -fPIC'
# The list of arguments to pass to make
args = "PREFIX='#{install_dir}/embedded' VERSION='#{version}'"
patch source: 'makefile_take_env_vars.patch', env: env
make args.to_s, env: env
make "#{args} -f Makefile-libbz2_so", env: env
make "#{args} install", env: env
end
#
# 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 'cacerts'
license 'MPL-2.0'
license_file 'LICENSE'
skip_transitive_dependency_licensing true
# Date of the file is in a comment at the start, or in the changelog
default_version '2022.07.19'
display_version version.tr('.', '')
version '2022.07.19' do
# sha256sum only for the latest PEM is available at https://curl.se/ca/cacert.pem.sha256
source sha256: '6ed95025fba2aef0ce7b647607225745624497f876d74ef6ec22b26e73e9de77'
end
# Source URL looks like https://curl.haxx.se/ca/cacert-2018-01-17.pem. The
# version part has periods replaced with dashes.
source url: "https://curl.haxx.se/ca/cacert-#{version.tr('.', '-')}.pem"
build do
patch source: "license/#{version}/add-license-file.patch"
mkdir "#{install_dir}/embedded/ssl/certs"
# Append the 1024bit Verisign certs so that S3 continues to work
block do
File.open("#{project_dir}/cacert-#{version.tr('.', '-')}.pem", 'a') { |fd| fd.write(VERISIGN_CERTS) } unless File.foreach("#{project_dir}/cacert-#{version.tr('.', '-')}.pem").grep(/^Verisign Class 3 Public Primary Certification Authority$/).any?
end
copy "#{project_dir}/cacert-#{version.tr('.', '-')}.pem", "#{install_dir}/embedded/ssl/certs/cacert.pem"
link "#{install_dir}/embedded/ssl/certs/cacert.pem", "#{install_dir}/embedded/ssl/cert.pem"
block { File.chmod(0644, "#{install_dir}/embedded/ssl/certs/cacert.pem") }
end
VERISIGN_CERTS = <<-EOH.freeze
Verisign Class 3 Public Primary Certification Authority
=======================================================
-----BEGIN CERTIFICATE-----
MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkGA1UEBhMCVVMx
FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5
IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVow
XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz
IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA
A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94
f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol
hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBAgUAA4GBALtMEivPLCYA
TxQT3ab7/AoRhIzzKBxnki98tsX63/Dolbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59Ah
WM1pF+NEHJwZRDmJXNycAA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2Omuf
Tqj/ZA1k
-----END CERTIFICATE-----
Verisign Class 3 Public Primary Certification Authority
=======================================================
-----BEGIN CERTIFICATE-----
MIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCVVMx
FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5
IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVow
XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz
IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA
A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94
f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol
hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBABByUqkFFBky
CEHwxWsKzH4PIRnN5GfcX6kb5sroc50i2JhucwNhkcV8sEVAbkSdjbCxlnRhLQ2pRdKkkirWmnWX
bj9T/UWZYB2oK0z5XqcJ2HUw19JlYD1n1khVdWk/kfVIC0dpImmClr7JyDiGSnoscxlIaU5rfGW/
D/xwzoiQ
-----END CERTIFICATE-----
EOH
#
# Copyright:: Copyright (c) 2017 GitLab 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 'chef-acme'
version = Gitlab::Version.new(name, 'v4.1.6')
default_version version.print(false)
license 'Apache-2.0'
license_file 'LICENSE'
skip_transitive_dependency_licensing true
source git: version.remote
# Skip the gitlab-cookbook dependency if already loaded by the project. This improves build-ordering,
# due to how omnibus orders the components. Components that are dependencies of other components
# get moved in front of ones that are only defined in the project. Without this gate, gitlab-cookbooks
# ends up in front of components that change less frequently.
# Omnibus Build order: https://github.com/chef/omnibus/blob/c872e61c30d2b3f88ead03bd1254ff96d37059a3/lib/omnibus/library.rb#L64
dependency 'gitlab-cookbooks' unless project.dependencies.include?('gitlab-cookbooks')
dependency 'omnibus-gitlab-gems'
dependency 'compat_resource'
target_path = "#{install_dir}/embedded/cookbooks/acme"
build do
sync "#{project_dir}/", target_path
end
#
# Copyright 2012-2014 Chef Software, Inc.
# Copyright 2017-2022 GitLab Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
require 'mixlib/shellout'
name 'chef-gem'
# The version here should be in agreement with the chef-bin/cinc version and
# /Gemfile.lock so that our rspec testing stays consistent with the package
# contents.
default_version '18.3.0'
license 'Apache-2.0'
license_file 'LICENSE'
license_file 'NOTICE'
skip_transitive_dependency_licensing true
dependency 'ruby'
dependency 'rubygems'
dependency 'libffi'
dependency 'rb-readline'
dependency 'omnibus-gitlab-gems'
build do
patch source: "license/add-license-file.patch"
patch source: "license/add-notice-file.patch"
env = with_standard_compiler_flags(with_embedded_path)
block 'patch Chef files' do
prefix_path = "#{install_dir}/embedded"
gem_path = shellout!("#{embedded_bin('ruby')} -e \"puts Gem.path.find { |path| path.start_with?(\'#{prefix_path}\') }\"", env: env).stdout.chomp
patch source: "drop-eol-warning.patch",
target: "#{gem_path}/gems/chef-#{version}/lib/chef/client.rb"
patch source: "utf8-locale-support.patch",
target: "#{gem_path}/gems/chef-config-#{version}/lib/chef-config/config.rb"
end
end
#
# Copyright:: Copyright (c) 2017 GitLab 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 'compat_resource'
version = Gitlab::Version.new('compat_resource', 'v12.19.1')
default_version version.print(false)
license 'Apache-2.0'
license_file 'LICENSE'
skip_transitive_dependency_licensing true
source git: version.remote
target_path = "#{install_dir}/embedded/cookbooks/compat_resource"
build do
sync "#{project_dir}/", target_path
end
#
# 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.
#
require "#{Omnibus::Config.project_root}/lib/gitlab/version"
name 'config_guess'
# Locking version to a specific commit so that cache doesn't get invalidated unannounced
version = Gitlab::Version.new('config_guess', 'c9092d05347c925a26f6887980e185206e13f9d6')
default_version version.print(false)
# occasionally http protocol downloads get 500s, so we use git://
source git: version.remote
# http://savannah.gnu.org/projects/config
license 'GPL-3.0 (with exception)'
license_file 'LICENSE'
skip_transitive_dependency_licensing true
relative_path "config_guess-#{version.print}"
build do
patch source: 'add-license-file.patch'
mkdir "#{install_dir}/embedded/lib/config_guess"
copy "#{project_dir}/config.guess", "#{install_dir}/embedded/lib/config_guess/config.guess"
copy "#{project_dir}/config.sub", "#{install_dir}/embedded/lib/config_guess/config.sub"
end
#
# Copyright:: Copyright (c) 2017 GitLab 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 'consul'
# This version should be keep in sync with consul versions in
# consul_download.rb and consul_helper.rb.
version = Gitlab::Version.new('consul', 'v1.18.2')
default_version version.print(false)
license 'BSL-Hashicorp'
license_file 'LICENSE'
source git: version.remote
skip_transitive_dependency_licensing true
relative_path 'src/github.com/hashicorp/consul'
build do
env = {}
env['GOPATH'] = "#{Omnibus::Config.source_dir}/consul"
env['GOTOOLCHAIN'] = 'local'
env['PATH'] = "#{Gitlab::Util.get_env('PATH')}:#{env['GOPATH']}/bin"
command 'make dev', env: env
mkdir "#{install_dir}/embedded/bin"
copy 'bin/consul', "#{install_dir}/embedded/bin/"
command "license_finder report --enabled-package-managers godep gomodules --decisions-file=#{Omnibus::Config.project_root}/support/dependency_decisions.yml --format=json --columns name version licenses texts notice --save=license.json"
copy "license.json", "#{install_dir}/licenses/consul.json"
end
#
# 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 'curl'
version = Gitlab::Version.new('curl', 'curl-8_8_0')
default_version version.print(false)
display_version version.print(false).delete_prefix('curl-').tr('_', '.')
# Runtime dependency
dependency 'zlib'
dependency 'openssl' unless Build::Check.use_system_ssl?
dependency 'libtool'
vendor 'haxx'
license 'MIT'
license_file 'COPYING'
skip_transitive_dependency_licensing true
source git: version.remote
build do
env = with_standard_compiler_flags(with_embedded_path)
env['ACLOCAL_PATH'] = "#{install_dir}/embedded/share/aclocal"
delete "#{project_dir}/src/tool_hugehelp.c"
configure_command = [
'./configure',
"--prefix=#{install_dir}/embedded",
"--disable-option-checking",
'--disable-manual',
'--disable-debug',
'--enable-optimize',
'--disable-ldap',
'--disable-ldaps',
'--disable-rtsp',
'--enable-proxy',
"--disable-pop3",
"--disable-imap",
"--disable-smtp",
"--disable-gopher",
'--disable-dependency-tracking',
'--enable-ipv6',
"--without-libidn2",
'--without-librtmp',
"--without-zsh-functions-dir",
"--without-fish-functions-dir",
"--disable-mqtt",
'--without-libssh2',
'--without-nghttp2',
"--with-zlib=#{install_dir}/embedded",
"--without-ca-path",
"--without-ca-bundle",
"--with-ca-fallback",
"--without-zstd",
"-without-libpsl"
]
openssl_library_path = "=#{install_dir}/embedded" unless Build::Check.use_system_ssl?
configure_command << "--with-openssl#{openssl_library_path}"
command "autoreconf -fi", env: env
command configure_command.join(' '), env: env
make "-j #{workers}", env: env
make 'install', env: env
end
project.exclude 'embedded/bin/curl-config'
#
# Copyright:: Copyright (c) 2019 GitLab B.V.
# 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.
#
require "#{Omnibus::Config.project_root}/lib/gitlab/version"
version = Gitlab::Version.new('docker-distribution-pruner', '0.2.0')
name 'docker-distribution-pruner'
default_version version.print
license 'MIT'
license_file 'LICENSE'
skip_transitive_dependency_licensing true
source git: version.remote
relative_path 'src/gitlab.com/gitlab-org/docker-distribution-pruner'
build do
env = {
'GOPATH' => "#{Omnibus::Config.source_dir}/docker-distribution-pruner",
'GOTOOLCHAIN' => 'local',
}
command "go build -ldflags '-s -w' ./cmds/docker-distribution-pruner", env: env
mkdir "#{install_dir}/embedded/bin/"
copy 'docker-distribution-pruner', "#{install_dir}/embedded/bin/"
command "license_finder report --enabled-package-managers godep gomodules --decisions-file=#{Omnibus::Config.project_root}/support/dependency_decisions.yml --format=json --columns name version licenses texts notice --save=license.json"
copy "license.json", "#{install_dir}/licenses/docker-distribution-pruner.json"
end
#
# Copyright:: Copyright (c) 2019 GitLab 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 'exiftool'
version = Gitlab::Version.new('exiftool', '12.87')
default_version version.print(false)
license 'GPL-1.0 or Artistic'
license_file 'LICENSE'
skip_transitive_dependency_licensing true
source git: version.remote
build do
# exiftool has a hardcoded list of locations where it looks for libraries. We
# patch it to add the bundled one
patch source: 'lib-location.patch'
# exiftool is published under the same license as perl
# patch the license file to reflect this
patch source: 'license.patch'
# Only support JPEG and TIFF files
patch source: 'allowlist-types.patch'
# Ensuring a bin directory exists
mkdir "#{install_dir}/embedded/bin"
# Copying necessary files from source
sync "lib", "#{install_dir}/embedded/lib/exiftool-perl"
copy "exiftool", "#{install_dir}/embedded/bin/exiftool"
end
#
# Copyright:: Copyright (c) 2023 GitLab 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.
#
name 'git-filter-repo'
version = Gitlab::Version.new('git-filter-repo', 'v2.38.0')
default_version version.print(false)
license 'MIT'
license_file 'COPYING'
license_file 'COPYING.gpl'
license_file 'COPYING.mit'
skip_transitive_dependency_licensing true
# Git is marked as a project dependency to be built before `git-filter-repo`.
# Adding it as a software dependency to `git-filter-repo` will cause it to be
# rebuilt early in the build list, bust cache, and cause everything after it to
# be rebuilt.
# dependency 'git'
dependency 'python3'
build do
env = with_standard_compiler_flags(with_embedded_path)
patch source: "license/add-license-file.patch"
patch source: "license/add-mit-license-file.patch"
patch source: "license/add-gpl-license-file.patch"
command "#{install_dir}/embedded/bin/pip3 install git-filter-repo==#{default_version}", env: env
end
#
## Copyright:: Copyright (c) 2014 GitLab.com
## 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.
##
#
require "#{Omnibus::Config.project_root}/lib/gitlab/version"
require "#{Omnibus::Config.project_root}/lib/gitlab/ohai_helper.rb"
require "#{Omnibus::Config.project_root}/lib/gitlab/build/info/components"
version = Gitlab::Version.new('gitaly')
name 'git'
# We simply use Gitaly's version as the git version here given that Gitaly is
# the provider of git and manages the version for us.
default_version version.print
license 'GPL-2.0'
license_file '_build/deps/git/source/COPYING'
vendor 'gitlab'
skip_transitive_dependency_licensing true
# Runtime dependency
dependency 'zlib'
dependency 'openssl' unless Build::Check.use_system_ssl?
dependency 'curl'
dependency 'pcre2'
dependency 'libiconv'
source git: version.remote
build do
env = with_standard_compiler_flags(with_embedded_path)
git_cflags = '-fno-omit-frame-pointer'
# CentOS 7 uses gcc v4.8.5, which uses C90 (`-std=gnu90`) by default.
# C11 is a newer standard than C90, and gcc v5.1.0 switched the default
# from `std=gnu90` to `std=gnu11`.
# Git v2.35 added a balloon test that will fail the build if
# C99 is not supported. On other platforms, C11 may be required
# (https://gitlab.com/gitlab-org/gitlab-git/-/commit/7bc341e21b5).
# Similar is the case for SLES OSs also.
git_cflags += ' -std=gnu99' if OhaiHelper.get_centos_version.to_i == 7 || OhaiHelper.os_platform == 'sles'
build_options = [
"# Added by Omnibus git software definition git.rb",
"GIT_APPEND_BUILD_OPTIONS += CURLDIR=#{install_dir}/embedded",
"GIT_APPEND_BUILD_OPTIONS += ICONVDIR=#{install_dir}/embedded",
"GIT_APPEND_BUILD_OPTIONS += ZLIB_PATH=#{install_dir}/embedded",
"GIT_APPEND_BUILD_OPTIONS += NEEDS_LIBICONV=YesPlease",
"GIT_APPEND_BUILD_OPTIONS += NO_R_TO_GCC_LINKER=YesPlease",
"GIT_APPEND_BUILD_OPTIONS += INSTALL_SYMLINKS=YesPlease",
"GIT_APPEND_BUILD_OPTIONS += CFLAGS=\"#{git_cflags}\""
]
if Build::Check.use_system_ssl?
env['FIPS_MODE'] = '1'
else
build_options << "GIT_APPEND_BUILD_OPTIONS += OPENSSLDIR=#{install_dir}/embedded"
end
sm_version_override_git_repo_url = Gitlab::Util.get_env('SELF_MANAGED_VERSION_REGEX_OVERRIDE_GIT_REPO_URL')
git_repo_url = Gitlab::Util.get_env('GITALY_GIT_REPO_URL')
if Build::Check.is_auto_deploy_tag?
# Gitaly potentially bundles multiple different Git distributions with it.
# It is possible to override the specific version that Gitaly compiles each
# of these distributions with by setting:
#
# `GIT_VERSION_2_38=v2.38.1`
#
# As the bundled Git versions change over time we have this generic loop to
# just accept any such override into the environment used by make.
ENV.select { |k, v| k.start_with?('GITALY_GIT_VERSION_') }.each do |k, v|
env[k.delete_prefix('GITALY_')] = v unless v&.empty?
end
env['GIT_REPO_URL'] = git_repo_url if git_repo_url
elsif sm_version_override_git_repo_url && Regexp.new(sm_version_override_git_repo_url).match?(Build::Info::Components::GitLabRails.version)
env['GIT_REPO_URL'] = git_repo_url if git_repo_url
end
block do
File.open(File.join(project_dir, 'config.mak'), 'a') do |file|
file.print build_options.join("\n")
end
end
# For now we install both a Git distribution as well as bundled Git. This is
# only done temporarily to migrate to bundled Git via a feature flagged
# rollout. Eventually, we will only install bundled Git.
command "make git install-bundled-git PREFIX=#{install_dir}/embedded GIT_PREFIX=#{install_dir}/embedded", env: env
end
#
# Copyright:: Copyright (c) 2017-2022 GitLab Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
require "#{Omnibus::Config.project_root}/lib/gitlab/version"
require "#{Omnibus::Config.project_root}/lib/gitlab/ohai_helper.rb"
version = Gitlab::Version.new('gitaly')
name 'gitaly'
default_version version.print
license 'MIT'
license_file 'LICENSE'
skip_transitive_dependency_licensing true
dependency 'pkg-config-lite'
dependency 'ruby'
dependency 'libicu'
dependency 'omnibus-gitlab-gems'
# Technically, gitaly depends on git also. But because of how omnibus arranges
# components to be built, this causes git to be built early in the process. But
# in our case, git is built from gitaly source code. This results in git
# invalidating the cache frequently as Gitaly's master branch is a fast moving
# target. So, we are kinda cheating here and depending on the presence of git
# in the project's direct dependency list before gitaly as a workaround.
# The conditional will ensure git gets built before gitaly in scenarios where
# the entire GitLab project is not built, but only a subset of it is.
dependency 'git' unless project.dependencies.include?('git')
source git: version.remote
build do
env = with_standard_compiler_flags(with_embedded_path)
if Build::Check.use_system_ssl?
env['CMAKE_FLAGS'] = OpenSSLHelper.cmake_flags
env['PKG_CONFIG_PATH'] = OpenSSLHelper.pkg_config_dirs
env['FIPS_MODE'] = '1'
end
make "install PREFIX=#{install_dir}/embedded", env: env
command "license_finder report --decisions-file=#{Omnibus::Config.project_root}/support/dependency_decisions.yml --format=json --columns name version licenses texts notice --save=licenses.json"
copy "licenses.json", "#{install_dir}/licenses/gitaly.json"
end
#
# Copyright:: Copyright (c) 2024 GitLab 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.
#
require 'digest'
name 'gitlab-backup-cli'
license 'Apache-2.0'
license_file File.expand_path('LICENSE', Omnibus::Config.project_root)
skip_transitive_dependency_licensing true
# This 'software' is self-contained in this file. Use the file contents
# to generate a version string.
default_version Digest::MD5.file(__FILE__).hexdigest
build do
mkdir "#{install_dir}/bin/"
# Create a wrapper for the gitlab-backup-cli tool
erb dest: "#{install_dir}/bin/gitlab-backup-cli",
source: 'gitlab_backup_cli_wrapper.erb',
mode: 0755,
vars: { install_dir: install_dir }
end
#
# Copyright:: Copyright (c) 2014 GitLab B.V.
# 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.
#
name 'gitlab-config-template'
license 'Apache-2.0'
license_file File.expand_path('LICENSE', Omnibus::Config.project_root)
skip_transitive_dependency_licensing true
source path: File.expand_path('files/gitlab-config-template', Omnibus::Config.project_root)
build do
mkdir "#{install_dir}/etc"
sync './', "#{install_dir}/etc/"
end
#
# Copyright:: Copyright (c) 2012 Opscode, Inc.
# Copyright:: Copyright (c) 2014 GitLab.com
# 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.
#
name 'gitlab-cookbooks'
license 'Apache-2.0'
license_file File.expand_path('LICENSE', Omnibus::Config.project_root)
skip_transitive_dependency_licensing true
EE = Build::Check.include_ee?
JH = Build::Check.is_jh?
source path: File.expand_path('files/gitlab-cookbooks', Omnibus::Config.project_root)
build do
cookbook_name = 'gitlab'
mkdir "#{install_dir}/embedded/cookbooks"
sync './', "#{install_dir}/embedded/cookbooks/"
solo_recipes = %w(dna postgresql-bin postgresql-config pg-upgrade-config)
# If EE package, use a different master cookbook
if EE
cookbook_name = JH ? 'gitlab-jh' : 'gitlab-ee'
solo_recipes << 'geo-postgresql-config'
solo_recipes << 'patroni-config'
else
delete "#{install_dir}/embedded/cookbooks/gitlab-ee"
end
solo_recipes.each do |config|
erb dest: "#{install_dir}/embedded/cookbooks/#{config}.json",
source: "#{config}.json.erb",
mode: 0644,
vars: { master_cookbook: cookbook_name }
end
block do
if Build::Check.use_system_ssl?
solo_file = "#{install_dir}/embedded/cookbooks/solo.rb"
data = File.read(solo_file)
data.sub!(/^fips false/, 'fips true')
File.write(solo_file, data)
end
end
end
#
# Copyright:: Copyright (c) 2017 GitLab 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 'gitlab-ctl-ee'
license 'Apache-2.0'
license_file File.expand_path('LICENSE', Omnibus::Config.project_root)
skip_transitive_dependency_licensing true
dependency 'gitlab-ctl'
ee = Build::Check.include_ee?
source path: File.expand_path(
'files/gitlab-ctl-commands-ee', Omnibus::Config.project_root
)
build do
sync './', "#{install_dir}/embedded/service/omnibus-ctl-ee/" if ee
end
#
# Copyright:: Copyright (c) 2012 Opscode, Inc.
# Copyright:: Copyright (c) 2014 GitLab.com
# 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.
#
name 'gitlab-ctl'
license 'Apache-2.0'
license_file File.expand_path('LICENSE', Omnibus::Config.project_root)
skip_transitive_dependency_licensing true
dependency 'omnibus-ctl'
source path: File.expand_path('files/gitlab-ctl-commands', Omnibus::Config.project_root)
build do
mkdir "#{install_dir}/bin/"
block do
File.open("#{install_dir}/bin/gitlab-ctl", 'w') do |file|
file.print <<-EOH
#!/bin/bash
#
# Copyright:: Copyright (c) 2012 Opscode, Inc.
# Copyright:: Copyright (c) 2014 GitLab.com
# 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.
#
# Ensure the calling environment (disapproval look Bundler) does not infect our
# Ruby environment if gitlab-ctl is called from a Ruby script.
for ruby_env_var in RUBYOPT \\
RUBYLIB \\
BUNDLE_BIN_PATH \\
BUNDLE_GEMFILE \\
GEM_PATH \\
GEM_HOME
do
unset $ruby_env_var
done
# This bumps the default svwait timeout from 7 seconds to 30 seconds
# As documented at http://smarden.org/runit/sv.8.html
export SVWAIT=30
if [ "$1" == "reconfigure" ] && [ "$UID" != "0" ]; then
echo "This command must be executed as root user"
exit 1
fi
#{install_dir}/embedded/bin/omnibus-ctl #{File.basename(install_dir)} '#{install_dir}/embedded/service/omnibus-ctl*' "$@"
EOH
end
end
command "chmod 755 #{install_dir}/bin/gitlab-ctl"
# additional omnibus-ctl commands
sync './', "#{install_dir}/embedded/service/omnibus-ctl/"
end
#
# Copyright:: Copyright (c) 2017 GitLab Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
require "#{Omnibus::Config.project_root}/lib/gitlab/version"
version = Gitlab::Version.new('gitlab-elasticsearch-indexer')
name 'gitlab-elasticsearch-indexer'
default_version version.print
license 'MIT'
license_file 'LICENSE.md'
skip_transitive_dependency_licensing true
dependency 'libicu'
source git: version.remote
build do
env = with_standard_compiler_flags(with_embedded_path)
make "install PREFIX=#{install_dir}/embedded", env: env
command "license_finder report --decisions-file=#{Omnibus::Config.project_root}/support/dependency_decisions.yml --format=json --columns name version licenses texts notice --save=license.json"
copy "license.json", "#{install_dir}/licenses/gitlab-elasticsearch-indexer.json"
end
#
# Copyright 2016-2022 GitLab 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 'gitlab-exporter'
default_version '15.0.0'
license 'MIT'
license_file 'LICENSE'
skip_transitive_dependency_licensing true
dependency 'ruby'
dependency 'rubygems'
dependency 'postgresql'
build do
patch source: 'add-license-file.patch'
env = with_standard_compiler_flags(with_embedded_path)
gem "install gitlab-exporter --no-document --version #{version}", env: env
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment