Skip to content

Commit 401c7a3

Browse files
authored
Merge pull request #9337 from AriaXLi/backport_PUP-12031
[Backport 7.x] (PUP-12031) Consolidate gem depenendencies & metadata into puppet.gemspec
2 parents 358d0e9 + 57ea40c commit 401c7a3

File tree

6 files changed

+65
-127
lines changed

6 files changed

+65
-127
lines changed

.gemspec

Lines changed: 0 additions & 81 deletions
This file was deleted.

Gemfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ def location_for(place, fake_version = nil)
1212
end
1313
end
1414

15-
# override .gemspec deps - may issue warning depending on Bundler version
15+
# Make sure these gem requirements are in sync with the gempspec. Specifically,
16+
# the runtime_dependencies in puppet.gemspec match the runtime dependencies here
17+
# (like semantic_puppet and puppet-resource_api)
18+
19+
# override .gemspec deps for facter & hiera - may issue warning depending on Bundler version
1620
gem "facter", *location_for(ENV['FACTER_LOCATION']) if ENV.has_key?('FACTER_LOCATION')
1721
gem "hiera", *location_for(ENV['HIERA_LOCATION']) if ENV.has_key?('HIERA_LOCATION')
1822
gem "semantic_puppet", *location_for(ENV['SEMANTIC_PUPPET_LOCATION'] || ["~> 1.0"])
@@ -32,6 +36,7 @@ group(:features) do
3236
# requires native ldap headers/libs
3337
# gem 'ruby-ldap', '~> 0.9', require: false, platforms: [:ruby]
3438
gem 'puppetserver-ca', '~> 2.0', require: false
39+
gem 'CFPropertyList', '~> 2.2', require: false
3540
end
3641

3742
group(:test) do

Rakefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,19 @@ task :default do
4545
sh %{rake -T}
4646
end
4747

