class RBT::Cookbooks::CreateEbuild
Constants
- DEFAULT_PROGRAM
#¶ ↑
DEFAULT_PROGRAM
¶ ↑#¶ ↑
- DIRECTORY_FOR_EBUILDS
#¶ ↑
DIRECTORY_FOR_EBUILDS
¶ ↑Where to store the ebuilds.
#¶ ↑
- NAMESPACE
#¶ ↑
NAMESPACE
¶ ↑#¶ ↑
- PORTAGE_BASE_DIRECTORY
#¶ ↑
PORTAGE_BASE_DIRECTORY
¶ ↑Where portage normally keeps an .ebuild file.
#¶ ↑
Public Class Methods
Public Instance Methods
data?()
click to toggle source
do_create_the_ebuild()
click to toggle source
#¶ ↑
do_create_the_ebuild
¶ ↑
This method will create the specific .ebuild file in question.
#¶ ↑
# File lib/rbt/utility_scripts/create_ebuild.rb, line 150 def do_create_the_ebuild license = ''.dup # empty at default license = licence? unless licence?.empty? # ======================================================================= # # Generate the main string next. # ======================================================================= # string = ''.dup string << 'EAPI="5" PYTHON_COMPAT=( python2_7 ) AUTOTOOLS_AUTORECONF=true inherit autotools-utils linux-info python-any-r1 ARTS_REQUIRED="never" MY_P="'+short_name?+'" DESCRIPTION="'+data?.description?+'" HOMEPAGE="'+homepage?.to_s+'" SRC_URI="'+url1?+'" LICENSE="'+license+'" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="debug doc" need-kde 3.5 S="${WORKDIR}/${MY_P}" DEPEND="'+required_deps_on?+'" RDEPEND="${DEPEND} x11-libs/qt-svg:4[debug?]" src_compile () { mkdir build cd build cmake .. emake || die "emake failed" } src_install () { cd build emake DESTDIR=${D} install || die "emake install failed" dodoc ChangeLog README TODO } ' write_what_into(string, store_where?) # Overwrite. opnn; e "Created ebuild for #{program?} at `#{sfile(store_where?)}`." end
guess_program_name()
click to toggle source
homepage?()
click to toggle source
is_on_gentoo?()
click to toggle source
license?()
click to toggle source
#¶ ↑
license?¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/create_ebuild.rb, line 141 def license? data?.license? end
Also aliased as: licence?
notify_the_user_what_we_are_about_to_do()
click to toggle source
program_name?()
click to toggle source
#¶ ↑
program_name?¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/create_ebuild.rb, line 228 def program_name? @program_name end
Also aliased as: program?
required_deps_on?()
click to toggle source
reset()
click to toggle source
run()
click to toggle source
#¶ ↑
run¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/create_ebuild.rb, line 263 def run create_directory(DIRECTORY_FOR_EBUILDS) # Create the basic ebuild directory. # ======================================================================= # # Next, consider creating the portage base directory. # Not everyone wants this though, so I have uncommented it for now - # or rather, it uses a "is_on_gentoo?" check, which currently will # always return false. # ======================================================================= # if is_on_gentoo? create_directory(PORTAGE_BASE_DIRECTORY) unless File.directory? PORTAGE_BASE_DIRECTORY end guess_program_name if program_name?.empty? notify_the_user_what_we_are_about_to_do do_create_the_ebuild end
set_data(i = nil)
click to toggle source
#¶ ↑
set_data
¶ ↑
The input should be a Hash.
#¶ ↑
# File lib/rbt/utility_scripts/create_ebuild.rb, line 92 def set_data(i = nil) i = DEFAULT_PROGRAM if i.nil? i = RBT::Cookbooks::Cookbook.new(i) { :bypass_menu }.dataset? if i.is_a? String if i.is_a? Array if i.empty? # Empty Arrays will be treated differently. i = RBT::Cookbooks::Cookbook.new(DEFAULT_PROGRAM) { :bypass_menu }.dataset? else i = i.join(' ') end end @data = i if @data.is_a? Hash set_program_name(@data['short_name']) end end
set_program_name(i = '')
click to toggle source
short_name?()
click to toggle source
store_where?()
click to toggle source