Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deb and rpm changelog support. #300

Merged
merged 1 commit into from Dec 7, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/fpm/package/deb.rb
Expand Up @@ -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"
Expand Down Expand Up @@ -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)

Expand Down
4 changes: 4 additions & 0 deletions lib/fpm/package/rpm.rb
Expand Up @@ -66,6 +66,10 @@ class FPM::Package::RPM < FPM::Package
value.downcase
end

option "--changelog", "FILEPATH", "Add changelog from FILEPATH contents" do |file|
File.read(File.expand_path(file))
end

private

# Handle any architecture naming conversions.
Expand Down
1 change: 1 addition & 0 deletions templates/rpm.erb
Expand Up @@ -147,3 +147,4 @@ fi
%>

%changelog
<%= attributes[:rpm_changelog] %>