48+
namespace :pl_ci do
49+
desc 'Build puppet gems'
50+
task :gem_build do
51+
stdout, stderr, status = Open3.capture3('gem build puppet.gemspec --platform x86-mingw32 && gem build puppet.gemspec --platform x64-mingw32 && gem build puppet.gemspec --platform universal-darwin && gem build puppet.gemspec')
52+
if !status.exitstatus.zero?
53+
puts "Error building facter.gemspec \n#{stdout} \n#{stderr}"
54+
exit(1)
55+
else
56+
puts stdout
57+
end
58+
end
59+
end
60+
4861
task :spec do
4962
ENV["LOG_SPEC_ORDER"] = "true"
5063
sh %{rspec #{ENV['TEST'] || ENV['TESTS'] || 'spec'}}

ext/project_data.yaml

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,10 @@
11
---
22
project: 'puppet'
3-
author: 'Puppet Labs'
4-
email: 'info@puppetlabs.com'
5-
homepage: 'https://github.com/puppetlabs/puppet'
6-
summary: 'Puppet, an automated configuration management tool'
7-
description: 'Puppet, an automated configuration management tool'
8-
version_file: 'lib/puppet/version.rb'
9-
# files and gem_files are space separated lists
10-
files: '[A-Z]* install.rb bin lib conf man examples ext tasks locales'
11-
# Make sure these gem requirements are in sync with the gemspec and Gemfile
12-
gem_files: '[A-Z]* install.rb bin lib conf man examples ext tasks locales'
13-
gem_test_files:
14-
gem_executables: 'puppet'
15-
gem_default_executables: 'puppet'
16-
gem_license: 'Apache-2.0'
17-
gem_forge_project: 'puppet'
18-
gem_required_ruby_version: '>= 2.5.0'
19-
gem_required_rubygems_version: '> 1.3.1'
20-
gem_runtime_dependencies:
21-
facter: ['> 2.0.1', '< 5']
22-
hiera: ['>= 3.2.1', '< 4']
23-
semantic_puppet: '~> 1.0'
24-
fast_gettext: ['>= 1.1', '< 3']
25-
locale: '~> 2.1'
26-
multi_json: '~> 1.10'
27-
puppet-resource_api: '~>1.5'
28-
concurrent-ruby: "~> 1.0"
29-
deep_merge: '~> 1.0'
30-
scanf: '~> 1.0'
313
gem_rdoc_options:
324
- --title
335
- "Puppet - Configuration Management"
346
- --main
357
- README.md
368
- --line-numbers
37-
gem_platform_dependencies:
38-
universal-darwin:
39-
gem_runtime_dependencies:
40-
CFPropertyList: '~> 2.2'
41-
x86-mingw32:
42-
gem_runtime_dependencies:
43-
ffi: '1.15.5'
44-
minitar: '~> 0.9'
45-
x64-mingw32:
46-
gem_runtime_dependencies:
47-
ffi: '1.15.5'
48-
minitar: '~> 0.9'
49-
bundle_platforms:
50-
universal-darwin: all
51-
x86-mingw32: mingw
52-
x64-mingw32: x64_mingw
539
pre_tasks:
5410
'package:apple': 'cfpropertylist'

puppet.gemspec

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
Gem::Specification.new do |s|
2+
s.name = "puppet"
3+
version = "7.31.0"
4+
mdata = version.match(/(\d+\.\d+\.\d+)/)
5+
s.version = mdata ? mdata[1] : version
6+
s.license = 'Apache-2.0'
7+
8+
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1")
9+
s.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
10+
s.authors = ["Puppet Labs"]
11+
s.date = "2012-08-17"
12+
s.description = <<~EOF
13+
Puppet, an automated administrative engine for your Linux, Unix, and Windows systems, performs administrative tasks
14+
(such as adding users, installing packages, and updating server configurations) based on a centralized specification.
15+
EOF
16+
s.email = "info@puppetlabs.com"
17+
s.executables = ["puppet"]
18+
s.files = Dir['[A-Z]*'] + Dir['install.rb'] + Dir['bin/*'] + Dir['lib/**/*'] + Dir['conf/*'] + Dir['man/**/*'] + Dir['tasks/*'] + Dir['locales/**/*'] + Dir['ext/**/*'] + Dir['examples/**/*']
19+
s.homepage = "https://github.com/puppetlabs/puppet"
20+
s.rdoc_options = ["--title", "Puppet - Configuration Management", "--main", "README", "--line-numbers"]
21+
s.require_paths = ["lib"]
22+
s.summary = "Puppet, an automated configuration management tool"
23+
s.specification_version = 4
24+
s.add_runtime_dependency(%q<facter>, ["> 2.0.1", "< 5"])
25+
s.add_runtime_dependency(%q<hiera>, [">= 3.2.1", "< 4"])
26+
s.add_runtime_dependency(%q<semantic_puppet>, "~> 1.0")
27+
s.add_runtime_dependency(%q<fast_gettext>, ">= 1.1", "< 3")
28+
s.add_runtime_dependency(%q<locale>, "~> 2.1")
29+
s.add_runtime_dependency(%q<multi_json>, "~> 1.10")
30+
s.add_runtime_dependency(%q<puppet-resource_api>, "~> 1.5")
31+
s.add_runtime_dependency(%q<concurrent-ruby>, "~> 1.0")
32+
s.add_runtime_dependency(%q<deep_merge>, "~> 1.0")
33+
s.add_runtime_dependency(%q<scanf>, "~> 1.0")
34+
35+
# For building platform specific puppet gems...the --platform flag is only supported in newer Ruby versions
36+
platform = s.platform.to_s
37+
if platform == 'universal-darwin'
38+
s.add_runtime_dependency('CFPropertyList', '~> 2.2')
39+
end
40+
41+
if platform == 'x64-mingw32' || platform == 'x86-mingw32'
42+
s.add_runtime_dependency('ffi', '1.15.5')
43+
s.add_runtime_dependency('minitar', '~> 0.9')
44+
end
45+
end

spec/unit/provider/user/directoryservice_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
module Puppet::Util::Plist
55
end
66

7-
describe Puppet::Type.type(:user).provider(:directoryservice) do
7+
describe Puppet::Type.type(:user).provider(:directoryservice), :if => Puppet.features.cfpropertylist? do
88
let(:username) { 'nonexistent_user' }
99
let(:user_path) { "/Users/#{username}" }
1010
let(:resource) do

0 commit comments

Comments
 (0)