simp-rake-helpers 5.12.1 → 5.12.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/Gemfile +0 -3
  4. data/README.md +2 -37
  5. data/Rakefile +2 -3
  6. data/lib/simp/rake/build/auto.rb +4 -2
  7. data/lib/simp/rake/build/build.rb +3 -2
  8. data/lib/simp/rake/build/iso.rb +144 -44
  9. data/lib/simp/rake/build/pkg.rb +15 -15
  10. data/lib/simp/rake/build/tar.rb +7 -1
  11. data/lib/simp/rake/build/vermap.yaml +1 -1
  12. data/lib/simp/rake/helpers/assets/rpm_spec/simp6.spec +5 -5
  13. data/lib/simp/rake/helpers/assets/rpm_spec/simpdefault.spec +5 -5
  14. data/lib/simp/rake/helpers/version.rb +1 -1
  15. data/lib/simp/rake/helpers.rb +2 -2
  16. data/spec/acceptance/nodesets/default.yml +0 -16
  17. data/spec/acceptance/{00_pkg_rpm_custom_scriptlets_spec.rb → suites/default/00_pkg_rpm_custom_scriptlets_spec.rb} +4 -3
  18. data/spec/acceptance/{10_pkg_rpm_spec.rb → suites/default/10_pkg_rpm_spec.rb} +6 -6
  19. data/spec/acceptance/{30_pkg_misc_spec.rb → suites/default/30_pkg_misc_spec.rb} +1 -1
  20. data/spec/acceptance/{50_local_gpg_signing_key_spec.rb → suites/default/50_local_gpg_signing_key_spec.rb} +0 -0
  21. data/spec/acceptance/{55_build_pkg_signing_spec.rb → suites/default/55_build_pkg_signing_spec.rb} +2 -2
  22. data/spec/acceptance/{development → suites/default/development}/docker_env.sh +0 -0
  23. data/spec/acceptance/{development → suites/default/development}/rerun_acceptance_tests.sh +0 -0
  24. data/spec/acceptance/{development → suites/default/development}/vagrant_rsync.sh +0 -0
  25. data/spec/acceptance/{files → suites/default/files}/asset/Rakefile +0 -0
  26. data/spec/acceptance/{files → suites/default/files}/asset/build/asset.spec +0 -0
  27. data/spec/acceptance/{files → suites/default/files}/asset_with_misordered_entries/Rakefile +0 -0
  28. data/spec/acceptance/{files → suites/default/files}/asset_with_misordered_entries/build/asset_with_misordered_entries.spec +0 -0
  29. data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/RPM-GPG-KEY-SIMP-Dev +0 -0
  30. data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/gengpgkey +0 -0
  31. data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/pubring.gpg +0 -0
  32. data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/random_seed +0 -0
  33. data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/run_gpg_agent +0 -0
  34. data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/secring.gpg +0 -0
  35. data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/trustdb.gpg +0 -0
  36. data/spec/acceptance/{files → suites/default/files}/build/project_skeleton/Puppetfile.tracking +0 -0
  37. data/spec/acceptance/{files → suites/default/files}/build/project_skeleton/README.md +0 -0
  38. data/spec/acceptance/{files → suites/default/files}/build/project_skeleton/Rakefile +0 -0
  39. data/spec/acceptance/{files → suites/default/files}/build/project_skeleton/src/assets/simp/build/simp.spec +0 -0
  40. data/spec/acceptance/{files → suites/default/files}/module/CHANGELOG +0 -0
  41. data/spec/acceptance/{files → suites/default/files}/module/Rakefile +0 -0
  42. data/spec/acceptance/{files → suites/default/files}/module/metadata.json +0 -0
  43. data/spec/acceptance/{files → suites/default/files}/module_with_misordered_entries/CHANGELOG +0 -0
  44. data/spec/acceptance/{files → suites/default/files}/module_with_misordered_entries/Rakefile +0 -0
  45. data/spec/acceptance/{files → suites/default/files}/module_with_misordered_entries/metadata.json +0 -0
  46. data/spec/acceptance/{files → suites/default/files}/simplib/CHANGELOG +0 -0
  47. data/spec/acceptance/{files → suites/default/files}/simplib/Rakefile +0 -0
  48. data/spec/acceptance/{files → suites/default/files}/simplib/build/rpm_metadata/requires +0 -0
  49. data/spec/acceptance/{files → suites/default/files}/simplib/metadata.json +0 -0
  50. data/spec/acceptance/{files → suites/default/files}/testpackage/CHANGELOG +0 -0
  51. data/spec/acceptance/{files → suites/default/files}/testpackage/README +0 -0
  52. data/spec/acceptance/{files → suites/default/files}/testpackage/Rakefile +0 -0
  53. data/spec/acceptance/{files → suites/default/files}/testpackage/build/rpm_metadata/requires +0 -0
  54. data/spec/acceptance/{files → suites/default/files}/testpackage/metadata.json +0 -0
  55. data/spec/acceptance/{files → suites/default/files}/testpackage/spec/classes/init_spec.rb +0 -0
  56. data/spec/acceptance/{files → suites/default/files}/testpackage/spec/files/mock_something.rb +0 -0
  57. data/spec/acceptance/{files → suites/default/files}/testpackage/utils/convert_v1_to_v2.rb +0 -0
  58. data/spec/acceptance/{files → suites/default/files}/testpackage_custom_scriptlet/CHANGELOG +0 -0
  59. data/spec/acceptance/{files → suites/default/files}/testpackage_custom_scriptlet/Rakefile +0 -0
  60. data/spec/acceptance/{files → suites/default/files}/testpackage_custom_scriptlet/build/rpm_metadata/custom/overrides +0 -0
  61. data/spec/acceptance/{files → suites/default/files}/testpackage_custom_scriptlet/build/rpm_metadata/requires +0 -0
  62. data/spec/acceptance/{files → suites/default/files}/testpackage_custom_scriptlet/metadata.json +0 -0
  63. data/spec/acceptance/{files → suites/default/files}/testpackage_missing_license/CHANGELOG +0 -0
  64. data/spec/acceptance/{files → suites/default/files}/testpackage_missing_license/Rakefile +0 -0
  65. data/spec/acceptance/{files → suites/default/files}/testpackage_missing_license/build/rpm_metadata/requires +0 -0
  66. data/spec/acceptance/{files → suites/default/files}/testpackage_missing_license/metadata.json +0 -0
  67. data/spec/acceptance/{files → suites/default/files}/testpackage_missing_metadata_file/CHANGELOG +0 -0
  68. data/spec/acceptance/{files → suites/default/files}/testpackage_missing_metadata_file/Rakefile +0 -0
  69. data/spec/acceptance/{files → suites/default/files}/testpackage_missing_metadata_file/build/rpm_metadata/requires +0 -0
  70. data/spec/acceptance/{files → suites/default/files}/testpackage_missing_name/CHANGELOG +0 -0
  71. data/spec/acceptance/{files → suites/default/files}/testpackage_missing_name/Rakefile +0 -0
  72. data/spec/acceptance/{files → suites/default/files}/testpackage_missing_name/build/rpm_metadata/requires +0 -0
  73. data/spec/acceptance/{files → suites/default/files}/testpackage_missing_name/metadata.json +0 -0
  74. data/spec/acceptance/{files → suites/default/files}/testpackage_missing_source/CHANGELOG +0 -0
  75. data/spec/acceptance/{files → suites/default/files}/testpackage_missing_source/Rakefile +0 -0
  76. data/spec/acceptance/{files → suites/default/files}/testpackage_missing_source/build/rpm_metadata/requires +0 -0
  77. data/spec/acceptance/{files → suites/default/files}/testpackage_missing_source/metadata.json +0 -0
  78. data/spec/acceptance/{files → suites/default/files}/testpackage_missing_summary/CHANGELOG +0 -0
  79. data/spec/acceptance/{files → suites/default/files}/testpackage_missing_summary/Rakefile +0 -0
  80. data/spec/acceptance/{files → suites/default/files}/testpackage_missing_summary/build/rpm_metadata/requires +0 -0
  81. data/spec/acceptance/{files → suites/default/files}/testpackage_missing_summary/metadata.json +0 -0
  82. data/spec/acceptance/{files → suites/default/files}/testpackage_missing_version/CHANGELOG +0 -0
  83. data/spec/acceptance/{files → suites/default/files}/testpackage_missing_version/Rakefile +0 -0
  84. data/spec/acceptance/{files → suites/default/files}/testpackage_missing_version/build/rpm_metadata/requires +0 -0
  85. data/spec/acceptance/{files → suites/default/files}/testpackage_missing_version/metadata.json +0 -0
  86. data/spec/acceptance/{files → suites/default/files}/testpackage_with_bad_changelog_date/CHANGELOG +0 -0
  87. data/spec/acceptance/{files → suites/default/files}/testpackage_with_bad_changelog_date/Rakefile +0 -0
  88. data/spec/acceptance/{files → suites/default/files}/testpackage_with_bad_changelog_date/build/rpm_metadata/requires +0 -0
  89. data/spec/acceptance/{files → suites/default/files}/testpackage_with_bad_changelog_date/metadata.json +0 -0
  90. data/spec/acceptance/{files → suites/default/files}/testpackage_with_release/CHANGELOG +0 -0
  91. data/spec/acceptance/{files → suites/default/files}/testpackage_with_release/Rakefile +0 -0
  92. data/spec/acceptance/{files → suites/default/files}/testpackage_with_release/build/rpm_metadata/release +0 -0
  93. data/spec/acceptance/{files → suites/default/files}/testpackage_with_release/build/rpm_metadata/requires +0 -0
  94. data/spec/acceptance/{files → suites/default/files}/testpackage_with_release/metadata.json +0 -0
  95. data/spec/acceptance/{files → suites/default/files}/testpackage_without_changelog/Rakefile +0 -0
  96. data/spec/acceptance/{files → suites/default/files}/testpackage_without_changelog/build/rpm_metadata/requires +0 -0
  97. data/spec/acceptance/{files → suites/default/files}/testpackage_without_changelog/metadata.json +0 -0
  98. data/spec/acceptance/{support → suites/default/support}/build_project_helpers.rb +1 -1
  99. data/spec/acceptance/{support → suites/default/support}/build_user_helpers.rb +0 -0
  100. data/spec/acceptance/{support → suites/default/support}/pkg_rpm_helpers.rb +0 -0
  101. data/spec/spec_helper_acceptance.rb +4 -0
  102. metadata +86 -88
  103. data/lib/simp/rake/helpers/assets/rpm_spec/simp4.spec +0 -388
  104. 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: 7388326de128952bb5ef2936e36da77f08a7f1ce6eb2970bb4e56bd68ac79424
