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

⌈⌋ ⎇ branch:  cross package maker


Check-in [d8dda5bcd9]

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

Overview
Comment:- use DEBEMAIL and DEBFULLNAME from environment as the default maintainer. https://github.com/jordansissel/fpm/issues/37 - remove some print statements that we don't need
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d8dda5bcd95ac05c7aa9b0ae2aae9f2930c4aca7
User & Date: jls@semicomplete.com 2011-05-18 08:17:01
Context
2011-05-18
08:22
- add changelist! check-in: 8c3d537d3e user: jls@semicomplete.com tags: trunk
08:17
- use DEBEMAIL and DEBFULLNAME from environment as the default maintainer. https://github.com/jordansissel/fpm/issues/37 - remove some print statements that we don't need check-in: d8dda5bcd9 user: jls@semicomplete.com tags: trunk
08:08
- Add new flags for the python source: --python-bin - path to the python binary you want to run --python-easyinstall - path to the easy_install script you want to use https://github.com/jordansissel/fpm/issues/38 check-in: b2b2725812 user: jls@semicomplete.com tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to lib/fpm/package.rb.

71
72
73
74
75
76
77
78



















79
80
81
82
83
84
85
    @dependencies = source[:dependencies] || []
    # Iteration can be nil. If nil, the fpm package implementation is expected
    # to handle any default value that should be instead.
    @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}>"




















    # If @architecture is nil, the target package should provide a default.
    # Special 'architecture' values include "all" (aka rpm's noarch, debian's all)
    # Another special includes "native" which will be the current platform's arch.
    @architecture = source[:architecture]
    @description = source[:description] || "no description given"
    @provides = source[:provides] || []







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
    @dependencies = source[:dependencies] || []
    # Iteration can be nil. If nil, the fpm package implementation is expected
    # to handle any default value that should be instead.
    @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}>"
    @maintainer = source[:maintainer]

    # Default maintainer if none given.
    if @maintainer.nil? or @maintainer.empty?
      # Reference
      # http://www.debian.org/doc/manuals/maint-guide/first.en.html
      # http://wiki.debian.org/DeveloperConfiguration
      # https://github.com/jordansissel/fpm/issues/37
      if ENV.include?("DEBEMAIL") and ENV.include?("DEBFULLNAME")
        # Use DEBEMAIL and DEBFULLNAME as the default maintainer if available.
        @maintainer = "#{ENV["DEBFULLNAME"]} <#{ENV["DEBEMAIL"]}>"
      else
        # TODO(sissel): Maybe support using 'git config' for a default as well?
        # git config --get user.name, etc can be useful.
        #
        # Otherwise default to user@currenthost
        @maintainer = "<#{ENV["USER"]}@#{Socket.gethostname}>"
      end
    end

    # If @architecture is nil, the target package should provide a default.
    # Special 'architecture' values include "all" (aka rpm's noarch, debian's all)
    # Another special includes "native" which will be the current platform's arch.
    @architecture = source[:architecture]
    @description = source[:description] || "no description given"
    @provides = source[:provides] || []

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

115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
      installdir = File.join(tmpdir, ::Gem::dir)
      @paths = [ ::Gem::dir ]
    end

    ::FileUtils.mkdir_p(installdir)
    args = ["gem", "install", "--quiet", "--no-ri", "--no-rdoc",
       "--install-dir", installdir, "--ignore-dependencies"]
    p :make_tarball => metadata
    if self[:settings][:bin_path]
      args += ["--bindir", File.join(tmpdir, self[:settings][:bin_path])]
      @paths << self[:settings][:bin_path]
    end

    args << gem
    system(*args)







<







115
116
117
118
119
120
121

122
123
124
125
126
127
128
      installdir = File.join(tmpdir, ::Gem::dir)
      @paths = [ ::Gem::dir ]
    end

    ::FileUtils.mkdir_p(installdir)
    args = ["gem", "install", "--quiet", "--no-ri", "--no-rdoc",
       "--install-dir", installdir, "--ignore-dependencies"]

    if self[:settings][:bin_path]
      args += ["--bindir", File.join(tmpdir, self[:settings][:bin_path])]
      @paths << self[:settings][:bin_path]
    end

    args << gem
    system(*args)

Changes to lib/fpm/source/python.rb.

34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
      download(package, params[:version])
    else
      @paths = [ File.expand_path(package) ]
    end
  end # def get_source

  def download(package, version=nil)
    p metadata
    puts "Trying to download #{package} (using: #{self[:settings][:easy_install]})"
    @tmpdir = ::Dir.mktmpdir("python-build", ::Dir.pwd)

    if version.nil?
      want_pkg = "#{package}"
    else
      want_pkg = "#{package}==#{version}"







<







34
35
36
37
38
39
40

41
42
43
44
45
46
47
      download(package, params[:version])
    else
      @paths = [ File.expand_path(package) ]
    end
  end # def get_source

  def download(package, version=nil)

    puts "Trying to download #{package} (using: #{self[:settings][:easy_install]})"
    @tmpdir = ::Dir.mktmpdir("python-build", ::Dir.pwd)

    if version.nil?
      want_pkg = "#{package}"
    else
      want_pkg = "#{package}==#{version}"