Generate spec file when creating srpm#100
Conversation
ec09015 to
648ef67
Compare
|
Closes #100 |
648ef67 to
40be811
Compare
40be811 to
9d86add
Compare
|
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
|
|
||
| actions: | ||
| post-upstream-clone: | ||
| - rake spec |
There was a problem hiding this comment.
Could you do this by rake -C packages yum:spec (packages/Rakefile not the top-level Rakefile)? Packages related code exist in packages/.
Could you use packages/yum/openarm-can.spec.in not .../fedora/...? We can reuse existing code by using packages/yum/openarm-can.spec.in.
diff --git a/packages/Rakefile b/packages/Rakefile
index 6091959..e921775 100644
--- a/packages/Rakefile
+++ b/packages/Rakefile
@@ -89,12 +89,36 @@ class OpenArmCANPackageTask < PackageTask
false
end
- def update_spec
- update_content("fedora/openarm-can.spec") do |content|
- content.gsub!(/^(Version:\s+)[\d.]+$/) do
- "#{$1}#{@version}"
+ def yum_spec
+ "#{yum_dir}/#{@rpm_package}.spec"
+ end
+
+ def define_yum_task
+ super
+
+ file yum_spec => yum_spec_in_path do
+ spec_in_data = File.read(yum_spec_in_path, encoding: "UTF-8")
+ spec_data = substitute_content(spec_in_data) do |key, matched|
+ yum_expand_variable(key) || matched
+ end
+ File.open(spec, "w") do |spec_file|
+ spec_file.print(spec_data)
end
end
+
+ namespace :yum do
+ desc "Update #{yum_spec}"
+ task spec: yum_spec
+ end
+ end
+
+ def yum_expand_variable(key)
+ case key
+ when "EXECUTABLES"
+ # ...
+ else
+ super
+ end
end
def define_archive_taskFYI: @VERSION@ is expanded by default: https://github.com/apache/arrow/blob/3dc982183db45ced57ef1565e022dcb647a00745/dev/tasks/linux-packages/package-task.rb#L444-L455
There was a problem hiding this comment.
Would it be possible to make https://github.com/apache/arrow/blob/main/dev/tasks/linux-packages/package-task.rb part of a gem? This would allow easy reuse in other projects.
Requiring Arrow and Groonga repositories at https://github.com/enactic/openarm_can/blob/main/packages/Rakefile#L17-L29 complicates the workflow. For the moment have placed the Rakefile in packages/yum/Rakefile to avoid these extra dependencies. If the logic they encode could be in a separate Gem or repository for use by multiple projects, it would be easier to incorporate.
There was a problem hiding this comment.
Happy to help with refactoring.
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
0476c08 to
8449b4f
Compare
|
/packit build |
8449b4f to
4b3304b
Compare
No description provided.