def get_spec_from_source(self, source_dir, file_name=None): source = DirFactory(source_dir) if not file_name: file_name = join(source.source_dir, self.spec_file) else: file_name = join(source.source_dir, file_name) with self.in_dir(): symlink(file_name, self.spec_file)
def fetch_sourceballs(self, profile=None, regen=True): pkg_srcen = self.sources pkg_srcen = (DirFactory(pkg_src) for pkg_src in pkg_srcen) self.cfg['sourceballen'] = list() with pwd(self.dir): for pkg_src in pkg_srcen: if regen: pkg_src.setup_sourceball(self.ver(profile)) symlink(pkg_src.sourceball_loc, pkg_src.sourceball) self.cfg['sourceballen'].append(pkg_src.sourceball) pkg_src.close()
def setup_source(self, package): '''Given a package, set's it up in the buildroot for being built with rpmbuild package is a directory name to a Package (Directory). returns nothing ''' pkg = DirFactory(package) with pwd(pkg.dir): symlink(pkg.spec_file, join(self.dir, 'SPECS', pkg.spec_file)) pkg.fetch_sourceballs() for source in pkg.spec_all_sources(): log.debug(source) symlink(source, join(self.dir, 'SOURCES', source))