Skip to content

Commit

Permalink
Merge pull request #632 from h0tw1r3/amazon2023
Browse files Browse the repository at this point in the history
Amazon 2023 FOSS support
  • Loading branch information
nmburgan authored Oct 1, 2024
2 parents ce2c81d + de01761 commit aeb7735
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This changelog adheres to [Keep a CHANGELOG](http://keepachangelog.com/).

## [Unreleased]
* Add AmazonLinux 2023 as a FOSS build target
* Drop platform 6 fpm support
* On all Debian platforms simplify java depends, allow 17 or 11, prefer 17
* Add Debian 12 bookworm as a FOSS build target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ packager: 'puppetlabs'
gpg_key: '4528B6CD9E61EF26'
sign_tar: FALSE
# a space separated list of mock configs
final_mocks: 'pl-el-7-x86_64 pl-el-8-x86_64 pl-el-9-x86_64 pl-sles-12-x86_64 pl-sles-15-x86_64'
final_mocks: 'pl-el-7-x86_64 pl-el-8-x86_64 pl-el-9-x86_64 pl-sles-12-x86_64 pl-sles-15-x86_64 pl-amazon-2023-x86_64'
yum_host: 'yum.puppetlabs.com'
yum_repo_path: '/opt/repository/yum/'
build_gem: FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ case $os in
dir="$basepath/old_el"
fi
;;
amazon)
dir="$basepath/systemd_el"
;;
sles)
if [ "$os_version" -gt '11' ]; then
dir="$basepath/systemd_el"
Expand Down Expand Up @@ -161,7 +164,7 @@ params+=('--create-dir' '<%= directory -%>')
params+=('--enterprise-build')
<% end -%>

if [[ "$os" = 'el' || "$os" = 'sles' || "$os" = 'fedora' || "$os" = 'redhatfips' ]]; then
if [[ "$os" = 'el' || "$os" = 'sles' || "$os" = 'fedora' || "$os" = 'redhatfips' || "$os" = 'amazon' ]]; then
# pull in rpm dependencies
<%EZBake::Config[:redhat][:additional_dependencies].each do |dep| -%>
params+=("--additional-dependency")
Expand Down
14 changes: 11 additions & 3 deletions resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
options.termini_description = nil

OptionParser.new do |opts|
opts.on('-o', '--operating-system OS', [:fedora, :el, :redhatfips, :sles, :debian, :ubuntu], 'Select operating system (fedora, el, redhatfips, sles, debian, ubuntu)') do |o|
opts.on('-o', '--operating-system OS', [:amazon, :fedora, :el, :redhatfips, :sles, :debian, :ubuntu], 'Select operating system (amazon, fedora, el, redhatfips, sles, debian, ubuntu)') do |o|
options.operating_system = o
end
opts.on('--os-version VERSION', Integer, 'VERSION of the operating system to build for') do |v|
Expand Down Expand Up @@ -126,7 +126,7 @@
fail "--operating-system is required!" unless options.operating_system
options.chdir = options.dist if options.chdir.nil?
options.output_type = case options.operating_system
when :fedora, :el, :sles, :redhatfips
when :amazon, :fedora, :el, :sles, :redhatfips
'rpm'
when :debian, :ubuntu
'deb'
Expand All @@ -139,7 +139,7 @@
# set some default sources
if options.sources.empty?
options.sources = case options.operating_system
when :fedora, :sles, :el, :redhatfips
when :amazon, :fedora, :sles, :el, :redhatfips
if options.operating_system == :el && options.os_version < 7 || options.operating_system == :sles && options.os_version < 12 #sysv rpm platforms
['etc', 'opt', 'var']
else
Expand Down Expand Up @@ -177,6 +177,14 @@
fpm_opts << "--rpm-rpmbuild-define '_app_data #{options.app_data}'"

if options.operating_system == :fedora # all supported fedoras are systemd
options.systemd = 1
options.systemd_el = 1
elsif options.operating_system == :amazon
if ! options.is_pe
fpm_opts << "--depends tzdata-java"
options.java = '(java-17-amazon-corretto-headless or java-11-amazon-corretto-headless)'
end

options.systemd = 1
options.systemd_el = 1
elsif options.operating_system == :el && options.os_version >= 7 # systemd el
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace :pl do
platform_path = "#{os}/#{ver}/#{repo}/"
end

# We want to include the arches for el/sles/fedora/redhatfips paths
# We want to include the arches for amazon/el/sles/fedora/redhatfips paths
['x86_64', 'i386'].each do |arch|
target_dir = "#{pkg_path}/#{platform_path}#{arch}"
FileUtils.mkdir_p(target_dir) unless File.directory?(target_dir)
Expand Down

0 comments on commit aeb7735

Please sign in to comment.