4
- data.tar.gz: 32f0cb5e47e874d9135af87f915f76ce9c9983b96c50f74e9f035971f0953266
3
+ metadata.gz: af430b5f3668ec96a8f12d66b7210e176083e9377ccfefd06fa92050ee56f77a
4
+ data.tar.gz: 423871d8e7f99d01d6065809ea1cfea2b76abae47b84add3197b982d042b3de3
5
5
  SHA512:
6
- metadata.gz: 7e34d9f14623fd9068226a074a43104943369e264d7b5ea3c92d0da3f72faeac929f66d9f48c4245a179f3654152a01f2fd8bfe7e2f76c071fd2ab23e9c2d18d
7
- data.tar.gz: 3875e7ae51536e1dbe917e01ee7dd62b8fa6fd8b6cbdf524d6078dc10fd40e3315a847729838943333a120bf10f2a12958863da082e108f979c68fa15779628a
6
+ metadata.gz: 9424b979c1f67e6fba2ecedb6c8229e111c017a987f69ee7c9eea7db60d715b23530c91bd8baf01d44e11f0e1b16c73d016c13905c87e7f5540b7c5b072ab7bd
7
+ data.tar.gz: 9c43ca061b10e4241695b108af43a27c20e06f430d1cdaf349cd15e68333ee5f389e7f74427e9ab495cfc3f52df4786bf576ce99d00e66356c24db4b5d6694f0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,28 @@
1
+ ### 5.12.5 / 2021-10-07
2
+ - Fixed a bug where `build:auto` failed when building the SIMP ISO for EL7,
3
+ because the code attempted to move a directory onto itself.
4
+ - Ensured GPG keys in simp-gpgkeys are available in the DVD overlay tar file
5
+
6
+ ### 5.12.4 / 2021-10-05
7
+ - Ensure that the DIST qualifier is added to all built RPMs
8
+ - Use the new SimpRepos directory layout when building an ISO using externally
9
+ copied repos.
10
+
11
+ ### 5.12.3 / 2021-09-15
12
+ - Handle multiple options for required applications in build:auto
13
+ - Allow users to populate a `reposync` directory in the YUM build space that
14
+ will overwrite any target directories on the ISO.
15
+ - The SIMP tarball is unpacked after the copy so you always get the latest
16
+ built artifacts.
17
+ - Pruning will not occur if this technique is used since it is presumed that
18
+ you are overwriting the data with authoritative content.
19
+ - Added a helpful tip about updating vermap.yaml
20
+ - Fixed the call to repoclosure if on a system with DNF
21
+ - Added support for EL8 to vermap.yaml
22
+
23
+ ### 5.12.2 / 2021-06-22
24
+ - Change to '-1' from '-0' as the default RPM release
25
+
1
26
  ### 5.12.1 / 2021-05-27
