simp-rake-helpers 5.12.0 → 5.12.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +26 -0
- data/Gemfile +0 -3
- data/README.md +2 -37
- data/Rakefile +2 -3
- data/lib/simp/rake/build/auto.rb +4 -2
- data/lib/simp/rake/build/build.rb +5 -4
- data/lib/simp/rake/build/iso.rb +101 -45
- data/lib/simp/rake/build/pkg.rb +16 -16
- data/lib/simp/rake/build/spec.rb +1 -1
- data/lib/simp/rake/build/tar.rb +1 -1
- data/lib/simp/rake/build/unpack.rb +1 -1
- data/lib/simp/rake/build/upload.rb +1 -1
- data/lib/simp/rake/build/vermap.yaml +1 -1
- data/lib/simp/rake/helpers/assets/rpm_spec/simp6.spec +5 -5
- data/lib/simp/rake/helpers/assets/rpm_spec/simpdefault.spec +5 -5
- data/lib/simp/rake/helpers/version.rb +1 -1
- data/lib/simp/rake/helpers.rb +2 -2
- data/spec/acceptance/nodesets/default.yml +0 -16
- data/spec/acceptance/{00_pkg_rpm_custom_scriptlets_spec.rb → suites/default/00_pkg_rpm_custom_scriptlets_spec.rb} +4 -3
- data/spec/acceptance/{10_pkg_rpm_spec.rb → suites/default/10_pkg_rpm_spec.rb} +6 -6
- data/spec/acceptance/{30_pkg_misc_spec.rb → suites/default/30_pkg_misc_spec.rb} +1 -1
- data/spec/acceptance/{50_local_gpg_signing_key_spec.rb → suites/default/50_local_gpg_signing_key_spec.rb} +0 -0
- data/spec/acceptance/{55_build_pkg_signing_spec.rb → suites/default/55_build_pkg_signing_spec.rb} +2 -2
- data/spec/acceptance/{development → suites/default/development}/docker_env.sh +0 -0
- data/spec/acceptance/{development → suites/default/development}/rerun_acceptance_tests.sh +0 -0
- data/spec/acceptance/{development → suites/default/development}/vagrant_rsync.sh +0 -0
- data/spec/acceptance/{files → suites/default/files}/asset/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/asset/build/asset.spec +0 -0
- data/spec/acceptance/{files → suites/default/files}/asset_with_misordered_entries/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/asset_with_misordered_entries/build/asset_with_misordered_entries.spec +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/RPM-GPG-KEY-SIMP-Dev +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/gengpgkey +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/pubring.gpg +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/random_seed +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/run_gpg_agent +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/secring.gpg +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/trustdb.gpg +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/project_skeleton/Puppetfile.tracking +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/project_skeleton/README.md +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/project_skeleton/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/project_skeleton/src/assets/simp/build/simp.spec +0 -0
- data/spec/acceptance/{files → suites/default/files}/module/CHANGELOG +0 -0
- data/spec/acceptance/{files → suites/default/files}/module/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/module/metadata.json +0 -0
- data/spec/acceptance/{files → suites/default/files}/module_with_misordered_entries/CHANGELOG +0 -0
- data/spec/acceptance/{files → suites/default/files}/module_with_misordered_entries/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/module_with_misordered_entries/metadata.json +0 -0
- data/spec/acceptance/{files → suites/default/files}/simplib/CHANGELOG +0 -0
- data/spec/acceptance/{files → suites/default/files}/simplib/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/simplib/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/simplib/metadata.json +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage/CHANGELOG +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage/README +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage/metadata.json +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage/spec/classes/init_spec.rb +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage/spec/files/mock_something.rb +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage/utils/convert_v1_to_v2.rb +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_custom_scriptlet/CHANGELOG +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_custom_scriptlet/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_custom_scriptlet/build/rpm_metadata/custom/overrides +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_custom_scriptlet/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_custom_scriptlet/metadata.json +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_license/CHANGELOG +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_license/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_license/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_license/metadata.json +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_metadata_file/CHANGELOG +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_metadata_file/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_metadata_file/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_name/CHANGELOG +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_name/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_name/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_name/metadata.json +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_source/CHANGELOG +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_source/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_source/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_source/metadata.json +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_summary/CHANGELOG +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_summary/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_summary/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_summary/metadata.json +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_version/CHANGELOG +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_version/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_version/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_version/metadata.json +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_with_bad_changelog_date/CHANGELOG +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_with_bad_changelog_date/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_with_bad_changelog_date/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_with_bad_changelog_date/metadata.json +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_with_release/CHANGELOG +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_with_release/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_with_release/build/rpm_metadata/release +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_with_release/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_with_release/metadata.json +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_without_changelog/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_without_changelog/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_without_changelog/metadata.json +0 -0
- data/spec/acceptance/{support → suites/default/support}/build_project_helpers.rb +1 -1
- data/spec/acceptance/{support → suites/default/support}/build_user_helpers.rb +0 -0
- data/spec/acceptance/{support → suites/default/support}/pkg_rpm_helpers.rb +0 -0
- data/spec/spec_helper_acceptance.rb +4 -0
- metadata +86 -88
- data/lib/simp/rake/helpers/assets/rpm_spec/simp4.spec +0 -388
- data/lib/simp/rake/helpers/assets/rpm_spec/simp5.spec +0 -388
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d79c389d3f40c038b0ba81fe8351e4f71b256bd1eaeeef52eb0af07239ec793b
|
4
|
+
data.tar.gz: 1025900b3bbfa941429f228c7952bf79ccfec9a0b388a5a8fcfaf670b3c6f590
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c2e9f763a211891553cde62a1963f9fd603f1ce9bfed11b828b36206fe5ec73e1b55f7d1f570c5d1df79cdc00c534d57cc8df24cd205e4cabe946895e820d47
|
7
|
+
data.tar.gz: 818c69dcf5bab3bba5516539852abc856973f97275bc186d46ef268c2878d6a4e0542d179a47fd3ed6e48266ff819fc7c70127953694f92b6b7c1b5c03377e98
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,29 @@
|
|
1
|
+
### 5.12.4 / 2021-10-05
|
2
|
+
- Ensure that the DIST qualifier is added to all built RPMs
|
3
|
+
- Use the new SimpRepos directory layout when building an ISO using externally
|
4
|
+
copied repos.
|
5
|
+
|
6
|
+
### 5.12.3 / 2021-09-15
|
7
|
+
- Handle multiple options for required applications in build:auto
|
8
|
+
- Allow users to populate a `reposync` directory in the YUM build space that
|
9
|
+
will overwrite any target directories on the ISO.
|
10
|
+
- The SIMP tarball is unpacked after the copy so you always get the latest
|
11
|
+
built artifacts.
|
12
|
+
- Pruning will not occur if this technique is used since it is presumed that
|
13
|
+
you are overwriting the data with authoritative content.
|
14
|
+
- Added a helpful tip about updating vermap.yaml
|
15
|
+
- Fixed the call to repoclosure if on a system with DNF
|
16
|
+
- Added support for EL8 to vermap.yaml
|
17
|
+
|
18
|
+
### 5.12.2 / 2021-06-22
|
19
|
+
- Change to '-1' from '-0' as the default RPM release
|
20
|
+
|
21
|
+
### 5.12.1 / 2021-05-27
|
22
|
+
- Default `@build_dir` to `@distro_build_dir` in build tasks
|
23
|
+
- Use `file --keep-going` in the **unpack** task's ISO validation check. This
|
24
|
+
allows the check to work from EL8-based systems, where `ISO 9660 CD-ROM
|
25
|
+
filesystem data` is not the first match.
|
26
|
+
|
1
27
|
### 5.12.0 / 2021-02-16
|
2
28
|
- Ensure that pkg:install_gem uses the correct documentation options for the
|
3
29
|
version of Ruby in use.
|
data/Gemfile
CHANGED
@@ -13,9 +13,6 @@ gem 'simp-build-helpers'
|
|
13
13
|
gem 'simp-beaker-helpers'
|
14
14
|
gem 'beaker-puppet_install_helper'
|
15
15
|
gem 'rake', '>= 12.3.3'
|
16
|
-
# You'll need the following if using podman until they are released upstream
|
17
|
-
#gem 'beaker-docker', :git => 'https://github.com/trevor-vaughan/beaker-docker', :branch => 'support_rootless_podman'
|
18
|
-
#gem 'docker-api', :git => 'https://github.com/trevor-vaughan/docker-api', :branch => 'podman-compat'
|
19
16
|
gem 'beaker-docker'
|
20
17
|
|
21
18
|
if puppetversion
|
data/README.md
CHANGED
@@ -26,7 +26,6 @@
|
|
26
26
|
* [`rake pkg:rpm`](#rake-pkgrpm)
|
27
27
|
* [`rake pkg:tar`](#rake-pkgtar)
|
28
28
|
* [Limitations](#limitations)
|
29
|
-
* [Some versions of bundler fail on FIPS-enabled Systems](#some-versions-of-bundler-fail-on-fips-enabled-systems)
|
30
29
|
* [Development](#development)
|
31
30
|
* [License](#license)
|
32
31
|
* [History](#history)
|
@@ -66,25 +65,6 @@ group :test do
|
|
66
65
|
gem 'puppet', puppetversion
|
67
66
|
gem 'beaker-rspec'
|
68
67
|
gem 'vagrant-wrapper'
|
69
|
-
|
70
|
-
# Puppet 4+ has issues with Hiera 3.1+
|
71
|
-
if puppetversion.to_s =~ />(\d+)/
|
72
|
-
pversion = $1
|
73
|
-
else
|
74
|
-
pversion = puppetversion
|
75
|
-
end
|
76
|
-
|
77
|
-
if Gem::Dependency.new('puppet', '~> 4.0').match?('puppet', pversion)
|
78
|
-
gem 'hiera', '~> 3.0.0'
|
79
|
-
end
|
80
|
-
|
81
|
-
# simp-rake-helpers does not suport puppet 2.7.X
|
82
|
-
if "#{ENV['PUPPET_VERSION']}".scan(/\d+/).first != '2' &&
|
83
|
-
# simp-rake-helpers and ruby 1.8.7 bomb Travis tests
|
84
|
-
# TODO: fix upstream deps (parallel in simp-rake-helpers)
|
85
|
-
RUBY_VERSION.sub(/\.\d+$/,'') != '1.8'
|
86
|
-
gem 'simp-rake-helpers'
|
87
|
-
end
|
88
68
|
end
|
89
69
|
```
|
90
70
|
|
@@ -164,7 +144,7 @@ directory . The full list of files considered are:
|
|
164
144
|
├── CHANGELOG # OPTIONAL written in RPM's CHANGELOG format
|
165
145
|
└── build/ # OPTIONAL
|
166
146
|
└── rpm_metadata/ # OPTIONAL
|
167
|
-
├── release # OPTIONAL defines the RPM's "
|
147
|
+
├── release # OPTIONAL defines the RPM's "-<qualifier>" release qualifier
|
168
148
|
├── requires # OPTIONAL supplementary 'Requires','Provides','Obsoletes'
|
169
149
|
└── custom/ # OPTIONAL
|
170
150
|
└── * # OPTIONAL custom snippets in RPM .spec format
|
@@ -187,7 +167,7 @@ level of the project, if it exists.
|
|
187
167
|
|
188
168
|
Example:
|
189
169
|
|
190
|
-
* Mon Nov 06 2017 Tom Smith <tom.smith@simp.com> - 3.8.0
|
170
|
+
* Mon Nov 06 2017 Tom Smith <tom.smith@simp.com> - 3.8.0
|
191
171
|
- Add feature x
|
192
172
|
|
193
173
|
**Important:** Note the leading zero in "`Nov 05`". It is a convention
|
@@ -227,21 +207,6 @@ Build the tar package for the current SIMP project
|
|
227
207
|
|
228
208
|
## Limitations
|
229
209
|
|
230
|
-
### Some versions of bundler fail on FIPS-enabled Systems
|
231
|
-
|
232
|
-
This is a limitation of Bundler, not the gem.
|
233
|
-
|
234
|
-
If you are running on a FIPS-enabled system, you will need to use
|
235
|
-
`bundler '~> 1.14.0'` or `bundler '~> 1.16'`
|
236
|
-
|
237
|
-
If you are using RVM, the appropriate steps are as follows:
|
238
|
-
|
239
|
-
```shell
|
240
|
-
rm Gemfile.lock ||:
|
241
|
-
rvm @global do gem uninstall bundler -a -x
|
242
|
-
rvm @global do gem install bundler -v '~> 1.14.0'
|
243
|
-
```
|
244
|
-
|
245
210
|
## Development
|
246
211
|
|
247
212
|
Please see the [SIMP Contribution Guidelines](https://simp-project.atlassian.net/wiki/display/SD/Contributing+to+SIMP).
|
data/Rakefile
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# -*- ruby -*-
|
2
|
-
|
3
1
|
require "rubygems"
|
4
2
|
require 'rake/clean'
|
5
3
|
require 'find'
|
@@ -12,5 +10,6 @@ require 'rspec/core/rake_task'
|
|
12
10
|
require 'simp/rake/rubygem'
|
13
11
|
Simp::Rake::Rubygem.new(@package, @rakefile_dir)
|
14
12
|
|
13
|
+
require 'simp/rake/beaker'
|
15
14
|
|
16
|
-
|
15
|
+
Simp::Rake::Beaker.new(Dir.pwd)
|
data/lib/simp/rake/build/auto.rb
CHANGED
@@ -18,6 +18,8 @@ module Simp::Rake::Build
|
|
18
18
|
class Auto < ::Rake::TaskLib
|
19
19
|
|
20
20
|
# Commands that are required by some part of the rake stack
|
21
|
+
#
|
22
|
+
# Use an array for commands that may have multiple valid options
|
21
23
|
BUILD_REQUIRED_COMMANDS = [
|
22
24
|
'basename',
|
23
25
|
'cat',
|
@@ -42,7 +44,7 @@ module Simp::Rake::Build
|
|
42
44
|
'make',
|
43
45
|
'mkdir',
|
44
46
|
'mktemp',
|
45
|
-
'python',
|
47
|
+
['python','python2','python3'],
|
46
48
|
'readlink',
|
47
49
|
'repoclosure',
|
48
50
|
'rm',
|
@@ -62,7 +64,7 @@ module Simp::Rake::Build
|
|
62
64
|
'wc',
|
63
65
|
'which',
|
64
66
|
'xargs',
|
65
|
-
'yum',
|
67
|
+
['dnf','yum'],
|
66
68
|
'yumdownloader'
|
67
69
|
]
|
68
70
|
|
@@ -25,7 +25,7 @@ module Simp::Rake::Build
|
|
25
25
|
namespace :build do
|
26
26
|
task :prep do
|
27
27
|
if $simp6
|
28
|
-
@build_dir = $simp6_build_dir
|
28
|
+
@build_dir = $simp6_build_dir || @distro_build_dir
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -96,7 +96,7 @@ module Simp::Rake::Build
|
|
96
96
|
task :prep do
|
97
97
|
if $simp6
|
98
98
|
# `$simp6_build_dir` is set by the build:auto task
|
99
|
-
@build_dir = $simp6_build_dir
|
99
|
+
@build_dir = $simp6_build_dir || @distro_build_dir
|
100
100
|
|
101
101
|
unless @build_dir
|
102
102
|
if ENV['SIMP_BUILD_yum_dir'] && File.exist?(File.join(ENV['SIMP_BUILD_yum_dir'], 'yum_data'))
|
@@ -204,7 +204,8 @@ module Simp::Rake::Build
|
|
204
204
|
|
205
205
|
Dir.chdir(target_dir) do
|
206
206
|
if File.exist?('packages.yaml')
|
207
|
-
|
207
|
+
# The empty YAML file returns 'false'
|
208
|
+
known_package_hash = YAML::load_file('packages.yaml') || {}
|
208
209
|
end
|
209
210
|
end
|
210
211
|
|
@@ -276,7 +277,7 @@ module Simp::Rake::Build
|
|
276
277
|
pkg = downloaded_package_hash[pkg][:rpm_name]
|
277
278
|
}.compact
|
278
279
|
|
279
|
-
if known_packages.empty? && downloaded_packages.empty?
|
280
|
+
if known_packages.empty? && downloaded_packages.empty? && Dir.glob('reposync/**/repomd.xml').empty?
|
280
281
|
fail <<-EOM
|
281
282
|
Error: Could not find anything to do!
|
282
283
|
|
data/lib/simp/rake/build/iso.rb
CHANGED
@@ -26,7 +26,7 @@ module Simp::Rake::Build
|
|
26
26
|
namespace :iso do
|
27
27
|
task :prep do
|
28
28
|
if $simp6
|
29
|
-
@build_dir = $simp6_build_dir
|
29
|
+
@build_dir = $simp6_build_dir || @distro_build_dir
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
@@ -120,6 +120,9 @@ module Simp::Rake::Build
|
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
123
|
+
reposync_location = File.join(@build_dir,'yum_data','reposync')
|
124
|
+
reposync_active = !Dir.glob(File.join(reposync_location, '**', 'repomd.xml')).empty?
|
125
|
+
|
123
126
|
tarfiles = File.directory?(tarball) ?
|
124
127
|
Dir.glob("#{tarball}/*.tar.gz") : [tarball]
|
125
128
|
vermap = YAML::load_file( File.join( File.dirname(__FILE__), 'vermap.yaml'))
|
@@ -171,6 +174,7 @@ module Simp::Rake::Build
|
|
171
174
|
unless Array(vermap[simpver.split('.').first]).include?(baseosver.split('.').first)
|
172
175
|
if verbose
|
173
176
|
warn("Could not find SIMP version mapping for #{simpver} for Base OS #{baseosver}")
|
177
|
+
warn("Do you need to update vermap.yaml in the Gem?")
|
174
178
|
end
|
175
179
|
|
176
180
|
next
|
@@ -186,40 +190,75 @@ module Simp::Rake::Build
|
|
186
190
|
end
|
187
191
|
end
|
188
192
|
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
193
|
+
repo_target_dir = dir
|
194
|
+
|
195
|
+
# If we've pulled in reposync directories, we expect them to
|
196
|
+
# completely overwrite the directory of the same name in the
|
197
|
+
# target ISO so no pruning is required
|
198
|
+
#
|
199
|
+
# Note: CASE MATTERS on the directory names
|
200
|
+
if reposync_active
|
201
|
+
# We're working with the new EL8+ layout, so we need to target
|
202
|
+
# the SimpRepos subdirectory
|
203
|
+
repo_target_dir = File.join(dir,'SimpRepos')
|
204
|
+
mkdir_p(repo_target_dir, :verbose => verbose)
|
205
|
+
|
206
|
+
repos_to_overwrite = Dir.glob(File.join(reposync_location, '*'))
|
207
|
+
.delete_if{|x| !File.directory?(x)}
|
208
|
+
.map{|x| File.basename(x)}
|
209
|
+
|
210
|
+
repos_to_overwrite.each do |repo|
|
211
|
+
src = File.join(reposync_location, repo)
|
212
|
+
target = File.join(dir, repo)
|
213
|
+
|
214
|
+
if File.directory?(target)
|
215
|
+
rm_rf(target, :verbose => verbose) if File.directory?(target)
|
216
|
+
else
|
217
|
+
target = File.join(repo_target_dir, repo)
|
218
|
+
end
|
219
|
+
|
220
|
+
cp_r(src, target, :verbose => verbose)
|
221
|
+
end
|
222
|
+
else
|
223
|
+
# Prune unwanted packages
|
224
|
+
begin
|
225
|
+
system("tar --no-same-permissions -C #{repo_target_dir} -xzf #{tball} *simp_pkglist.txt")
|
226
|
+
rescue
|
227
|
+
# Does not matter if the command fails
|
228
|
+
end
|
195
229
|
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
230
|
+
pkglist_file = ENV.fetch(
|
231
|
+
'SIMP_PKGLIST_FILE',
|
232
|
+
File.join(dir,"#{baseosver.split('.').first}-simp_pkglist.txt")
|
233
|
+
)
|
234
|
+
|
235
|
+
puts
|
236
|
+
puts '-'*80
|
237
|
+
puts "### Pruning packages not in file '#{pkglist_file}'"
|
238
|
+
puts
|
239
|
+
puts ' (override this with `SIMP_PKGLIST_FILE=<file>`)'
|
240
|
+
puts
|
241
|
+
puts '-'*80
|
242
|
+
puts
|
243
|
+
|
244
|
+
if (args.prune.casecmp("false") != 0) && File.exist?(pkglist_file)
|
245
|
+
exclude_pkgs = Array.new
|
246
|
+
File.read(pkglist_file).each_line do |line|
|
247
|
+
next if line =~ /^(\s+|#.*)$/
|
248
|
+
exclude_pkgs.push(line.chomp)
|
249
|
+
end
|
250
|
+
prune_packages(dir,['SIMP','SimpRepos'],exclude_pkgs,mkrepo)
|
215
251
|
end
|
216
|
-
prune_packages(dir,['SIMP'],exclude_pkgs,mkrepo)
|
217
252
|
end
|
218
253
|
|
219
254
|
# Add the SIMP code
|
220
255
|
system("tar --no-same-permissions -C #{dir} -xzf #{tball}")
|
221
256
|
|
222
|
-
|
257
|
+
# Pop the SIMP directory from the tarball into the correct spot
|
258
|
+
# FIXME: This is a hack
|
259
|
+
FileUtils.mv("#{dir}/SIMP", repo_target_dir) if File.directory?("#{dir}/SIMP")
|
260
|
+
|
261
|
+
Dir.chdir("#{repo_target_dir}/SIMP") do
|
223
262
|
# Add the SIMP Dependencies
|
224
263
|
simp_base_ver = simpver.split('-').first
|
225
264
|
|
@@ -230,13 +269,14 @@ module Simp::Rake::Build
|
|
230
269
|
yum_dep_location = File.join(@build_dir,'yum_data',simp_dep_src,'packages')
|
231
270
|
end
|
232
271
|
|
272
|
+
yum_dep_rpms = Dir.glob(File.join(yum_dep_location,'*.rpm'))
|
273
|
+
|
233
274
|
unless File.directory?(yum_dep_location)
|
234
|
-
fail("Could not find dependency directory at #{yum_dep_location}")
|
275
|
+
fail("Could not find dependency directory at #{yum_dep_location}") unless reposync_active
|
235
276
|
end
|
236
277
|
|
237
|
-
yum_dep_rpms = Dir.glob(File.join(yum_dep_location,'*.rpm'))
|
238
278
|
if yum_dep_rpms.empty?
|
239
|
-
fail("Could not find any dependency RPMs at #{yum_dep_location}")
|
279
|
+
fail("Could not find any dependency RPMs at #{yum_dep_location}") unless reposync_active
|
240
280
|
end
|
241
281
|
|
242
282
|
# Add any one-off RPMs that you might want to add to your own build
|
@@ -261,24 +301,40 @@ module Simp::Rake::Build
|
|
261
301
|
cp(rpm,rpm_arch, :verbose => verbose)
|
262
302
|
end
|
263
303
|
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
if File.exist?(source_rpm) && File.exist?(link_target)
|
274
|
-
next if Pathname.new(source_rpm).realpath == Pathname.new(link_target).realpath
|
275
|
-
end
|
304
|
+
unless reposync_active
|
305
|
+
ln_s('noarch', arch, :verbose => verbose) if (!File.directory?(arch) && File.directory?('noarch'))
|
306
|
+
fail("Could not find architecture '#{arch}' in the SIMP distribution") unless (File.directory?(arch) || File.symlink?(arch))
|
307
|
+
|
308
|
+
# Get everything set up properly...
|
309
|
+
Dir.chdir(arch) do
|
310
|
+
Dir.glob('../*') do |rpm_dir|
|
311
|
+
# Don't dive into ourselves
|
312
|
+
next if File.basename(rpm_dir) == arch
|
276
313
|
|
277
|
-
|
314
|
+
Dir.glob(%(#{rpm_dir}/*.rpm)) do |source_rpm|
|
315
|
+
link_target = File.basename(source_rpm)
|
316
|
+
if File.exist?(source_rpm) && File.exist?(link_target)
|
317
|
+
next if Pathname.new(source_rpm).realpath == Pathname.new(link_target).realpath
|
318
|
+
end
|
319
|
+
|
320
|
+
ln_sf(source_rpm,link_target, :verbose => verbose)
|
321
|
+
end
|
278
322
|
end
|
279
323
|
end
|
324
|
+
end
|
325
|
+
|
326
|
+
fail("Error: Could not run createrepo in #{Dir.pwd}") unless system(%(#{mkrepo} .))
|
327
|
+
end
|
280
328
|
|
281
|
-
|
329
|
+
# New ISO Layout
|
330
|
+
if reposync_active
|
331
|
+
Dir.chdir(repo_target_dir) do
|
332
|
+
gpgkeysdir = File.join('SIMP','GPGKEYS')
|
333
|
+
|
334
|
+
if File.directory?(gpgkeysdir)
|
335
|
+
cp_r(gpgkeysdir, '.', :verbose => verbose)
|
336
|
+
rm_rf(gpgkeysdir, :verbose => verbose)
|
337
|
+
end
|
282
338
|
end
|
283
339
|
end
|
284
340
|
|
data/lib/simp/rake/build/pkg.rb
CHANGED
@@ -43,7 +43,7 @@ module Simp::Rake::Build
|
|
43
43
|
|
44
44
|
# This doesn't get caught for things like 'rake clean'
|
45
45
|
if $simp6 && $simp6_build_dir
|
46
|
-
@build_dir = $simp6_build_dir
|
46
|
+
@build_dir = $simp6_build_dir || @distro_build_dir
|
47
47
|
@dvd_src = File.join(@build_dir, File.basename(@dvd_src))
|
48
48
|
end
|
49
49
|
|
@@ -606,23 +606,19 @@ protect=1
|
|
606
606
|
mkdir_p('repos/lookaside')
|
607
607
|
mkdir_p('repodata')
|
608
608
|
|
609
|
-
Dir.glob(args[:target_dir]
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
end
|
615
|
-
end
|
609
|
+
Dir.glob(File.join(args[:target_dir], '**', '*.rpm'))
|
610
|
+
.delete_if{|x| x =~ /\.src\.rpm$/}
|
611
|
+
.each do |path|
|
612
|
+
sym_path = "repos/base/#{File.basename(path)}"
|
613
|
+
ln_s(path,sym_path, :verbose => @verbose) unless File.exists?(sym_path)
|
616
614
|
end
|
617
615
|
|
618
616
|
if args[:aux_dir]
|
619
|
-
Dir.glob(args[:aux_dir]
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
end
|
625
|
-
end
|
617
|
+
Dir.glob(File.join(args[:aux_dir], '**', '*.rpm'))
|
618
|
+
.delete_if{|x| x =~ /\.src\.rpm$/}
|
619
|
+
.each do |path|
|
620
|
+
sym_path = "repos/lookaside/#{File.basename(path)}"
|
621
|
+
ln_s(path,sym_path, :verbose => @verbose) unless File.exists?(sym_path)
|
626
622
|
end
|
627
623
|
end
|
628
624
|
|
@@ -647,7 +643,11 @@ protect=1
|
|
647
643
|
file.write(ERB.new(yum_conf_template,nil,'-').result(binding))
|
648
644
|
end
|
649
645
|
|
650
|
-
|
646
|
+
if which('dnf')
|
647
|
+
cmd = 'repoclosure -c base.conf --disablerepo=* --enablerepo=base'
|
648
|
+
else
|
649
|
+
cmd = 'repoclosure -c repodata -n -t -r base -l lookaside -c yum.conf'
|
650
|
+
end
|
651
651
|
|
652
652
|
if ENV['SIMP_BUILD_verbose'] == 'yes'
|
653
653
|
puts
|
data/lib/simp/rake/build/spec.rb
CHANGED
data/lib/simp/rake/build/tar.rb
CHANGED
@@ -50,7 +50,7 @@ module Simp::Rake::Build
|
|
50
50
|
File.exist?(args.iso_path) or
|
51
51
|
fail "Error: You must provide the full path and filename of the ISO image."
|
52
52
|
|
53
|
-
%x{file #{iso_path}}.split(":")[1..-1].to_s =~ /ISO/ or
|
53
|
+
%x{file --keep-going '#{iso_path}'}.split(":")[1..-1].to_s =~ /ISO/ or
|
54
54
|
fail "Error: The file provided is not a valid ISO."
|
55
55
|
|
56
56
|
pieces = File.basename(iso_path,'.iso').split('-')
|
@@ -106,8 +106,8 @@ package_name = "UNKNOWN"
|
|
106
106
|
package_version = "UNKNOWN"
|
107
107
|
module_license = "UNKNOWN"
|
108
108
|
|
109
|
-
-- Default to
|
110
|
-
package_release =
|
109
|
+
-- Default to 1
|
110
|
+
package_release = 1
|
111
111
|
|
112
112
|
lua_stderr("\n")
|
113
113
|
lua_stderr("--------------------------------------------------------------------------------\n")
|
@@ -202,7 +202,7 @@ end
|
|
202
202
|
-- only accepts release in SemVer \d+\.\d+\.\d+ release format)
|
203
203
|
--
|
204
204
|
-- This code will remove a '-rc0' style prerelease string from the RPM
|
205
|
-
-- Version, and use it as the default RPM Release (instead of '-
|
205
|
+
-- Version, and use it as the default RPM Release (instead of '-1')
|
206
206
|
|
207
207
|
local version_match = metadata:match('"version":%s+"(.-)"%s*,'):gsub('-.*','')
|
208
208
|
if version_match then
|
@@ -301,7 +301,7 @@ end
|
|
301
301
|
|
302
302
|
if req_file then
|
303
303
|
for line in req_file:lines() do
|
304
|
-
valid_line = (line:match("^Requires: ") or line:match("^Obsoletes: ") or line:match("^Provides: "))
|
304
|
+
valid_line = (line:match("^Requires: ") or line:match("^Obsoletes: ") or line:match("^Provides: ") or line:match("^Recommends: "))
|
305
305
|
|
306
306
|
if valid_line then
|
307
307
|
module_requires = (module_requires .. "\n" .. line)
|
@@ -319,7 +319,7 @@ Summary: %{module_name} Puppet Module
|
|
319
319
|
Name: %{package_name}
|
320
320
|
|
321
321
|
Version: %{lua: print(package_version)}
|
322
|
-
Release: %{lua: print(package_release)}
|
322
|
+
Release: %{lua: print(package_release)}%{?dist}
|
323
323
|
License: %{lua: print(module_license)}
|
324
324
|
Group: Applications/System
|
325
325
|
Source0: %{package_name}-%{version}-%{release}.tar.gz
|
@@ -106,8 +106,8 @@ package_name = "UNKNOWN"
|
|
106
106
|
package_version = "UNKNOWN"
|
107
107
|
module_license = "UNKNOWN"
|
108
108
|
|
109
|
-
-- Default to
|
110
|
-
package_release =
|
109
|
+
-- Default to 1
|
110
|
+
package_release = 1
|
111
111
|
|
112
112
|
lua_stderr("\n")
|
113
113
|
lua_stderr("--------------------------------------------------------------------------------\n")
|
@@ -202,7 +202,7 @@ end
|
|
202
202
|
-- only accepts release in SemVer \d+\.\d+\.\d+ release format)
|
203
203
|
--
|
204
204
|
-- This code will remove a '-rc0' style prerelease string from the RPM
|
205
|
-
-- Version, and use it as the default RPM Release (instead of '-
|
205
|
+
-- Version, and use it as the default RPM Release (instead of '-1')
|
206
206
|
|
207
207
|
local version_match = metadata:match('"version":%s+"(.-)"%s*,'):gsub('-.*','')
|
208
208
|
if version_match then
|
@@ -301,7 +301,7 @@ end
|
|
301
301
|
|
302
302
|
if req_file then
|
303
303
|
for line in req_file:lines() do
|
304
|
-
valid_line = (line:match("^Requires: ") or line:match("^Obsoletes: ") or line:match("^Provides: "))
|
304
|
+
valid_line = (line:match("^Requires: ") or line:match("^Obsoletes: ") or line:match("^Provides: ") or line:match("^Recommends: "))
|
305
305
|
|
306
306
|
if valid_line then
|
307
307
|
module_requires = (module_requires .. "\n" .. line)
|
@@ -319,7 +319,7 @@ Summary: %{module_name} Puppet Module
|
|
319
319
|
Name: %{package_name}
|
320
320
|
|
321
321
|
Version: %{lua: print(package_version)}
|
322
|
-
Release: %{lua: print(package_release)}
|
322
|
+
Release: %{lua: print(package_release)}%{?dist}
|
323
323
|
License: %{lua: print(module_license)}
|
324
324
|
Group: Applications/System
|
325
325
|
Source0: %{package_name}-%{version}-%{release}.tar.gz
|
data/lib/simp/rake/helpers.rb
CHANGED
@@ -20,8 +20,8 @@ class Simp::Rake::Helpers
|
|
20
20
|
invalid_commands = Array.new
|
21
21
|
|
22
22
|
Array(required_commands).each do |command|
|
23
|
-
unless Facter::Core::Execution.which(
|
24
|
-
invalid_commands << command
|
23
|
+
unless Array(command).find { |x| Facter::Core::Execution.which(x) }
|
24
|
+
invalid_commands << Array(command).join(' or ')
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -30,23 +30,7 @@ CONFIG:
|
|
30
30
|
auth_methods:
|
31
31
|
- password
|
32
32
|
docker_preserve_image: true
|
33
|
-
# This is necessary for pretty much all containers
|
34
|
-
docker_cap_add:
|
35
|
-
- AUDIT_WRITE
|
36
33
|
mount_folders:
|
37
34
|
host_files:
|
38
35
|
host_path: ./
|
39
36
|
container_path: /host_files
|
40
|
-
# All items below this point are required for systemd
|
41
|
-
cgroup:
|
42
|
-
host_path: /sys/fs/cgroup
|
43
|
-
container_path: /sys/fs/cgroup
|
44
|
-
opts: 'ro'
|
45
|
-
dockeropts:
|
46
|
-
HostConfig:
|
47
|
-
Tmpfs:
|
48
|
-
'/run': 'rw,noexec,nosuid,nodev,size=65536k'
|
49
|
-
'/run/lock': 'rw,noexec,nosuid,nodev,size=65536k'
|
50
|
-
'/tmp': 'rw,exec,nosuid,nodev,size=65536k'
|
51
|
-
'/sys/fs/cgroup/systemd': 'rw,size=65536k'
|
52
|
-
'/var/log/journal': 'rw,noexec,nodev,nosuid,size=65536k'
|