12 def_delegators :@spec, :name, :version, :date, :summary, :email,
13 :rubyforge_project, :description, :local?, :remote?
22 File.expand_path(File.join(Portage.rubydev_overlay, spec.name, "#{spec.full_name}#{EXTENSION}"))
26 File.dirname(file_path)
29 def basename(include_extension=true)
30 File.basename(file_path, (EXTENSION unless include_extension) )
34 File.exists? file_path
39 dir = File.dirname(file_path)
40 FileUtils.mkdir_p(dir) unless File.directory?(dir)
41 File.open(file_path, 'w') { |f| f.write(content) }
45 uri = spec.fetched_from if spec.respond_to? :fetched_from
46 spec.local? ? "#{uri}/${P}.gem" : "#{uri}/gems/${P}.gem"
58 @spec.homepage || "http://rubyforge.org/projects/#{@spec.rubyforge_project or @spec.name}"
62 "#{'doc' if spec.has_rdoc}"
66 category = Portage.category
67 required_ruby = DependencyAtom.from_required_ruby_version(spec)
68 spec.dependencies.inject(required_ruby) do |s,d|
69 s + "\n" + DependencyAtom.from_gem_dependency(d, category).to_s
76 # Copyright 1999-#{Date.today.year} Gentoo Foundation
77 # Distributed under the terms of the GNU General Public License v2
83 DESCRIPTION=#{(summary.capitalize.chomp('.')+'.').inspect}
84 HOMEPAGE=#{homepage.inspect}
85 SRC_URI=#{src_uri.inspect}
87 LICENSE=#{license.inspect}
89 KEYWORDS=#{keywords.inspect}
92 DEPEND=#{depend.inspect.gsub('\n', "\n\t")}
96 def execute(*commands)
99 ENV.with(:GENTOO_MIRRORS => local_gentoo_mirror) do
104 generate if commands.delete('generate')
105 raise "Missing #{file_path}" unless exists?
106 system("ebuild #{file_path} #{commands.join(' ')}") unless commands.empty?