Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- Start work on rpm support using my pure-ruby rpm library.

  • Loading branch information...
commit a11b3a40658cc52f6ef64f659333df5c8dd38088 1 parent f385378
@jordansissel authored
Showing with 31 additions and 1 deletion.
  1. +1 −1  lib/fpm/package/dir.rb
  2. +30 −0 lib/fpm/package/rpm.rb
View
2  lib/fpm/package/dir.rb
@@ -38,7 +38,7 @@ def clone(source, destination)
# Copy all files from 'path' into staging_path
::Dir.chdir(@attributes[:chdir] || ".") do
- p :chdir => ::Dir.pwd, :source => source
+ #p :chdir => ::Dir.pwd, :source => source
Find.find(source).each do |file|
next if source == file # ignore the directory itself
# Translate file paths with attributes like 'prefix' and 'chdir'
View
30 lib/fpm/package/rpm.rb
@@ -0,0 +1,30 @@
+require "fpm/package"
+require "backports"
+require "fileutils"
+require "find"
+require "rpm" # gem 'rpm'
+require "rpm/file"
+
+class FPM::Package::RPM < FPM::Package
+ private
+
+ def <<(path)
+ rpm = ::RPM::File.new(path)
+
+ tags = {}
+ rpm.header.tags.each do |tag|
+ tags[tag.tag] = tag.value
+ end
+
+ # For all meaningful tags, set package metadata
+ # TODO(sissel): find meaningful tags
+
+ # Extract to the staging directory
+ rpm.extract(staging_path)
+ end # def <<
+
+ def output(dir)
+ end
+
+ public(:<<, :output)
+end # class FPM::Package::Dir
Please sign in to comment.
Something went wrong with that request. Please try again.