simp-rake-helpers 2.4.0 → 2.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf37e26d7fd61c248ece71b5e56c632b38ff3237
4
- data.tar.gz: fa3621dc06beb969d539fa96005f56d4d9c576f6
3
+ metadata.gz: 0804d79f5af26fb909c8f9dbe745c503515ed72c
4
+ data.tar.gz: b0fbb44adfee8b3ea53f15a88715ae33289eaaf5
5
5
  SHA512:
6
- metadata.gz: 56d8d61349d574a4c289aa2535d8e1be5ad97ffcb57b5df32864884828698476682a3d7363e089f7ba8c18992cf5da10dafb4771c661fe8f33f4bfae62e1dbca
7
- data.tar.gz: 4d255776d04b43274c6805d26142ee2b1c3cadbcc9cbcbf2081b45b3e6779d52c8d9facd07934e6052ea42bd4622c9c9c62bf353733df0665a78c42f9fa67861
6
+ metadata.gz: 4c59fd53d33e24218a21cad227ea27d01052d152c0e016cf4632b85688d12501755ced61c6d30bec16fba5c97ec8f53b1557abf84b4cd18d9897a4cb37657504
7
+ data.tar.gz: b431ebc4958b3de9e4e279fd079611d91de79f2f0f2302925076ca5fc69963ecf02b12a3b6a1ffea98d39e9e70d201f071401f5b0529e3dfe770ba333b8525c3
@@ -1,3 +1,6 @@
1
+ ### 2.4.1 / 2016-07-05
2
+ * Fixed a misnamed variable causing build failures
3
+
1
4
  ### 2.4.0 / 2016-06-29
2
5
  * Add a Lua-based RPM template to the build stack allowing us to build *any*
3
6
  Puppet module as an RPM without forking.
