Permalink
Browse files

- add user/group ownership settings for deb packages

  • Loading branch information...
1 parent f3bf4af commit 5ddfdd7ec26613967a96e26160df899a9cfb940c @jordansissel committed Sep 6, 2012
Showing with 12 additions and 1 deletion.
  1. +12 −1 lib/fpm/package/deb.rb
View
@@ -69,6 +69,10 @@ class FPM::Package::Deb < FPM::Package
option "--priority", "PRIORITY",
"The debian package 'priority' value.", :default => "extra"
+ option "--user", "USER", "The owner of files in this package"
+
+ option "--group", "GROUP", "The group owner of files in this package"
+
def initialize(*args)
super(*args)
attributes[:deb_priority] = "extra"
@@ -257,7 +261,14 @@ def output(output_path)
raise FPM::InvalidPackageConfiguration,
"Unknown compression type '#{self.attributes[:deb_compression]}'"
end
- safesystem(tar_cmd, "-C", staging_path, compression, "-cf", datatar, ".")
+ tar_flags = []
+ if !attributes[:deb_user].nil?
+ tar_flags += [ "--owner", attributes[:deb_user] ]
+ end
+ if !attributes[:deb_group].nil?
+ tar_flags += [ "--group", attributes[:deb_group] ]
+ end
+ safesystem(tar_cmd, "-C", staging_path, compression, *tar_flags, "-cf", datatar, ".")
# pack up the .deb, which is just an 'ar' archive with 3 files
# the 'debian-binary' file has to be first

0 comments on commit 5ddfdd7

Please sign in to comment.