2
27
  - Default `@build_dir` to `@distro_build_dir` in build tasks
3
28
  - Use `file --keep-going` in the **unpack** task's ISO validation check. This
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 "-0" release number
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-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
- # vim: syntax=ruby
15
+ Simp::Rake::Beaker.new(Dir.pwd)
@@ -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
 
@@ -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
- known_package_hash = YAML::load_file('packages.yaml')
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
 
@@ -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,83 @@ module Simp::Rake::Build
186
190
  end
187
191
  end
188
192
 
189
- # Prune unwanted packages
190
- begin
191
- system("tar --no-same-permissions -C #{dir} -xzf #{tball} *simp_pkglist.txt")
192
- rescue
193
- # Does not matter if the command fails
194
- end
195
193
 
196
- pkglist_file = ENV.fetch(
197
- 'SIMP_PKGLIST_FILE',
198
- File.join(dir,"#{baseosver.split('.').first}-simp_pkglist.txt")
199
- )
200
-
201
- puts
202
- puts '-'*80
203
- puts "### Pruning packages not in file '#{pkglist_file}'"
204
- puts
205
- puts ' (override this with `SIMP_PKGLIST_FILE=<file>`)'
206
- puts
207
- puts '-'*80
208
- puts
209
-
210
- if (args.prune.casecmp("false") != 0) && File.exist?(pkglist_file)
211
- exclude_pkgs = Array.new
212
- File.read(pkglist_file).each_line do |line|
213
- next if line =~ /^(\s+|#.*)$/
214
- exclude_pkgs.push(line.chomp)
194
+ repo_target_dir = dir
195
+
196
+ # If we've pulled in reposync directories, we expect them to
197
+ # completely overwrite the directory of the same name in the
198
+ # target ISO so no pruning is required
199
+ #
200
+ # Note: CASE MATTERS on the directory names
201
+ if reposync_active
202
+ # We're working with the new EL8+ layout, so we need to target
203
+ # the SimpRepos subdirectory
204
+ repo_target_dir = File.join(dir,'SimpRepos')
205
+ mkdir_p(repo_target_dir, :verbose => verbose)
206
+
207
+ repos_to_overwrite = Dir.glob(File.join(reposync_location, '*'))
208
+ .delete_if{|x| !File.directory?(x)}
209
+ .map{|x| File.basename(x)}
210
+
211
+ repos_to_overwrite.each do |repo|
212
+ src = File.join(reposync_location, repo)
213
+ target = File.join(dir, repo)
214
+
215
+ if File.directory?(target)
216
+ rm_rf(target, :verbose => verbose) if File.directory?(target)
217
+ else
218
+ target = File.join(repo_target_dir, repo)
219
+ end
220
+
221
+ cp_r(src, target, :verbose => verbose)
222
+ end
223
+ else
224
+ # Prune unwanted packages
225
+ begin
226
+ system("tar --no-same-permissions -C #{repo_target_dir} -xzf #{tball} *simp_pkglist.txt")
227
+ rescue
228
+ # Does not matter if the command fails
229
+ end
230
+
231
+ pkglist_file = ENV.fetch(
232
+ 'SIMP_PKGLIST_FILE',
233
+ File.join(dir,"#{baseosver.split('.').first}-simp_pkglist.txt")
234
+ )
235
+
236
+ puts
237
+ puts '-'*80
238
+ puts "### Pruning packages not in file '#{pkglist_file}'"
239
+ puts
240
+ puts ' (override this with `SIMP_PKGLIST_FILE=<file>`)'
241
+ puts
242
+ puts '-'*80
243
+ puts
244
+
245
+ if (args.prune.casecmp("false") != 0) && File.exist?(pkglist_file)
246
+ exclude_pkgs = Array.new
247
+ File.read(pkglist_file).each_line do |line|
248
+ next if line =~ /^(\s+|#.*)$/
249
+ exclude_pkgs.push(line.chomp)
250
+ end
251
+ prune_packages(dir,['SIMP','SimpRepos'],exclude_pkgs,mkrepo)
215
252
  end
216
- prune_packages(dir,['SIMP'],exclude_pkgs,mkrepo)
217
253
  end
218
254
 
219
255
  # Add the SIMP code
220
256
  system("tar --no-same-permissions -C #{dir} -xzf #{tball}")
221
257
 
222
- Dir.chdir("#{dir}/SIMP") do
258
+ # Pop the SIMP directory from the tarball into the correct spot
259
+ # FIXME: This is a hack
260
+ unless dir == repo_target_dir
261
+ simpdir = File.join(dir,'SIMP')
262
+
263
+ if File.directory?(simpdir)
264
+ cp_r(simpdir, repo_target_dir, :verbose => verbose)
265
+ rm_rf(simpdir, :verbose => verbose)
266
+ end
267
+ end
268
+
269
+ Dir.chdir("#{repo_target_dir}/SIMP") do
223
270
  # Add the SIMP Dependencies
224
271
  simp_base_ver = simpver.split('-').first
225
272
 
@@ -230,13 +277,14 @@ module Simp::Rake::Build
230
277
  yum_dep_location = File.join(@build_dir,'yum_data',simp_dep_src,'packages')
231
278
  end
232
279
 
280
+ yum_dep_rpms = Dir.glob(File.join(yum_dep_location,'*.rpm'))
281
+
233
282
  unless File.directory?(yum_dep_location)
234
- fail("Could not find dependency directory at #{yum_dep_location}")
283
+ fail("Could not find dependency directory at #{yum_dep_location}") unless reposync_active
235
284
  end
236
285
 
237
- yum_dep_rpms = Dir.glob(File.join(yum_dep_location,'*.rpm'))
238
286
  if yum_dep_rpms.empty?
239
- fail("Could not find any dependency RPMs at #{yum_dep_location}")
287
+ fail("Could not find any dependency RPMs at #{yum_dep_location}") unless reposync_active
240
288
  end
241
289
 
242
290
  # Add any one-off RPMs that you might want to add to your own build
@@ -261,24 +309,76 @@ module Simp::Rake::Build
261
309
  cp(rpm,rpm_arch, :verbose => verbose)
262
310
  end
263
311
 
264
- fail("Could not find architecture '#{arch}' in the SIMP distribution") unless File.directory?(arch)
265
- # Get everything set up properly...
266
- Dir.chdir(arch) do
267
- Dir.glob('../*') do |rpm_dir|
268
- # Don't dive into ourselves
269
- next if File.basename(rpm_dir) == arch
270
-
271
- Dir.glob(%(#{rpm_dir}/*.rpm)) do |source_rpm|
272
- link_target = File.basename(source_rpm)
273
- if File.exist?(source_rpm) && File.exist?(link_target)
274
- next if Pathname.new(source_rpm).realpath == Pathname.new(link_target).realpath
312
+ if reposync_active
313
+ fail("Error: Could not run createrepo in #{Dir.pwd}") unless system(%(#{mkrepo} .))
314
+ else
315
+ ln_sf('noarch', arch, :verbose => verbose) if (!File.directory?(arch) && File.directory?('noarch'))
316
+ fail("Could not find architecture '#{arch}' in the SIMP distribution") unless (File.directory?(arch) || File.symlink?(arch))
317
+
318
+ # Get everything set up properly...
319
+ Dir.chdir(arch) do
320
+ Dir.glob('../*') do |rpm_dir|
321
+ # Don't dive into ourselves
322
+ next if File.basename(rpm_dir) == arch
323
+
324
+ Dir.glob(%(#{rpm_dir}/*.rpm)) do |source_rpm|
325
+ link_target = File.basename(source_rpm)
326
+ if File.exist?(source_rpm) && File.exist?(link_target)
327
+ next if Pathname.new(source_rpm).realpath == Pathname.new(link_target).realpath
328
+ end
329
+
330
+ ln_sf(source_rpm,link_target, :verbose => verbose)
275
331
  end
276
-
277
- ln_sf(source_rpm,link_target, :verbose => verbose)
278
332
  end
333
+
334
+ fail("Error: Could not run createrepo in #{Dir.pwd}") unless system(%(#{mkrepo} .))
335
+ end
336
+ end
337
+ end
338
+
339
+ ### Munge the Repos
340
+
341
+ # Create an Updates directory that is properly populated
342
+ updates_readme = <<~README
343
+ This directory houses updates to NON-MODULAR RPMs.
344
+
345
+ DO NOT put modular RPMs in this directory or you will break your
346
+ system updates!
347
+ README
348
+
349
+ updates_dir = File.join(dir, 'Updates')
350
+ mkdir_p(updates_dir)
351
+
352
+ Dir.chdir(updates_dir) do
353
+ File.open('README','w'){|fh| fh.puts(updates_readme) }
354
+
355
+ repos = Dir.glob(File.join('..','**','repodata'))
356
+ modular_repos = Dir.glob(File.join('..','**','repodata','*-modules.*'))
357
+ non_modular_repos = repos.select{|x| modular_repos.grep(%r{^#{Regexp.escape(x)}}).empty? }
358
+ non_modular_repos.map!{|x| File.split(x).first}
359
+ non_modular_repos.delete_if{|x| x.match(%r{/SimpRepos|/SIMP}) }
360
+ non_modular_repos.each do |non_modular_repo|
361
+ Dir.glob(File.join(non_modular_repo, '**', '*.rpm')).each do |rpm|
362
+ # when non_modular_repo is '..', can still find RPMs we need
363
+ # to exclude
364
+ next if rpm.match(%r{/SimpRepos|/SIMP})
365
+
366
+ ln_sf(rpm, '.', :verbose => verbose)
279
367
  end
368
+ end
280
369
 
281
- fail("Error: Could not run createrepo in #{Dir.pwd}") unless system(%(#{mkrepo} .))
370
+ fail("Error: Could not run createrepo in #{Dir.pwd}") unless system(%(#{mkrepo} .))
371
+ end
372
+
373
+ # New ISO Layout
374
+ if reposync_active
375
+ Dir.chdir(repo_target_dir) do
376
+ gpgkeysdir = File.join('SIMP','GPGKEYS')
377
+
378
+ if File.directory?(gpgkeysdir)
379
+ cp_r(gpgkeysdir, '.', :verbose => verbose)
380
+ rm_rf(gpgkeysdir, :verbose => verbose)
381
+ end
282
382
  end
283
383
  end
284
384
 
@@ -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]).each do |base_dir|
610
- Find.find(base_dir) do |path|
611
- if (path =~ /.*\.rpm$/) and (path !~ /.*.src\.rpm$/)
612
- sym_path = "repos/base/#{File.basename(path)}"
613
- ln_s(path,sym_path, :verbose => @verbose) unless File.exists?(sym_path)
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_sf(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]).each do |aux_dir|
620
- Find.find(aux_dir) do |path|
621
- if (path =~ /.*\.rpm$/) and (path !~ /.*.src\.rpm$/)
622
- sym_path = "repos/lookaside/#{File.basename(path)}"
623
- ln_s(path,sym_path, :verbose => @verbose) unless File.exists?(sym_path)
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_sf(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
- cmd = 'repoclosure -c repodata -n -t -r base -l lookaside -c yum.conf'
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
@@ -126,10 +126,16 @@ module Simp::Rake::Build
126
126
 
127
127
  Simp::RPM.copy_wo_vcs(@dvd_src,".",base_dir)
128
128
 
129
- # Copy in the GPG Public Keys
129
+ # Copy in the GPG Public Keys from @build_dir
130
130
  mkdir_p("#{destdir}/GPGKEYS")
131
131
  ln(Dir.glob("#{@build_dir}/GPGKEYS/RPM-GPG-KEY*"), "#{destdir}/GPGKEYS", { :force => true })
132
132
 
133
+ # Copy in the GPG Public Keys packaged by simp-gpgkeys
134
+ simp_gpgkeys = File.join(@src_dir, 'assets', 'gpgkeys', 'GPGKEYS')
135
+ if Dir.exist?(simp_gpgkeys)
136
+ ln(Dir.glob("#{simp_gpgkeys}/RPM-GPG-KEY*"), "#{destdir}/GPGKEYS", { :force => true })
137
+ end
138
+
133
139
  # Copy in the auto-build RPMs
134
140
  Dir.chdir("#{@build_dir}/SIMP/RPMS") do
135
141
  Dir.glob('*').each do |type|
@@ -1,5 +1,5 @@
1
1
  ---
2
- "6": ["6","7"]
2
+ "6": ["6","7","8"]
3
3
  "5": "7"
4
4
  "4": "6"
5
5
  "2": "5"
@@ -106,8 +106,8 @@ package_name = "UNKNOWN"
106
106
  package_version = "UNKNOWN"
107
107
  module_license = "UNKNOWN"
108
108
 
109
- -- Default to 0
110
- package_release = 0
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 '-0')
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 0
110
- package_release = 0
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 '-0')
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
@@ -2,5 +2,5 @@ module Simp; end
2
2
  module Simp::Rake; end
3
3
 
4
4
  class Simp::Rake::Helpers
5
- VERSION = '5.12.1'
5
+ VERSION = '5.12.5'
6
6
  end
@@ -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(command)
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'
@@ -11,7 +11,7 @@ shared_examples_for 'an RPM generator with customized scriptlets' do
11
11
  scriptlets = rpm_scriptlets_for(
12
12
  host,
13
13
  "#{pkg_root_dir}/testpackage_custom_scriptlet/dist/" +
14
- 'pupmod-simp-testpackage-0.0.1-0.noarch.rpm'
14
+ "pupmod-simp-testpackage-0.0.1-1#{rpm_dist}.noarch.rpm"
15
15
  )
16
16
 
17
17
  comment '...the expected scriptlet types are present'
@@ -69,7 +69,7 @@ shared_examples_for 'an RPM generator with customized triggers' do
69
69
  triggers = rpm_triggers_for(
70
70
  host,
71
71
  "#{pkg_root_dir}/testpackage_custom_scriptlet/dist/" +
72
- 'pupmod-simp-testpackage-0.0.1-0.noarch.rpm'
72
+ "pupmod-simp-testpackage-0.0.1-1#{rpm_dist}.noarch.rpm"
73
73
  )
74
74
 
75
75
 
@@ -101,12 +101,13 @@ describe 'rake pkg:rpm with customized content' do
101
101
  copy_host_files_into_build_user_homedir(hosts)
102
102
  end
103
103
 
104
- let(:pkg_root_dir){'/home/build_user/host_files/spec/acceptance/files'}
104
+ let(:pkg_root_dir){'/home/build_user/host_files/spec/acceptance/suites/default/files'}
105
105
  let(:testpackage_dir){"#{pkg_root_dir}/testpackage"}
106
106
 
107
107
  hosts.each do |_host|
108
108
  context "on #{_host}" do
109
109
  let!(:host){ _host }
110
+ let(:rpm_dist){ on(host, %{rpm --eval '%{dist}'}).output.strip.gsub(/\.centos$/, '') }
110
111
 
111
112
  it 'can prep the package directories' do
112
113
  testpackages = [