packaging_rake_tasks 1.5.1 → 1.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/tasks/build_dependencies.rake +50 -10
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a92258f52b7bcddc572736022561d288af42c9ae444c9fee77e1e079a0be6bd1
|
4
|
+
data.tar.gz: 7439a1b53ae472c235875108c511f9f13d005bcf1ab25cf9509356651e5ad64a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d99843ac07be5625e4bf5104c8e068fa2a450f0525eae3b9acaddac27b6e29e6f2a750130577642bbf352643c53016e4b0fcc11acb039769a6043f63b3507fdf
|
7
|
+
data.tar.gz: bfda90bfce230b73b517a9c8f6313d579c8d797461df971837bffd96559b12e6a10e55e2d8453d9c210c626dcab5850ef2979adb5c38a38a42cdca56e753d17b
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.5.
|
1
|
+
1.5.4
|
@@ -18,21 +18,61 @@
|
|
18
18
|
|
19
19
|
require "shellwords"
|
20
20
|
require "open3"
|
21
|
+
require "tempfile"
|
21
22
|
|
22
23
|
namespace :build_dependencies do
|
23
|
-
|
24
|
-
|
24
|
+
# Read the multi build targets from the "_multibuild" file.
|
25
|
+
# @return [Array<String>] list of multi build targets or empty Array if the
|
26
|
+
# "_multibuild" file does not exist
|
27
|
+
def multibuild_flavors
|
28
|
+
flavors = []
|
25
29
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
30
|
+
# parse the _multibuild XML file if it is present
|
31
|
+
mbfile = File.join(Packaging::Configuration.instance.package_dir, "_multibuild")
|
32
|
+
if File.exist?(mbfile)
|
33
|
+
require "rexml/document"
|
34
|
+
doc = REXML::Document.new(File.read(mbfile))
|
35
|
+
doc.elements.each("//multibuild/flavor | //multibuild/package") do |node|
|
36
|
+
flavors << node.text.strip
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
puts "Found multibuild targets: #{flavors.join(", ")}" if verbose && !flavors.empty?
|
41
|
+
flavors
|
42
|
+
end
|
32
43
|
|
33
|
-
|
44
|
+
# Read the build dependencies from a file
|
45
|
+
def buildrequires_from_file(file)
|
46
|
+
stdout = `rpmspec -q --buildrequires #{file.shellescape}`
|
47
|
+
raise "Parsing #{file} failed" unless $?.success?
|
48
|
+
stdout.split("\n")
|
49
|
+
end
|
50
|
+
|
51
|
+
# Read the build dependencies from all spec files. For multi build packages
|
52
|
+
# evaluate all package flavors.
|
53
|
+
# @return [Array<String>] list of build dependencies
|
54
|
+
def buildrequires
|
55
|
+
buildrequires = []
|
56
|
+
# OBS additionally runs a default build with empty flavor in multi build packages,
|
57
|
+
# for simplification use it also for single build packages
|
58
|
+
flavors = multibuild_flavors + [ "" ]
|
59
|
+
Dir.glob("#{Packaging::Configuration.instance.package_dir}/*.spec").each do |spec_file|
|
60
|
+
# replace the "@BUILD_FLAVOR@" placeholder by each flavor defined
|
61
|
+
flavors.each do |flavor|
|
62
|
+
spec_content = File.read(spec_file).gsub!("@BUILD_FLAVOR@", flavor)
|
34
63
|
|
35
|
-
|
64
|
+
if spec_content.nil?
|
65
|
+
# no replacement, use the file directly
|
66
|
+
buildrequires.concat(buildrequires_from_file(spec_file))
|
67
|
+
else
|
68
|
+
# rpmspec can only read a file, write the processed data to a temporary file
|
69
|
+
Tempfile.create(["rake_build_deps-", ".spec"]) do |tmp|
|
70
|
+
tmp.write(spec_content)
|
71
|
+
tmp.flush
|
72
|
+
buildrequires.concat(buildrequires_from_file(tmp.path))
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
36
76
|
end
|
37
77
|
|
38
78
|
# remove the duplicates and sort the packages for easier reading
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: packaging_rake_tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josef Reidinger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -49,7 +49,7 @@ files:
|
|
49
49
|
- lib/tasks/tarball.rake
|
50
50
|
homepage: https://github.com/openSUSE/packaging_rake_tasks
|
51
51
|
licenses:
|
52
|
-
- LGPL
|
52
|
+
- LGPL-2.1
|
53
53
|
metadata: {}
|
54
54
|
post_install_message:
|
55
55
|
rdoc_options: []
|
@@ -66,8 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '0'
|
68
68
|
requirements: []
|
69
|
-
|
70
|
-
rubygems_version: 2.7.6.3
|
69
|
+
rubygems_version: 3.3.26
|
71
70
|
signing_key:
|
72
71
|
specification_version: 4
|
73
72
|
summary: Rake tasks providing tasks to package project in git and integration with
|