Check-in [18a95fa4d4]
Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | - add --provides flag and support into rpm target |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
18a95fa4d46e1ac78dc579f7ea8eadbd |
| User & Date: | jls@semicomplete.com 2011-04-25 20:40:47 |
Context
|
2011-04-25
| ||
| 22:37 | - add provids support to deb check-in: 4594a25d01 user: jls@semicomplete.com tags: trunk | |
| 20:40 | - add --provides flag and support into rpm target check-in: 18a95fa4d4 user: jls@semicomplete.com tags: trunk | |
| 18:43 | - include epoch value in filename output by default check-in: fe4fcb3f0c user: jls@semicomplete.com tags: trunk | |
Changes
Changes to bin/fpm.
| ︙ | ︙ | |||
39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
settings.epoch = epoch
end # --epoch
opts.on("-d DEPENDENCY", "--depends DEPENDENCY") do |dep|
settings.dependencies ||= []
settings.dependencies << dep
end # --depends
opts.on("-a ARCHITECTURE", "--architecture ARCHITECTURE") do |arch|
settings.architecture = arch
end # --architecture
opts.on("-m MAINTAINER", "--maintainer MAINTAINER") do |maintainer|
settings.maintainer = maintainer
| > > > > > | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
settings.epoch = epoch
end # --epoch
opts.on("-d DEPENDENCY", "--depends DEPENDENCY") do |dep|
settings.dependencies ||= []
settings.dependencies << dep
end # --depends
opts.on("--provides PROVIDES") do |thing|
settings.provides ||= []
settings.provides << thing
end # --depends
opts.on("-a ARCHITECTURE", "--architecture ARCHITECTURE") do |arch|
settings.architecture = arch
end # --architecture
opts.on("-m MAINTAINER", "--maintainer MAINTAINER") do |maintainer|
settings.maintainer = maintainer
|
| ︙ | ︙ |
Changes to fpm.gemspec.
1 2 3 4 5 6 7 8 |
Gem::Specification.new do |spec|
files = []
dirs = %w{lib bin templates}
dirs.each do |dir|
files += Dir["#{dir}/**/*"]
end
spec.name = "fpm"
| | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
Gem::Specification.new do |spec|
files = []
dirs = %w{lib bin templates}
dirs.each do |dir|
files += Dir["#{dir}/**/*"]
end
spec.name = "fpm"
spec.version = "0.2.18"
spec.summary = "fpm - package building and mangling"
spec.description = "Turn directories into packages. Fix broken packages. Win the package building game."
spec.add_dependency("json")
spec.files = files
spec.require_paths << "lib"
spec.bindir = "bin"
spec.executables << "fpm"
|
| ︙ | ︙ |
Changes to lib/fpm/builder.rb.
| ︙ | ︙ | |||
34 35 36 37 38 39 40 |
paths, root,
:version => settings.version,
:epoch => settings.epoch,
:name => settings.package_name,
:prefix => settings.prefix,
:suffix => settings.suffix,
:exclude => settings.exclude,
| | > > > < | 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
paths, root,
:version => settings.version,
:epoch => settings.epoch,
:name => settings.package_name,
:prefix => settings.prefix,
:suffix => settings.suffix,
:exclude => settings.exclude,
:maintainer => settings.maintainer,
:provides => []
)
@edit = !!settings.edit
@paths = paths
@package = package_class_for(settings.package_type).new(@source)
# Append dependencies given from settings (-d flag for fpm)
@package.dependencies += settings.dependencies if settings.dependencies
# Append provides given from settings (--provides flag for fpm)
@package.provides += settings.provides if settings.provides
@package.architecture = settings.architecture if settings.architecture
@output = settings.package_path
@recurse_dependencies = settings.recurse_dependencies
end # def initialize
def tar_path
@tar_path ||= "#{builddir}/data.tar"
|
| ︙ | ︙ |
Changes to lib/fpm/package.rb.
| ︙ | ︙ | |||
38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
attr_accessor :license
# What architecture is this package for?
attr_accessor :architecture
# Array of dependencies.
attr_accessor :dependencies
# a summary or description of the package
attr_accessor :summary
def initialize(source)
@source = source
| > > > > | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
attr_accessor :license
# What architecture is this package for?
attr_accessor :architecture
# Array of dependencies.
attr_accessor :dependencies
# Array of things this package provides.
# (Not all packages support this)
attr_accessor :provides
# a summary or description of the package
attr_accessor :summary
def initialize(source)
@source = source
|
| ︙ | ︙ | |||
61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
@iteration = source[:iteration]
@url = source[:url] || "http://nourlgiven.example.com/no/url/given"
@category = source[:category] || "default"
@license = source[:license] || "unknown"
@maintainer = source[:maintainer] || "<#{ENV["USER"]}@#{Socket.gethostname}>"
@architecture = source[:architecture] || %x{uname -m}.chomp
@summary = source[:summary] || "no summary given"
end # def initialize
def generate_specfile(builddir, paths)
spec = template.result(binding)
File.open(specfile(builddir), "w") { |f| f.puts spec }
end # def generate_specfile
| > | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
@iteration = source[:iteration]
@url = source[:url] || "http://nourlgiven.example.com/no/url/given"
@category = source[:category] || "default"
@license = source[:license] || "unknown"
@maintainer = source[:maintainer] || "<#{ENV["USER"]}@#{Socket.gethostname}>"
@architecture = source[:architecture] || %x{uname -m}.chomp
@summary = source[:summary] || "no summary given"
@provides = source[:provides] || []
end # def initialize
def generate_specfile(builddir, paths)
spec = template.result(binding)
File.open(specfile(builddir), "w") { |f| f.puts spec }
end # def generate_specfile
|
| ︙ | ︙ |
Changes to templates/rpm.erb.
| ︙ | ︙ | |||
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
nextversion = nextversion.join(".")
["#{name} >= #{version}", "#{name} < #{nextversion}"]
else
d
end
end
%>Requires: <%= properdeps.join(", ") %>
<% end %>
%description
<%= @summary %>
%prep
echo "PREP"
| > > > | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
nextversion = nextversion.join(".")
["#{name} >= #{version}", "#{name} < #{nextversion}"]
else
d
end
end
%>Requires: <%= properdeps.join(", ") %>
<% end %>
<% provides.each do |prov| %>
Provides: <%= prov %>
<% end %>
%description
<%= @summary %>
%prep
echo "PREP"
|
| ︙ | ︙ |