Skip to content
rubyworks edited this page Sep 13, 2010 · 2 revisions

Current Version

The current version of Setup.rb (5.1.0 as of this writing), handles hooks via extensions, and no longer uses the per-directory hook system of v3.4.1 and below. The reason being that the new version collects all files to be copied up front, where as the old system installed files as it located them. However, you can still achieve much the same result by simply extending the Installer class to meet you needs. To hook into the process, use extension scripts according to the name of the class. For instance to augment the behavior of the Installer, write your code in .setup/installer.rb. This code will class_evaled into the instances singleton class.

3.4.1 and below

get_config(key) → String
get a configuration. (e.g. config(‘prefix’) for —prefix)
config(key) → String
same as get_config
set_config(key, val)
set a configuration KEY to VAL. (e.g. set_config(“prefix”, “/usr”))
curr_srcdir → String
the current srcdir.
curr_objdir → String
the current objdir.
srcdir_root → String
the root directory of srcdir. When the hook script is called from setup.rb, this method returns the top directory of each package directory (ARCHIVE_TOP/packages/*/).
objdir_root → String
the root directory of objdir. When the hook script is called from setup.rb, this method returns the top directory of each package directory (OBJDIR/packages/*/).
srcfile(filename) → String
expands relational path FNAME which is in the current srcdir, into the absolute path.
srcexist?(filename)
true if a file FNAME exists in the current srcdir.
srcdirectory?(filename)
true if a directory FNAME exists in the current srcdir.
srcfile?(filename)
true if a normal file FNAME exists in the current srcdir.
srcentries(relative_path = ‘.’) → [String]
returns the list of file entiries in the directory “current srcdir + ‘/’ + relpath”
srcfiles(relative_path = ‘.’) → [String]
returns the list of file names in the directory “current srcdir + ‘/’ + relpath”
srcdirectories(relative_path = ‘.’) → [String]
returns the list of directory names in the directory “current srcdir + ‘/’ + relpath”

Clone this wiki locally