Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add setting for RPM user and group attributes in the %files section

  • Loading branch information...
commit d9970fb99f7dd5d35d46680b18338f36dba0e8dd 1 parent 8f4efb6
Jason Rogers authored
Showing with 12 additions and 1 deletion.
  1. +11 −0 lib/fpm/package/rpm.rb
  2. +1 −1  templates/rpm.erb
View
11 lib/fpm/package/rpm.rb
@@ -29,6 +29,17 @@ class FPM::Package::RPM < FPM::Package
"bzip2" => "w9.bzdio"
}
+ option "--user", "USER",
+ "Set the user to USER in the %files section.",
+ :default => 'root' do |value|
+ value
+ end
+
+ option "--group", "GROUP",
+ "Set the group to GROUP in the %files section.",
+ :default => 'root' do |value|
+ value
+ end
option "--rpmbuild-define", "DEFINITION",
"Pass a --define argument to rpmbuild." do |define|
View
2  templates/rpm.erb
@@ -96,7 +96,7 @@ fi
<% end -%>
%files
-%defattr(-,root,root,-)
+%defattr(-,<%= attributes[:rpm_user] %>,<%= attributes[:rpm_group] %>,-)
<%# Output config files and then regular files. -%>
<% config_files.each do |path| -%>
%config(noreplace) <%= path %>
Please sign in to comment.
Something went wrong with that request. Please try again.