data/README.md CHANGED
@@ -6,11 +6,12 @@
6
6
  1. [Overview](#overview)
7
7
  * [This gem is part of SIMP](#this-gem-is-part-of-simp)
8
8
  * [Features](#features)
9
- 2. [Setup - The basics of getting started with iptables](#setup)
9
+ 2. [Setup](#setup)
10
10
  * [Gemfile](#gemfile)
11
11
  3. [Usage - Configuration options and additional functionality](#usage)
12
12
  * [In a Puppet Module](#in-a-puppet-module)
13
13
  * [In a Ruby Gem](#in-a-ruby-gem)
14
+ * [RPM Generation](#rpm-generation)
14
15
  4. [Reference - An under-the-hood peek at what the gem is doing and how](#reference)
15
16
  5. [Limitations - OS compatibility, etc.](#limitations)
16
17
  6. [Development - Guide for contributing to the module](#development)
@@ -26,11 +27,10 @@ This gem is part of (the build tooling for) the [System Integrity Management Pla
26
27
 
27
28
 
28
29
  ### Features
29
- * supports multithreaded mock operations
30
+ * Supports multithreaded mock operations
30
31
  * RPM packaging and signing
31
32
  * Rubygem packaging
32
33
 
33
-
34
34
  ## Setup
35
35
 
36
36
  ### Gemfile
@@ -74,6 +74,7 @@ end
74
74
 
75
75
  ## Usage
76
76
  ### In a Puppet module
77
+
77
78
  Within the project's Rakefile:
78
79
 
79
80
  ```ruby
@@ -84,6 +85,7 @@ Simp::Rake::Pupmod::Helpers.new(File.dirname(__FILE__))
84
85
 
85
86
 
86
87
  ### In a Ruby Gem
88
+
87
89
  Within the project's Rakefile:
88
90
 
89
91
  ```ruby
@@ -101,6 +103,41 @@ To see the extra rake tasks:
101
103
  bunde exec rake -T
102
104
  ```
103
105
 
106
+ ### RPM Generation
107
+
108
+ This Gem provides the ability to generate an RPM from *any* Puppet module.
109
+
110
+ By default, the information for the RPM will be pulled from the Forge
111
+ compatible [metadata.json](https://docs.puppet.com/puppet/latest/reference/modules_metadata.html).
112
+
113
+ The `name` and `version` fields *must* be present and well formatted. The
114
+ `license` field is also used if present.
115
+
116
+ *NOTE*: The dependencies in `metadata.json` are *not* used to generate RPM
117
+ dependencies!
118
+
119
+ #### RPM Changelog
120
+
121
+ The Changelog is pulled from a file called `CHANGELOG` at the top level of the
122
+ project. If this file does not start with a well formatted RPM changelog
123
+ string, it will be ignored.
124
+
125
+ The Changelog is *not* fully checked before attempting to build the RPM. Your
126
+ RPM build will fail if the Changelog entries are not valid per the RPM
127
+ specification.
128
+
129
+ #### RPM Dependencies
130
+
131
+ It is likely that you will want to declare your dependencies in your RPM. To do
132
+ this, you can create a `build/rpm_metadata` directory at the root of your
133
+ project. A file named `requires` in the `build/rpm_metadata` directory will be
134
+ used to declare the dependencies of the RPM.
135
+
136
+ The following directives may be declared in the `requires` file:
137
+ * Provides
138
+ * Requires
139
+ * Obsoletes
140
+
104
141
  ## Reference
105
142
 
106
143
  ### simp/rake/rpm
@@ -605,10 +605,9 @@ protect=1
605
605
  pkginfo = Hash.new
606
606
  Dir.glob('dist/*.rpm') do |rpm|
607
607
  if not rpm =~ /.*.src.rpm/ then
608
- # get_info from each generated rpm, not the spec file, so macros in the
609
- # metadata have already been resolved in the mock chroot.
610
- pkginfo = Simp::RPM.get_info(rpm)
611
- result << [pkginfo,module_metadata]
608
+ # get_info from each generated rpm, not the spec file, so macros in the
609
+ # metadata have already been resolved in the mock chroot.
610
+ result << Simp::RPM.get_info(rpm)
612
611
  end
613
612
  end
614
613
  else
@@ -619,20 +618,21 @@ protect=1
619
618
  result
620
619
  end
621
620
 
622
- metadata.each do |i|
621
+ metadata.each do |mod|
623
622
  # Each module could generate multiple rpms, each with its own metadata.
624
623
  # Iterate over them to add all built rpms to autorequires.
625
- i.each do |module_pkginfo,module_metadata|
626
- next unless (module_pkginfo and module_metadata)
624
+ mod.each do |module_pkginfo|
625
+ next unless (module_pkginfo)
627
626
 
628
627
  # Set up the autorequires
629
- if add_to_autoreq and not module_metadata['optional']
628
+ if add_to_autoreq
630
629
  # Register the package with the autorequires
631
630
  mode = 'r+'
632
631
  mode = 'w+' unless File.exist?("#{@src_dir}/build/autorequires")
633
632
  autoreq_fh = File.open("#{@src_dir}/build/autorequires",mode)
634
633
 
635
634
  begin
635
+ # Reads the autorequires file, then empties it
636
636
  autorequires = []
637
637
  autorequires += autoreq_fh.read.split("\n")
638
638
  autoreq_fh.rewind
@@ -1,10 +1,10 @@
1
1
  module Simp; end
2
2
  module Simp::Rake; end
3
- module Simp::Rake::Helpers; end
4
- module Simp::Rake::Helpers::RPM_Spec
3
+ class Simp::Rake::Helpers
4
+ module Simp::Rake::Helpers::RPM_Spec
5
5
 
6
- def self.template
7
- return <<-EOF
6
+ def self.template
7
+ return <<-EOF
8
8
  %{lua:
9
9
 
10
10
  --
@@ -295,6 +295,7 @@ else
295
295
  print((default_changelog:gsub('$(%w+)', default_lookup_table)))
296
296
  end
297
297
  }
298
- EOF
298
+ EOF
299
+ end
299
300
  end
300
301
  end
@@ -2,5 +2,5 @@ module Simp; end
2
2
  module Simp::Rake; end
3
3
 
4
4
  class Simp::Rake::Helpers
5
- VERSION = '2.4.0'
5
+ VERSION = '2.4.1'
6
6
  end
@@ -65,7 +65,7 @@ module Simp
65
65
  rpm_cmd = "rpm -q --queryformat '%{NAME} %{VERSION} %{RELEASE}\n'"
66
66
 
67
67
  if mock_hash
68
- rpm_cmd = mock_hash[:command] + ' ' + '"' + rpm_cmd + ' ' + mock_hash[:rpm_extras] + '"'
68
+ rpm_cmd = mock_hash[:command] + ' ' + '"' + rpm_cmd + ' ' + mock_hash[:rpm_extras] + ' 2>/dev/null "'
69
69
  end
70
70
 
71
71
  if File.readable?(rpm_source)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simp-rake-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Tessmer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-07-04 00:00:00.000000000 Z
12
+ date: 2016-07-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler