Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'changelog_support' of https://github.com/r4um/fpm into …

…r4um-changelog_support

Conflicts:
	lib/fpm/package/rpm.rb
  • Loading branch information...
commit ca66f09eae6d4784bdd5197a0bb243ece71cff2c 2 parents 9f3d9c9 + fdfbddd
@jordansissel authored
View
12 lib/fpm/package/deb.rb
@@ -73,6 +73,10 @@ class FPM::Package::Deb < FPM::Package
option "--group", "GROUP", "The group owner of files in this package"
+ option "--changelog", "FILEPATH", "Add FILEPATH as debian changelog" do |file|
+ File.expand_path(file)
+ end
+
def initialize(*args)
super(*args)
attributes[:deb_priority] = "extra"
@@ -274,6 +278,14 @@ def output(output_path)
tar_flags += [ "--group", attributes[:deb_group] ]
end
+ if attributes[:deb_changelog]
+ dest_changelog = File.join(staging_path, "usr/share/doc/#{attributes[:name]}/changelog.Debian")
+ FileUtils.mkdir_p(File.dirname(dest_changelog))
+ FileUtils.cp attributes[:deb_changelog], dest_changelog
+ safesystem("gzip", dest_changelog)
+ File.chmod(0644, dest_changelog)
+ end
+
args = [ tar_cmd, "-C", staging_path, compression ] + tar_flags + [ "-cf", datatar, "." ]
safesystem(*args)
View
4 lib/fpm/package/rpm.rb
@@ -71,6 +71,10 @@ class FPM::Package::RPM < FPM::Package
option "--os", "OS", "The operating system to target this rpm for. " \
"You want to set this to 'linux' if you are using fpm on OS X, for example"
+ option "--changelog", "FILEPATH", "Add changelog from FILEPATH contents" do |file|
+ File.read(File.expand_path(file))
+ end
+
private
# Handle any architecture naming conversions.
View
1  templates/rpm.erb
@@ -151,3 +151,4 @@ cp <%= source_safe %> <%= target_safe %>
%>
%changelog
+<%= attributes[:rpm_changelog] %>
Please sign in to comment.
Something went wrong with that request. Please try again.