class 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/cookbooks/utility_scripts/create_ebuild.rb, line 141 def do_create_the_ebuild license = ''.dup # empty at default license = data?.license? unless data?.license?.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="'+url1?+'" 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
notify_the_user_what_we_are_about_to_do()
click to toggle source
opnn()
click to toggle source
program_name?()
click to toggle source
#¶ ↑
program_name?¶ ↑
#¶ ↑
# File lib/cookbooks/utility_scripts/create_ebuild.rb, line 212 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/cookbooks/utility_scripts/create_ebuild.rb, line 247 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. # ======================================================================= # # create_directory(PORTAGE_BASE_DIRECTORY) 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/cookbooks/utility_scripts/create_ebuild.rb, line 90 def set_data(i = nil) i = DEFAULT_PROGRAM if i.nil? i = 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 = 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