Cross package maker. DEB/RPM generation or conversion. Derived from jordansissel/fpm.

⌈⌋ ⎇ branch:  cross package maker


Check-in [215c7a3b19]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:- clean up docs and requires
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 215c7a3b19d987ad4f57bffff225620b3b84dc38
User & Date: jls@semicomplete.com 2012-03-02 10:44:12
Context
2012-03-02
10:44
- allow package subclasses to define command-line flags check-in: 31240eae3e user: jls@semicomplete.com tags: trunk
10:44
- clean up docs and requires check-in: 215c7a3b19 user: jls@semicomplete.com tags: trunk
10:44
use new options goodness check-in: a48642e336 user: jls@semicomplete.com tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to lib/fpm/package/gem.rb.

156
157
158
159
160
161
162
163
    #end

    args << gem_path
    safesystem(*args)
  end # def install_to_staging

  public(:input, :output)
end # class FPM::Source::Gem







|
156
157
158
159
160
161
162
163
    #end

    args << gem_path
    safesystem(*args)
  end # def install_to_staging

  public(:input, :output)
end # class FPM::Package::Gem

Changes to lib/fpm/package/npm.rb.

1
2
3
4
5
6
7
8
9
10
11
12
13
require "fpm/namespace"
require "fpm/source"
require "fpm/util"
require "fileutils"

class FPM::Package::NPM < FPM::Source
  def get_source(params)
    @npm = @paths.first
  end # def get_source

  def download(npm_name, version=nil)
  end # def download


|



|







1
2
3
4
5
6
7
8
9
10
11
12
13
require "fpm/namespace"
require "fpm/package"
require "fpm/util"
require "fileutils"

class FPM::Package::NPM < FPM::Package
  def get_source(params)
    @npm = @paths.first
  end # def get_source

  def download(npm_name, version=nil)
  end # def download

29
30
31
32
33
34
35
36
    safesystem(*args)
    tar(tar_path, ".", tmpdir)

    # TODO(sissel): Make a helper method.
    safesystem(*["gzip", "-f", tar_path])
  end

end # class FPM::Source::Gem







|
29
30
31
32
33
34
35
36
    safesystem(*args)
    tar(tar_path, ".", tmpdir)

    # TODO(sissel): Make a helper method.
    safesystem(*["gzip", "-f", tar_path])
  end

end # class FPM::Package::NPM

Changes to lib/fpm/package/pear.rb.

1
2
3
4
5
6
7
8
9
10
11
12
13
require "fpm/namespace"
require "fpm/source"
require "fileutils"
require "fpm/util"

class FPM::Package::PEAR < FPM::Source
  def self.flags(opts, settings)
    opts.on("--package-prefix PREFIX",
            "Prefix for PEAR packages") do |package_prefix|
      settings.source[:package_prefix] = package_prefix
    end
  end # def flags


|



|







1
2
3
4
5
6
7
8
9
10
11
12
13
require "fpm/namespace"
require "fpm/package"
require "fileutils"
require "fpm/util"

class FPM::Package::PEAR < FPM::Package
  def self.flags(opts, settings)
    opts.on("--package-prefix PREFIX",
            "Prefix for PEAR packages") do |package_prefix|
      settings.source[:package_prefix] = package_prefix
    end
  end # def flags

34
35
36
37
38
39
40
41
	# find exits non-zero even though it works, so we have to work around that
	safesystem("find #{tmpdir} -type d -name '.channel*' -exec rm -rf {} \\; 2>/dev/null; exit 0")
    tar(tar_path, '.', tmpdir)
    @paths = %x{find #{tmpdir} -mindepth 1 -maxdepth 1 -type d | sed -e 's:^#{tmpdir}:.:'}.split("\n")
    safesystem(*["gzip", "-f", tar_path])
  end

end # class FPM::Source::Gem







|
34
35
36
37
38
39
40
41
	# find exits non-zero even though it works, so we have to work around that
	safesystem("find #{tmpdir} -type d -name '.channel*' -exec rm -rf {} \\; 2>/dev/null; exit 0")
    tar(tar_path, '.', tmpdir)
    @paths = %x{find #{tmpdir} -mindepth 1 -maxdepth 1 -type d | sed -e 's:^#{tmpdir}:.:'}.split("\n")
    safesystem(*["gzip", "-f", tar_path])
  end

end # class FPM::Package::PEAR

Changes to lib/fpm/package/tar.rb.

1
2
3
4
5
6
7
8
9
10
11
12
13
require "backports" # gem backports
require "fpm/source"
require "fpm/util"
require "fileutils"

class FPM::Source::Tar < FPM::Source
  def get_metadata
    self[:name] = @paths.first.split(".").first
  end # def get_metadata

  def make_tarball!(tar_path, builddir)
    input_tarball = @paths.first


|



|







1
2
3
4
5
6
7
8
9
10
11
12
13
require "backports" # gem backports
require "fpm/package"
require "fpm/util"
require "fileutils"

class FPM::Package::Tar < FPM::Package
  def get_metadata
    self[:name] = @paths.first.split(".").first
  end # def get_metadata

  def make_tarball!(tar_path, builddir)
    input_tarball = @paths.first

43
44
45
46
47
48
49
50
    ::Dir.chdir("#{builddir}/tarbuild") do
      tar(tar_path, ".")
    end

    # TODO(sissel): Make a helper method.
    safesystem(*["gzip", "-f", tar_path])
  end # def make_tarball!
end # class FPM::Source::Dir







|
43
44
45
46
47
48
49
50
    ::Dir.chdir("#{builddir}/tarbuild") do
      tar(tar_path, ".")
    end

    # TODO(sissel): Make a helper method.
    safesystem(*["gzip", "-f", tar_path])
  end # def make_tarball!
end # class FPM::Package::Tar