From 9964ec80bf3b3414d8c9ec1aff4a964788b0d446 Mon Sep 17 00:00:00 2001 From: "jls@semicomplete.com" Date: Wed, 18 May 2011 08:17:01 +0000 Subject: [PATCH] - 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 --- lib/fpm/package.rb | 21 ++++++++++++++++++++- lib/fpm/source/gem.rb | 1 - lib/fpm/source/python.rb | 1 - 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/lib/fpm/package.rb b/lib/fpm/package.rb index 6d198dccd5..7bd6e898bc 100644 --- a/lib/fpm/package.rb +++ b/lib/fpm/package.rb @@ -75,7 +75,26 @@ def initialize(source) @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] || "<#{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) diff --git a/lib/fpm/source/gem.rb b/lib/fpm/source/gem.rb index 6fc57a811e..b230db04ab 100644 --- a/lib/fpm/source/gem.rb +++ b/lib/fpm/source/gem.rb @@ -119,7 +119,6 @@ def make_tarball!(tar_path, builddir) ::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] diff --git a/lib/fpm/source/python.rb b/lib/fpm/source/python.rb index ca0ec78c54..e090e0aebf 100644 --- a/lib/fpm/source/python.rb +++ b/lib/fpm/source/python.rb @@ -38,7 +38,6 @@ def get_source(params) 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)