Skip to content

Commit

Permalink
Merge pull request jordansissel#428 from phrawzty/defattr
Browse files Browse the repository at this point in the history
add args for controlling rpm %defattr
  • Loading branch information
jls committed May 7, 2013
2 parents ca7bf99 + 57df2f3 commit b3751d0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions lib/fpm/package/rpm.rb
Expand Up @@ -44,6 +44,18 @@ class FPM::Package::RPM < FPM::Package
value
end

option "--defattrfile", "ATTR",
"Set the default file mode (%defattr).",
:default => '-' do |value|
value
end

option "--defattrdir", "ATTR",
"Set the default dir mode (%defattr).",
:default => '-' do |value|
value
end

rpmbuild_define = []
option "--rpmbuild-define", "DEFINITION",
"Pass a --define argument to rpmbuild." do |define|
Expand Down
2 changes: 1 addition & 1 deletion templates/rpm.erb
Expand Up @@ -142,7 +142,7 @@ cp <%= source_safe %> <%= target_safe %>
<% end -%>

%files
%defattr(-,<%= attributes[:rpm_user] %>,<%= attributes[:rpm_group] %>,-)
%defattr(<%= attributes[:rpm_defattrfile] %>,<%= attributes[:rpm_user] %>,<%= attributes[:rpm_group] %>,<%= attributes[:rpm_defattrdir] %>)
<%# Output config files and then regular files. -%>
<% config_files.each do |path| -%>
%config(noreplace) <%= rpm_fix_name(path) %>
Expand Down

0 comments on commit b3751d0

Please sign in to comment.