12 def_delegators :@spec, :name, :version, :date, :summary, :email,
13 :rubyforge_project, :description, :local?, :remote?
22 GGem.ebuild_name(spec.name)
26 File.expand_path(File.join(Portage.rubydev_overlay, ebuild_name, "#{ebuild_name}-#{spec.version}#{EXTENSION}"))
30 File.dirname(file_path)
33 def basename(include_extension=true)
34 File.basename(file_path, (EXTENSION unless include_extension) )
38 File.exists? file_path
43 dir = File.dirname(file_path)
44 FileUtils.mkdir_p(dir) unless File.directory?(dir)
45 File.open(file_path, 'w') { |f| f.write(content) }
49 uri = spec.fetched_from if spec.respond_to? :fetched_from
50 (spec.local? ? "#{uri}/" : "#{uri}/gems/") + (ebuild_name == spec.name ? "${P}.gem" : "${MY_P}.gem")
62 @spec.homepage || "http://rubyforge.org/projects/#{@spec.rubyforge_project or @spec.name}"
66 "#{'doc' if spec.has_rdoc}"
70 category = Portage.category
71 required_ruby = DependencyAtom.from_required_ruby_version(spec)
72 spec.dependencies.inject(required_ruby) do |s,d|
73 s + "\n" + DependencyAtom.from_gem_dependency(d, category).to_s
80 # Copyright 1999-#{Date.today.year} Gentoo Foundation
81 # Distributed under the terms of the GNU General Public License v2
87 MY_P="#{spec.name}-${PV}"
88 DESCRIPTION=#{(summary.capitalize.chomp('.')+'.').inspect}
89 HOMEPAGE=#{homepage.inspect}
90 SRC_URI=#{src_uri.inspect}
92 LICENSE=#{license.inspect}
94 KEYWORDS=#{keywords.inspect}
97 DEPEND=#{depend.inspect.gsub('\n', "\n\t")}
101 def execute(*commands)
104 ENV.with(:GENTOO_MIRRORS => local_gentoo_mirror) do
109 generate if commands.delete('generate')
110 raise "Missing #{file_path}" unless exists?
111 system("ebuild #{file_path} #{commands.join(' ')}") unless commands.empty?