importosimportcollective.recipe.templateclassRecipe(collective.recipe.template.Recipe):def__init__(self,buildout,name,options):""" Create a Mandriva RPM spec file from a template - input: path to spec template - output: path where generated spec should be saved - version: rpm version number, can be either the version or a file path containing the version - (section) name: rpm name - build_requires: a list of Mandriva packages required to build the rpm - svnpath: SVN path to current buildout optional: - release: rpm release number. Defaults to 1 """package_list=options['package_list'].splitlines()package_list=map(lambdax:x.strip(),package_list)dependencies=["BuildRequires: %s"%pkgforpkginpackage_listifpkg]version=options['version'].strip()print'"%s"'%versionifos.path.exists(version):version=open(version,'r').read().strip()release=options.get('release',str(1))options.update(dependencies="\n".join(dependencies),version=version,release=release)collective.recipe.template.Recipe.__init__(self,buildout,name,options)