simp-rake-helpers 2.4.0 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +40 -3
- data/lib/simp/rake/build/pkg.rb +8 -8
- data/lib/simp/rake/helpers/rpm_spec.rb +6 -5
- data/lib/simp/rake/helpers/version.rb +1 -1
- data/lib/simp/rpm.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0804d79f5af26fb909c8f9dbe745c503515ed72c
|
4
|
+
data.tar.gz: b0fbb44adfee8b3ea53f15a88715ae33289eaaf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c59fd53d33e24218a21cad227ea27d01052d152c0e016cf4632b85688d12501755ced61c6d30bec16fba5c97ec8f53b1557abf84b4cd18d9897a4cb37657504
|
7
|
+
data.tar.gz: b431ebc4958b3de9e4e279fd079611d91de79f2f0f2302925076ca5fc69963ecf02b12a3b6a1ffea98d39e9e70d201f071401f5b0529e3dfe770ba333b8525c3
|
data/CHANGELOG.md
CHANGED
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
|
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
|
-
*
|
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
|
data/lib/simp/rake/build/pkg.rb
CHANGED
@@ -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
|
-
|
609
|
-
|
610
|
-
|
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 |
|
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
|
-
|
626
|
-
next unless (module_pkginfo
|
624
|
+
mod.each do |module_pkginfo|
|
625
|
+
next unless (module_pkginfo)
|
627
626
|
|
628
627
|
# Set up the autorequires
|
629
|
-
if add_to_autoreq
|
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
|
-
|
4
|
-
module Simp::Rake::Helpers::RPM_Spec
|
3
|
+
class Simp::Rake::Helpers
|
4
|
+
module Simp::Rake::Helpers::RPM_Spec
|
5
5
|
|
6
|
-
|
7
|
-
|
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
|
-
|
298
|
+
EOF
|
299
|
+
end
|
299
300
|
end
|
300
301
|
end
|
data/lib/simp/rpm.rb
CHANGED
@@ -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.
|
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-
|
12
|
+
date: 2016-07-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|