Skip to content

Commit

Permalink
(PUP-12031) Consolidate gem depenendencies & metadata into puppet.gem…
Browse files Browse the repository at this point in the history
…spec

This commit moves the puppet gem metadata from ext/project_yaml.data and
.gemspec into puppet.gemspec. This change allows the puppet gem to be built
using `gem build puppet.gemspec`. Additionally, for platform specific gems
(e.g. puppet-universal-darwin.gem and puppet-x64-mingw32.gem), there is
conditional logic in puppet.gemspec so platform specific dependecies such as
ffi are appended when building those platform-specific gems.
  • Loading branch information
AriaXLi committed Apr 18, 2024
1 parent fb44fd9 commit 870db96
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 103 deletions.
84 changes: 0 additions & 84 deletions .gemspec

This file was deleted.

1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ group(:features) do
# requires native ldap headers/libs
# gem 'ruby-ldap', '~> 0.9', require: false, platforms: [:ruby]
gem 'puppetserver-ca', '~> 2.0', require: false
gem 'CFPropertyList', ['>= 3.0.6', '< 4'], require: false
end

group(:test) do
Expand Down
18 changes: 0 additions & 18 deletions ext/project_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,3 @@ gem_rdoc_options:
- --main
- README.md
- --line-numbers
gem_platform_dependencies:
universal-darwin:
gem_runtime_dependencies:
CFPropertyList: ['>= 3.0.6', '< 4']
x86-mingw32:
gem_runtime_dependencies:
ffi: '1.15.5'
minitar: '~> 0.9'
x64-mingw32:
gem_runtime_dependencies:
ffi: '1.15.5'
minitar: '~> 0.9'
bundle_platforms:
universal-darwin: all
x86-mingw32: mingw
x64-mingw32: x64_mingw
pre_tasks:
'package:apple': 'cfpropertylist'
44 changes: 44 additions & 0 deletions puppet.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Gem::Specification.new do |s|
s.name = "puppet"
version = "8.7.0"
mdata = version.match(/(\d+\.\d+\.\d+)/)
s.version = mdata ? mdata[1] : version
s.licenses = ['Apache-2.0']

s.required_rubygems_version = Gem::Requirement.new("> 1.3.1")
s.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
s.authors = ["Puppet Labs"]
s.date = "2012-08-17"
s.description = <<~EOF
Puppet, an automated administrative engine for your Linux, Unix, and Windows systems, performs administrative tasks
(such as adding users, installing packages, and updating server configurations) based on a centralized specification.
EOF
s.email = "[email protected]"
s.executables = ["puppet"]
s.files = Dir['[A-Z]*'] + Dir['install.rb'] + Dir['bin/*'] + Dir['lib/**/*'] + Dir['conf/*'] + Dir['man/**/*'] + Dir['tasks/*'] + Dir['locales/**/*'] + Dir['ext/**/*'] + Dir['examples/**/*']
s.license = "Apache-2.0"
s.homepage = "https://github.com/puppetlabs/puppet"
s.rdoc_options = ["--title", "Puppet - Configuration Management", "--main", "README", "--line-numbers"]
s.require_paths = ["lib"]
s.summary = "Puppet, an automated configuration management tool"
s.specification_version = 4
s.add_runtime_dependency(%q<facter>, [">= 4.3.0", "< 5"])
s.add_runtime_dependency(%q<semantic_puppet>, "~> 1.0")
s.add_runtime_dependency(%q<fast_gettext>, ">= 2.1", "< 3")
s.add_runtime_dependency(%q<locale>, "~> 2.1")
s.add_runtime_dependency(%q<multi_json>, "~> 1.13")
s.add_runtime_dependency(%q<puppet-resource_api>, "~> 1.5")
s.add_runtime_dependency(%q<concurrent-ruby>, "~> 1.0")
s.add_runtime_dependency(%q<deep_merge>, "~> 1.0")
s.add_runtime_dependency(%q<scanf>, "~> 1.0")

platform = s.platform.to_s
if platform == 'universal-darwin'
s.add_runtime_dependency('CFPropertyList', ['>= 3.0.6', '< 4'])
end

if platform == 'x64-mingw32' || platform == 'x86-mingw32'
s.add_runtime_dependency('ffi', '1.15.5')
s.add_runtime_dependency('minitar', '~> 0.9')
end
end
2 changes: 1 addition & 1 deletion spec/unit/provider/user/directoryservice_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
module Puppet::Util::Plist
end

describe Puppet::Type.type(:user).provider(:directoryservice) do
describe Puppet::Type.type(:user).provider(:directoryservice), :if => Puppet.features.cfpropertylist? do
let(:username) { 'nonexistent_user' }
let(:user_path) { "/Users/#{username}" }
let(:resource) do
Expand Down

0 comments on commit 870db96

Please sign in to comment.