mirror of
https://github.com/jordansissel/fpm
synced 2025-09-18 11:11:25 +02:00
- Added license meta data to packages
- Added vendor meta data to packages
This commit is contained in:
parent
eaa4e1d1bd
commit
72579f3389
@ -39,6 +39,9 @@ class FPM::Package
|
||||
# A identifier representing the license. Any string is fine.
|
||||
attr_accessor :license
|
||||
|
||||
# A identifier representing the vendor. Any string is fine.
|
||||
attr_accessor :vendor
|
||||
|
||||
# What architecture is this package for?
|
||||
attr_accessor :architecture
|
||||
|
||||
@ -90,6 +93,7 @@ class FPM::Package
|
||||
@url = source[:url] || "http://nourlgiven.example.com/no/url/given"
|
||||
@category = source[:category] || "default"
|
||||
@license = source[:license] || "unknown"
|
||||
@vendor = source[:vendor] || "none"
|
||||
#@maintainer = source[:maintainer] || "<#{ENV["USER"]}@#{Socket.gethostname}>"
|
||||
@maintainer = source[:maintainer]
|
||||
|
||||
|
@ -108,7 +108,7 @@ class FPM::Program
|
||||
begin
|
||||
remaining = opts.parse(args)
|
||||
rescue OptionParser::MissingArgument, OptionParser::InvalidOption
|
||||
$stderr.puts $!.to_s
|
||||
$stderr.puts $!.to_s
|
||||
$stderr.puts opts
|
||||
exit 2
|
||||
end
|
||||
@ -168,6 +168,14 @@ class FPM::Program
|
||||
@settings.epoch = epoch
|
||||
end # --epoch
|
||||
|
||||
opts.on("--license LICENSE", "(optional) Sets the license for this package.") do |license|
|
||||
@settings.license = license
|
||||
end # --license
|
||||
|
||||
opts.on("--vendor VENDOR", "(optional) Sets the vendor for this package.") do |vendor|
|
||||
@settings.vendor = vendor
|
||||
end # --vendor
|
||||
|
||||
opts.on("-d DEPENDENCY", "--depends DEPENDENCY") do |dep|
|
||||
@settings.dependencies << dep
|
||||
end # --depends
|
||||
|
@ -13,6 +13,8 @@ class FPM::Source
|
||||
category
|
||||
url
|
||||
description
|
||||
license
|
||||
vendor
|
||||
).each do |attr|
|
||||
attr = :"#{attr}"
|
||||
define_method(attr) { self[attr] }
|
||||
|
@ -1,9 +1,11 @@
|
||||
Package: <%= name %>
|
||||
Version: <%= "#{epoch}:" if epoch %><%= version %><%= iteration && '-'+iteration.to_s %>
|
||||
License: <%= license %>
|
||||
Architecture: <%= architecture %>
|
||||
Maintainer: <%= maintainer or "<unknown>" %>
|
||||
<% if !dependencies.empty? -%>
|
||||
<% properdeps = dependencies.collect { |d| fix_dependency(d) }.flatten -%>
|
||||
Vendor: <%= vendor %>
|
||||
Depends: <%= properdeps.flatten.join(", ") %>
|
||||
<% end -%>
|
||||
<% if !pre_dependencies.empty? -%>
|
||||
|
@ -17,6 +17,7 @@ TODO: [Jay] rpms require a license
|
||||
let's detect it intelligently
|
||||
-%>
|
||||
License: <%= license %>
|
||||
Vendor: <%= vendor %>
|
||||
URL: <%= url or "http://nourlgiven.example.com/" %>
|
||||
<% if !maintainer.empty? -%>
|
||||
Packager: <%= maintainer %>
|
||||
|
Loading…
Reference in New Issue
Block a user