def install(package): package_name = package['package'] + '-' + package['version'] stamp = package_name + '.stamp' if not os.path.isfile(os.path.join(build_path, stamp)): tfile = package_name + '.tar.gz' url = package['source'] + tfile bt.show_variable('url', url) try: wgetter.download(url, outdir=build_path) except urllib2.HTTPError: print 'Got blocked. Trying manual wget' os.chdir(os.path.join(build_path)) bt.call_verbose(['wget', url]) tar = tarfile.open(name=os.path.join(build_path, tfile), mode='r:gz') tar.extractall(path=build_path) os.chdir(os.path.join(build_path, package_name)) prefix = '--prefix=' + os.path.join(install_path) bt.call_verbose(['./configure', prefix] + package['configure_options']) bt.call_verbose(['make', '-j', jobs]) bt.call_verbose(['make', 'install']) bt.call_verbose(['make', '-j', jobs, 'check']) os.chdir(build_path) with open(stamp, 'a'): os.utime(stamp, None)
def set_path(target): path = os.path.abspath(os.path.join(local_path, target)) bt.show_variable(target + "_path", path) bt.mkdirs(path) return path
for olp in olps: this_path = None for path in os.environ["LD_LIBRARY_PATH"].split(':'): if olp['search'] in path: this_path = path break if this_path is not None: args.configureflags += ['--enable-' + olp['name']] # show set options for builder tasks = ['autoreconf', 'remove', 'configure', 'make', 'makecheck', 'makedistcheck', 'all'] options = ['jobs', 'errors'] variants = ['configureflags', 'compiler', 'optimization', 'fcflags', 'build', 'tag'] arg_dict = vars(args) bt.show_variable('base_path', base_path) for item in tasks + options + variants: bt.show_variable(item, arg_dict[item]) bt.show_variable('prefix', prefix) def _call_verbose(cmd): lines_to_show = ['Package name:', 'Version:', 'Date:', 'Status:', 'version', ' path.', ' path ', 'checking for '] bt.call_verbose(cmd, filter_strgs=lines_to_show, show_errors=args.errors) # autoreconf if desired os.chdir(base_path) if args.autoreconf: _call_verbose('autoreconf')